diff --git a/bank-feeds/.speakeasy/gen.lock b/bank-feeds/.speakeasy/gen.lock deleted file mode 100755 index 640df3e2c..000000000 --- a/bank-feeds/.speakeasy/gen.lock +++ /dev/null @@ -1,2998 +0,0 @@ -lockVersion: 2.0.0 -id: 87e6188d-fa80-4f96-a443-9e303956b15f -management: - docChecksum: 4d9c9e0c2c4bcc00392c83527d11c46c - docVersion: 3.0.0 - speakeasyVersion: 1.761.5 - generationVersion: 2.879.13 - releaseVersion: 8.2.1 - configChecksum: 5a4e54c448a6d30dfedfba8db6c61937 - repoURL: https://github.com/codatio/client-sdk-typescript.git - repoSubDirectory: bank-feeds - installationURL: https://github.com/codatio/client-sdk-typescript - published: true -persistentEdits: - generation_id: 05419e8e-e24a-4e02-a2ae-d0c7a0b326c9 - pristine_commit_hash: cbe57a6ab6b2897641bc8a9ee1262a9440aa8bbf - pristine_tree_hash: 4fc841e9f39bdb7bc8faf7c3b0925fbfae16d600 -features: - typescript: - additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.14 - core: 3.26.48 - decimal: 0.1.2 - defaultEnabledRetries: 0.1.0 - deprecations: 2.81.1 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.1.2 - examples: 2.82.5 - globalSecurity: 2.82.16 - globalSecurityCallbacks: 0.1.0 - globalSecurityFlattening: 0.1.1 - globalServerURLs: 2.83.1 - methodArguments: 0.1.2 - nameOverrides: 2.81.4 - nullables: 0.1.1 - responseFormat: 0.3.0 - retries: 2.83.0 - sdkHooks: 0.4.0 - serverEventsSentinels: 0.1.0 - unions: 2.86.4 - uploadStreams: 0.1.1 - webhooks: 1.5.1 -trackedFiles: - .gitattributes: - id: 24139dae6567 - last_write_checksum: sha1:26d16d8297b104945139da8c25bd38feeaad3e25 - pristine_git_object: 113eead5093c17d43a46159132885318f281a68a - .npmignore: - id: aa70c1f807c3 - last_write_checksum: sha1:6572da81f2e7a978ec29c22c2210bf461c5897b2 - pristine_git_object: 670ac0a62d7e568c9d44a14f5deafb8442a255d8 - FUNCTIONS.md: - id: 21b9df02aaeb - last_write_checksum: sha1:b35b02f32cb7a265ed4fb770f287c9b2fed8bdbe - pristine_git_object: 0ff465f8ac4b025673dd8c33bbcf6593b40c8d86 - RUNTIMES.md: - id: 620c490847b6 - last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 - pristine_git_object: 27731c3b5ace66bedc454ed5acbe15075aacd3dc - USAGE.md: - id: 3aed33ce6e6f - last_write_checksum: sha1:849445159dd9e431e0e74194f7e0d2c538ddfee9 - pristine_git_object: 33eccf5109bc7793fa5dbef9a673c9b0641d5691 - docs/lib/utils/retryconfig.md: - id: 0ce9707cb848 - last_write_checksum: sha1:bc4454e196fcd219f5a78da690375a884f5ed07b - pristine_git_object: 08f95f4552349360b2c0b01802aa71ec3a55d2c2 - docs/sdk/models/errors/errormessage.md: - id: 9affd825e395 - last_write_checksum: sha1:16a6303f683d2b1f8dc684504f891bf7b35c5995 - pristine_git_object: 077dd904c9bde4126da692c94f8271a7decfbf9e - docs/sdk/models/operations/createbankaccountmappingrequest.md: - id: bd558221aea4 - last_write_checksum: sha1:bbe1b43f9d2a4dd4f739ce53ee5e33011f1374f8 - pristine_git_object: ef576a25e105b406a454fd563c20be4fbe08406d - docs/sdk/models/operations/createbankaccountrequest.md: - id: 37b65b9ee948 - last_write_checksum: sha1:9c916c5353b697c70119bdb0b8e6da9a46b048ae - pristine_git_object: 6aa491e5e5bbed5b1f10d1eb5ed8bac534124886 - docs/sdk/models/operations/createbanktransactionsrequest.md: - id: 61ac537983b7 - last_write_checksum: sha1:638d199cb15963744732f82979cf050851019f54 - pristine_git_object: 2692adc1a560a49b88bf42da68a924b34f36b8c6 - docs/sdk/models/operations/createbatchsourceaccountrequest.md: - id: 4c10bb9d7e33 - last_write_checksum: sha1:19c31b5ae2ba606e9f339a0890b378ccd93f414f - pristine_git_object: 8aac7450bc0ff505a42b1df382eb9fedff6830f4 - docs/sdk/models/operations/createbatchsourceaccountrequestbody.md: - id: 33af0302c4fa - last_write_checksum: sha1:ab740488ecb3e35c77073a6e79080a0a498f307a - pristine_git_object: 8ce10aa40b690296a3f019e1ae8b2539f89bb101 - docs/sdk/models/operations/createbatchsourceaccountresponse.md: - id: 339006c51fb0 - last_write_checksum: sha1:af437c93a862926c4b82a2898c8e01ef49ac5b66 - pristine_git_object: 8c074b4ea7ac1f72287b76bf5e1e424ae44747aa - docs/sdk/models/operations/createbatchsourceaccountresponsebody.md: - id: 2bbcd2de69eb - last_write_checksum: sha1:3f761ceb048bba442e5ed3e5a1b461f4a42e38de - pristine_git_object: 770cff4e2520c36f4c47e12ddc93403eae2f298c - docs/sdk/models/operations/createconnectionrequest.md: - id: 43b13768fa3c - last_write_checksum: sha1:a6c172f303adc039195ae6a34edc7e86ed4ac8d8 - pristine_git_object: 4f893963eb12fe5f3f0b62170f7b5cc8064b1623 - docs/sdk/models/operations/createconnectionrequestbody.md: - id: cd2a86f8a996 - last_write_checksum: sha1:2fd76033a9da1837079089cc7f69852a2cbde96d - pristine_git_object: d9e9bd1da7f2d354a55e3be2d9bad8c692d6368c - docs/sdk/models/operations/createsourceaccountrequest.md: - id: 05c91791448e - last_write_checksum: sha1:71f3f0c5a0a7839f9339e38875ff29855ef0703e - pristine_git_object: dcaad0418eea5df5f5a0842a176e62450ed086ab - docs/sdk/models/operations/createsourceaccountrequestbody.md: - id: eaaca08e524f - last_write_checksum: sha1:d00ef4387b7b412af2c863766faf7d03a3c64293 - pristine_git_object: 1d60d9d63c18c7c7cca5c23c6194fbbd45ee196a - docs/sdk/models/operations/createsourceaccountresponsebody.md: - id: 7d71509a944d - last_write_checksum: sha1:ca1a85edc2c0f8744d78c76cfeb2a4b672987538 - pristine_git_object: 7fac96dbe67fc8d9bb889c20a646f17c61580655 - docs/sdk/models/operations/deletebankfeedcredentialsrequest.md: - id: 5129adf66422 - last_write_checksum: sha1:873ed400d2da0a5181f279f12824d3c4b8d43fcf - pristine_git_object: 86bde6db5a946a7c1eeea211412d4ea15a9f0e47 - docs/sdk/models/operations/deletecompanyrequest.md: - id: 01348357e18f - last_write_checksum: sha1:8d3b05344204b3c1eb7d08b51c44df9a7d8b8ccc - pristine_git_object: 41d2a5e19d6b4783878d78d6d4863aac9be8ee93 - docs/sdk/models/operations/deleteconnectionrequest.md: - id: 70fe5fee5d10 - last_write_checksum: sha1:1ac1928c3875f75885046d31fe6e132218efdae3 - pristine_git_object: cb98633e23594bad694228925477f1284797903e - docs/sdk/models/operations/deletesourceaccountrequest.md: - id: fed3540853e7 - last_write_checksum: sha1:4e1f664238c527c28ffe928ea00b92a44738866c - pristine_git_object: ed8bb1ab1bbcb1a362f9dcaecfadb6d6e82ff4e2 - docs/sdk/models/operations/generatecredentialsrequest.md: - id: c472a0485d24 - last_write_checksum: sha1:32fd669fcd7248db66d4b742650b4eb4575de36b - pristine_git_object: 1d7e2648e95b82930e79559ff074595f7b852d38 - docs/sdk/models/operations/generateotprequest.md: - id: 5523bab2663c - last_write_checksum: sha1:0035ec6d55cdb0cab0985ed0064789c9262d59ae - pristine_git_object: f3091a8534ac53252d1abdf8eb00d9713c216183 - docs/sdk/models/operations/getbankaccountmappingrequest.md: - id: 729ad31a3bd8 - last_write_checksum: sha1:e9ce5b6cabe71d2c086ccfb48c2ad971dd47936f - pristine_git_object: f131f56a96d4b2a3348fb74a0ed16af94841644c - docs/sdk/models/operations/getcompanyaccesstokenrequest.md: - id: 092b4607f2a4 - last_write_checksum: sha1:4e1ce05da810ef98c4e97acfe59b763fc9b142ec - pristine_git_object: 20bf1699a2013d10e85a47d11fb220441349645e - docs/sdk/models/operations/getcompanyinformationrequest.md: - id: e53b744ff888 - last_write_checksum: sha1:ce048452983b85256e7baed54131b53e84fa3bdd - pristine_git_object: c26fb4b1abd0f5c4413d0073c0f2b3d6ad217f30 - docs/sdk/models/operations/getcompanyrequest.md: - id: cb14d531f942 - last_write_checksum: sha1:4bea3c78d763223fd458af5dc0de74e4f562f09d - pristine_git_object: 862827f0905bd358efb35397e3a043e0cf0fed39 - docs/sdk/models/operations/getconnectionrequest.md: - id: 6545321b6497 - last_write_checksum: sha1:caacdcca93bd8fe8eb88501e2e3288b736aa3e20 - pristine_git_object: 24a597c3e2a4535b6ffb919680172ced9df648bf - docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md: - id: 0e4ec0ad05f3 - last_write_checksum: sha1:241615e477930e5bb3683d3c821140c09a39ed9b - pristine_git_object: e30f53b829f3dd8962921c3d8354fe6d3a1f4cc6 - docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md: - id: 2106984ee727 - last_write_checksum: sha1:024472858b7cf4c894e40e4bb05c540472fd4ac7 - pristine_git_object: 03782762dad93e32f81fb83ab41a8a3f6c38649b - docs/sdk/models/operations/getcreateoperationrequest.md: - id: f4dd0f994904 - last_write_checksum: sha1:bca18143a5ce69033e88947284adc0e29e702d31 - pristine_git_object: 5551e9453401596419b5438d2885c7182e22c4e3 - docs/sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md: - id: 135a386f2792 - last_write_checksum: sha1:e6aef3ba0c6d7165d39d9790481368490b438db3 - pristine_git_object: e65f2fede8a2e33d39938085749b5801175043b7 - docs/sdk/models/operations/getmanagedbankfeedsyncrequest.md: - id: 0b31668a3b4a - last_write_checksum: sha1:12da169b524ea9bc45b0b08f012722fde34e0120 - pristine_git_object: 9540602079aaed8a17f49ad57ca3f416d12192a1 - docs/sdk/models/operations/listbankaccountsrequest.md: - id: a01485745f09 - last_write_checksum: sha1:ca76642e627d176f16d864e10570f4293317b35c - pristine_git_object: fd6642976ae8bf3d7e2dcabb72cf5875c9502e98 - docs/sdk/models/operations/listcompaniesrequest.md: - id: 605dcf27a33d - last_write_checksum: sha1:e81342f187e44d523a2ac75187cb7fe4f9cbe052 - pristine_git_object: 98745ca15046cec0ec7f04a9397c99acbed94cbd - docs/sdk/models/operations/listconnectionsrequest.md: - id: 6b2aa79356a9 - last_write_checksum: sha1:d0e63347e0e994ca62f0a988257c358b3565d60a - pristine_git_object: 7ce46fba9ba803d5fbcb3aeffff4fe7f9747efb5 - docs/sdk/models/operations/listcreateoperationsrequest.md: - id: 9217ae3156dd - last_write_checksum: sha1:fd905773259f90ccb3da7a117f234c1ee494af19 - pristine_git_object: 7ef11b13b0f8225ea72876c35e6867e5a107b24a - docs/sdk/models/operations/listsourceaccountsrequest.md: - id: 58b5244a1ef0 - last_write_checksum: sha1:6871477a1c5c854a7672fb085bd7fb3f57210fc1 - pristine_git_object: 6807d9d46c81ca7270707aacb53d0c6a4f1bc697 - docs/sdk/models/operations/listsourceaccountsresponsebody.md: - id: 27df2638af94 - last_write_checksum: sha1:0af07a9e8d2ef663b221ac87e8cbfec1c7e69d81 - pristine_git_object: 863e2b26ae0b0eafb941cc100c024413e395f565 - docs/sdk/models/operations/replacecompanyrequest.md: - id: 2f79da54c18c - last_write_checksum: sha1:74c92e51b509c31a78f75ca93c86601eb5f3a1f9 - pristine_git_object: 925a5157bb2fecc42dc9a8090e65da369964a710 - docs/sdk/models/operations/responsebody.md: - id: 2c698ad429cc - last_write_checksum: sha1:461ad008ce115e28966daa0b746a202d95288b92 - pristine_git_object: a753dbbd25ef09071a927916529adf28ef56cc31 - docs/sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md: - id: 177e819ae837 - last_write_checksum: sha1:2f09687e44312e555b0c654599325f90d8f09088 - pristine_git_object: 4f07e7d334cabe04b44ff39b19eb330840025211 - docs/sdk/models/operations/unlinkconnectionrequest.md: - id: 9f3addbe3925 - last_write_checksum: sha1:248a28387fced393b75d67e05130e654ed217972 - pristine_git_object: 860ed85198f854592d8fbb733ef624c8201e86a5 - docs/sdk/models/operations/unlinkconnectionupdateconnection.md: - id: 454c96f5ba2d - last_write_checksum: sha1:be0893ba07e22584c7f652eae464c0801cf6ab5c - pristine_git_object: 9719a8ed1d660cd9683f02ff66d023ad8d68eb9c - docs/sdk/models/operations/updatecompanyrequest.md: - id: 6501e66b32d2 - last_write_checksum: sha1:8b775b20df481a8639feff8cc4017c78fe63d781 - pristine_git_object: 4ee26e57b9116b634ad8f70ff9d34bdf8fc160b9 - docs/sdk/models/operations/updatesourceaccountrequest.md: - id: 5c1e2835507a - last_write_checksum: sha1:3a85f3d6c504cae97825f4ba5e5a0d2d95b82214 - pristine_git_object: a18d6f6df4ce42c16f9be77d3cbe2c14fd72df83 - docs/sdk/models/shared/accountinfo.md: - id: 80be3d0b1178 - last_write_checksum: sha1:3da80597b95b39903779342cf62c8c0cd18e855a - pristine_git_object: 8905c80f1dc7945bb6b94865d113afea8a44b247 - docs/sdk/models/shared/accountingbankaccount.md: - id: 35bbd90bb6b9 - last_write_checksum: sha1:761626aaf7fb276275f2ca09f88bbd5d118873c8 - pristine_git_object: 6652511981773f5f88ba94e6da5b0767adfec444 - docs/sdk/models/shared/accounttype.md: - id: 1c016d1deade - last_write_checksum: sha1:eae7eac028c7cf16504af88a152b2914fd410e83 - pristine_git_object: b62adfe661fa400427213a6dd45ecb96006a6d7a - docs/sdk/models/shared/bankaccountcreateresponse.md: - id: f263f6407a75 - last_write_checksum: sha1:f0ac3fe1af42fc5f66ccd678094a6f97bdb3bd05 - pristine_git_object: f570b31941baf0bf281b4fd4e0995538bcdcd507 - docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md: - id: 4b0a2ad549d1 - last_write_checksum: sha1:bbcfbe7c268f8fe6256632939a112cd6a18537e7 - pristine_git_object: ba92df96c6eb528cf6597db0e46a572793ef7b80 - docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md: - id: b730130ce3bb - last_write_checksum: sha1:e2c485e5a9283eeab84096c122cb1ccccd001d7c - pristine_git_object: 827405a70e1c13f8e3dec88bfaee384fe92a7c32 - docs/sdk/models/shared/bankaccountcreateresponsemetadata.md: - id: 21e63e237527 - last_write_checksum: sha1:13972fffeacb6d8c787d5dd21813f184433cf63d - pristine_git_object: 3111533b91b7622c0b0bbe4b82e17e40cd403ef1 - docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md: - id: 425bf7bd6f31 - last_write_checksum: sha1:e074051ce54f8da1fc015345f9fc69df21dc4ad8 - pristine_git_object: c2717966f4975b2ec861309facd44e20f3717fbc - docs/sdk/models/shared/bankaccountcredentials.md: - id: 0c4a89fa2438 - last_write_checksum: sha1:d6fd0299b58e4ddf16226c15c1883d9b2ff8d766 - pristine_git_object: 564ab2f6f17bb6cd48855fe380fd28815dcc37f3 - docs/sdk/models/shared/bankaccountprototype.md: - id: 18647b021627 - last_write_checksum: sha1:27a2a0c4dbaaf6194ffd1a5b6a87184254165ca3 - pristine_git_object: d7cfac381cef350bbd188a0a8f7bcba15e7115d3 - docs/sdk/models/shared/bankaccounts.md: - id: a35b8eb0dc92 - last_write_checksum: sha1:c1595d077c91db54ea79c0e68d37094b6b6819a0 - pristine_git_object: 8e3ee75bae8f520dc72cfb417c0ecad1f654ef2f - docs/sdk/models/shared/bankaccountsbankaccounttype.md: - id: 4309e95ed901 - last_write_checksum: sha1:640a536a3449daa239c97b6cb4ef61c1e20f0b3a - pristine_git_object: 9532fc9bbcd42f6a239dac7fe295f2b8c488bd91 - docs/sdk/models/shared/bankaccountstatus.md: - id: bb5d0730c110 - last_write_checksum: sha1:73e55665870f2257d33d3c6c941023227a018862 - pristine_git_object: 5a3e4ca9a1797ef6456608658a87d6e786067951 - docs/sdk/models/shared/bankaccounttype.md: - id: c1d73962c4ab - last_write_checksum: sha1:2636cb60e30c9ac4035c5dbc56c3debd830e4b32 - pristine_git_object: 740850306509860d0510a61cf4836717c6fe619a - docs/sdk/models/shared/bankfeedaccountmapping.md: - id: 167dd8d2a056 - last_write_checksum: sha1:8383f7bb04df838991f3ac63124fd1cbe9f19081 - pristine_git_object: 09196a7c820ff7a74112cba189aaafd551640885 - docs/sdk/models/shared/bankfeedaccountmappingresponse.md: - id: f40d71bd8028 - last_write_checksum: sha1:4360759603438a7ad0773bff8e762b55ad645310 - pristine_git_object: 333a5a6755ee047c225b94577d3181cf19b68ae6 - docs/sdk/models/shared/bankfeedmapping.md: - id: 4556956cceea - last_write_checksum: sha1:5bfa5fbccd483492c61919887488d14f61fe1aa0 - pristine_git_object: d1def887a5dcda3f291db5e6997b59e754602bef - docs/sdk/models/shared/banktransactions.md: - id: f31f614ad172 - last_write_checksum: sha1:7ef7b76f5031d99e2c0b680a99d27f88bde21853 - pristine_git_object: 2f275ae2be5cae16cb076b23d9dc267a183394e2 - docs/sdk/models/shared/banktransactiontype.md: - id: 59f43c489d59 - last_write_checksum: sha1:85b8ff753f83d84a98f0d7119e43f3871b7389d1 - pristine_git_object: 65b9458d85ea450eb90dabbfdcef5cf0cce9d3e2 - docs/sdk/models/shared/clientratelimitwebhook.md: - id: 2ad187176bc8 - last_write_checksum: sha1:7d980b3eebeb62a7d7779cd6e89d35b71173d446 - pristine_git_object: c597b7bda65df644c947826cd023e668b4b27979 - docs/sdk/models/shared/clientratelimitwebhookpayload.md: - id: 455bfe8fe625 - last_write_checksum: sha1:045545dbd7331e23f6d89cbd130c2cd5ac2c3bc6 - pristine_git_object: dfe894fe9cfa49edfe3f6d3e1a6a929eb9db6234 - docs/sdk/models/shared/companies.md: - id: d934c193ecb6 - last_write_checksum: sha1:147103bcd4e5ff0fc337eb48387c228c9e26b7e7 - pristine_git_object: 5af6e3b30477ddd56c1312f9cab93f2691283887 - docs/sdk/models/shared/company.md: - id: fb5206b144df - last_write_checksum: sha1:81a080332be117b66a989738a92a23cb6124df4f - pristine_git_object: d5f01615068e4e0cdda9edb19690d5859ab9c1ab - docs/sdk/models/shared/companyaccesstoken.md: - id: 094c5ef713ca - last_write_checksum: sha1:01df35fb3179f39f88176f912155ac7fff4ea87e - pristine_git_object: 118d036963db46e1c80880edcc0129c048afb2dd - docs/sdk/models/shared/companyinformation.md: - id: d78b0b4b325a - last_write_checksum: sha1:67b4f04108a1dcd66691df6772f234a07e325fcd - pristine_git_object: be6ec7721a0de8cc3fb484bba0b57b00a0bf17f2 - docs/sdk/models/shared/companyreference.md: - id: eb83cae3df56 - last_write_checksum: sha1:d8e1fc5383f93dc63b46bb47ab0b34a1bdcf8336 - pristine_git_object: 30008f0b1405043bacae53146d2c19857fcd0a28 - docs/sdk/models/shared/companyreferencelinks.md: - id: bdd0ee48a65d - last_write_checksum: sha1:eb9b41cce8b2cd73a1af765d6e404305cc56d3dc - pristine_git_object: 3426de5a453db70e24aeae5ece97342fc377a089 - docs/sdk/models/shared/companyrequestbody.md: - id: 3f3dfd0aa865 - last_write_checksum: sha1:14d458f65ae11bfbea58dee3f034beaa49c0508f - pristine_git_object: e32e0a267d1289615c15ca07f91080d08bbe505f - docs/sdk/models/shared/companyupdaterequest.md: - id: cef525a660f4 - last_write_checksum: sha1:671a764917e2cc5fe5b582b79796f84476a0771c - pristine_git_object: ff85ddcb72f4464c26af235e2db46177bcd68d27 - docs/sdk/models/shared/connection.md: - id: 1c171381dd82 - last_write_checksum: sha1:35207ea6a904ec7cd782ac6f2393a49f1e5546ae - pristine_git_object: 736f40fee0f7b390a287b0e2ca22a8aa3e026de5 - docs/sdk/models/shared/connections.md: - id: c39072f6f8dc - last_write_checksum: sha1:0fb76ce5f360b1ef1dfda85e9d1be81501ae969c - pristine_git_object: efc10143bb9f4c168ea9cf0a286ba77105e390c5 - docs/sdk/models/shared/createbanktransactions.md: - id: 27919078a942 - last_write_checksum: sha1:28a58ced1fc7912329cb2317068db69cd12e6a34 - pristine_git_object: f0acb4741c6c8c7d014bd8040c367d23b3877b50 - docs/sdk/models/shared/createbanktransactionsresponse.md: - id: a8a9e5d7ae63 - last_write_checksum: sha1:ce27278c067bf5f7527af8ccde20e5f453a8c977 - pristine_git_object: 5665fb4e6241d684d6834d8198c09daa46ba3a36 - docs/sdk/models/shared/dataconnectionerror.md: - id: 993cf6eb3364 - last_write_checksum: sha1:66dffde23f49d66e69187d1a788ab0e6b4063d3e - pristine_git_object: ff1941795235aeb16d99a193fa3010badc240f30 - docs/sdk/models/shared/dataconnectionstatus.md: - id: fd14e3dc6ca5 - last_write_checksum: sha1:c21f924a09f910b8edea5c5af60e7b19275d0cad - pristine_git_object: e2d34ba7c69deed52549a28f7542258ced4992d7 - docs/sdk/models/shared/datatype.md: - id: 0338d85c906d - last_write_checksum: sha1:d540b1f315b195b5e76c9f9f8998a53defc3fe30 - pristine_git_object: 0eea15b2d489ebc23d4e10013e31598736ec6cf5 - docs/sdk/models/shared/errorstatus.md: - id: d836c01e48c6 - last_write_checksum: sha1:821fd34778440a0b07dc6e553009651b16632006 - pristine_git_object: cd6944da5e9dc2b6585ec10430a94e8f93a1a08d - docs/sdk/models/shared/errorvalidation.md: - id: a1197fba13d0 - last_write_checksum: sha1:f8f5a53f52002fc9d83cb88786cc92e2bc48cfc6 - pristine_git_object: 78bd6240492a01e95663f66b517355399d37c805 - docs/sdk/models/shared/errorvalidationitem.md: - id: dbec2a990008 - last_write_checksum: sha1:0d41c04448e4c440868bdd1e69574f7a3ca93d84 - pristine_git_object: 412e056fc6afeb32861290e9e8d2305660bdbd36 - docs/sdk/models/shared/generateotpresponse.md: - id: 120c935d4726 - last_write_checksum: sha1:1d2230f07713912ad223150c0b23aecb077c9f6f - pristine_git_object: f2fa1c91ff61f0724f6ec4a0fc7bd288eb2f700c - docs/sdk/models/shared/halref.md: - id: 140248af964e - last_write_checksum: sha1:ba18e5a5ba845282037c2aa260b088dda9ce8a4d - pristine_git_object: 4973e8957db127e76a38f1c69867e487983c1273 - docs/sdk/models/shared/links.md: - id: fa66a5b5f260 - last_write_checksum: sha1:2f3def17186b0e53083cc5a8ac3433d8aeccd900 - pristine_git_object: 888c08008cccf3c2b62e3e4551ed555ba3183d84 - docs/sdk/models/shared/metadata.md: - id: d5813bbccd6a - last_write_checksum: sha1:57a134d2770b13031999050060ebf0421e739b06 - pristine_git_object: 86dcfd9507343108bd834ed6851b0fb15b076c8d - docs/sdk/models/shared/pushchangetype.md: - id: 53824528b4ac - last_write_checksum: sha1:87fcf6869d7d0409d1d135feb76c16d6c8ae3de4 - pristine_git_object: 4552fc17da1ceea844a3a793ff02b0090a58cade - docs/sdk/models/shared/pushfieldvalidation.md: - id: be50fc267930 - last_write_checksum: sha1:f5c57818097564f6a59ea606b5d4841f313063d4 - pristine_git_object: 3fd84a29fa110962ca2ee5c8daeb2b3b76397b61 - docs/sdk/models/shared/pushoperation.md: - id: 862ef21ffa69 - last_write_checksum: sha1:fa6da8d5dab0447dc1b58fa964a4c8c183b65fd8 - pristine_git_object: aa07943039cea53e4b3c0f229936c2c61bc383b5 - docs/sdk/models/shared/pushoperationchange.md: - id: be046171d3af - last_write_checksum: sha1:8718485c0097b267f1fe3d11ae579ee230d71ca1 - pristine_git_object: f6e4fb1138dee12447b4a9f8129793e3f1475144 - docs/sdk/models/shared/pushoperationref.md: - id: 41359c8937dc - last_write_checksum: sha1:ef3743735aa020270b1c95d822c3cab0586fa036 - pristine_git_object: d2e2d036e65726e732b540f885d410fa4a74c12a - docs/sdk/models/shared/pushoperations.md: - id: 7efd8c6374e2 - last_write_checksum: sha1:1cba5e9a9fc28fdea746d575f29d4b2e0c2861d4 - pristine_git_object: 61dd9da1d361af97eff2c0e6dcf3428b4df7849e - docs/sdk/models/shared/pushoperationstatus.md: - id: c01cab5bc311 - last_write_checksum: sha1:2da305becec9f5fa55586f209f4c9f9afa2707ca - pristine_git_object: f38df5749a43ea0853c6336d539339a653fedf43 - docs/sdk/models/shared/pushoption.md: - id: 28a9b11a0d39 - last_write_checksum: sha1:6627ea0322297602311e3d9f46d02ab30bc74105 - pristine_git_object: 07cf6ff144ef914d702b3eac4b0f1d95ddabcce3 - docs/sdk/models/shared/pushoptionchoice.md: - id: 3dc25ab7bea6 - last_write_checksum: sha1:154f6468232fc9577efb17ee9cd674ca260d6602 - pristine_git_object: fee33ca7cee64bf1009799f9aa6fe63d12fa0a51 - docs/sdk/models/shared/pushoptionproperty.md: - id: 06f73d448642 - last_write_checksum: sha1:89c8b93d3bb49ab6448b2d02e543af681b47d18b - pristine_git_object: 6c385187a698ac57168c015eabaad6c9ba216e8e - docs/sdk/models/shared/pushoptiontype.md: - id: cc1fc9e23267 - last_write_checksum: sha1:cc69c42f211b443c79182794698a26c747c7585f - pristine_git_object: 4a7ded0f9f2454b671d4255b689249884db24f24 - docs/sdk/models/shared/pushvalidationinfo.md: - id: 10ddca1b4793 - last_write_checksum: sha1:3b4074599b3cae784d51568b40c0b3a5c533ff6b - pristine_git_object: f607f413422cf2cb24d918604209516458da01c6 - docs/sdk/models/shared/result.md: - id: d7c5afd91cc2 - last_write_checksum: sha1:565fffba556e216063016f8fb296786378853dd5 - pristine_git_object: 10e9aba1b5fe789960ec6e946c67e72c7fd69afd - docs/sdk/models/shared/routinginfo.md: - id: 0df4ff9bfd7a - last_write_checksum: sha1:6e8db4edce1a08605a0e0a83813050505b6fdf22 - pristine_git_object: e5adefe6a8a15a0520536a32332b0ad9d97f21cd - docs/sdk/models/shared/security.md: - id: 972729c50a07 - last_write_checksum: sha1:258ab3cad5e7337bf5649ac8be280923aa8cfa5c - pristine_git_object: 4d603b133c9a0f1a9f260e9bf9dce1840a43fa5c - docs/sdk/models/shared/sourceaccount.md: - id: 5d0b671865a7 - last_write_checksum: sha1:65e49dd9e9e20e9424e3dc58f5dba8fc643fc039 - pristine_git_object: 269deb6a9327e4cf7b4b17c5c4aaaef9fe596fa4 - docs/sdk/models/shared/sourceaccountbatchcreateresponse.md: - id: 2135311025dd - last_write_checksum: sha1:fc7ae8224b0bbc841a121a4217b33499d5426296 - pristine_git_object: 688086a4842fcdff530d7038337ab800945b8901 - docs/sdk/models/shared/sourceaccountbatchcreateresult.md: - id: 5989c3610acc - last_write_checksum: sha1:1782c0a341957e9682fd46302beed7861ecf943b - pristine_git_object: 706136b80944634223e551e4f0d66289b6015ce7 - docs/sdk/models/shared/sourceaccountbatcherrorresponse.md: - id: 3d2a6348dc42 - last_write_checksum: sha1:07bedf97351992a2482d9f3f19dd4960b2c32acd - pristine_git_object: 3dbbd4932b4ca09642dac0313051a286ce4cf2da - docs/sdk/models/shared/sourceaccountprototype.md: - id: 92a052035349 - last_write_checksum: sha1:fe556a4218429c0fa9297194db0ada21f9559e9c - pristine_git_object: 20c6eb998773abad04cce5729d5061ae9c242317 - docs/sdk/models/shared/sourceaccountstatus.md: - id: 880cb0adee76 - last_write_checksum: sha1:09d8681660158be38eb1cc545e5889e7a4cfa8f0 - pristine_git_object: bcf75530bf8960d5a9491301869dbaf003957c9c - docs/sdk/models/shared/sourceaccountv2.md: - id: 7753759638f1 - last_write_checksum: sha1:c58ab41767d17fb494f49e05424c648fd207a51f - pristine_git_object: 011893577a819713e11948d3863a9a309fbc4eac - docs/sdk/models/shared/sourceaccountv2accounttype.md: - id: 56fee97c1823 - last_write_checksum: sha1:0f20cd3f4e18e0015433489b589e1983c1ea719f - pristine_git_object: 52ec0b0f08c1049c093bfd8123de7586233f4119 - docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md: - id: 3ea0d8d1b398 - last_write_checksum: sha1:f66f8522480e92b3f01a37e82f80d4a7cb123ae0 - pristine_git_object: 4edffb1ca274a004ac610dc4f0789272b151b706 - docs/sdk/models/shared/sourceaccountv2batchcreateresult.md: - id: 771b668fa522 - last_write_checksum: sha1:a808e47ab9882668a3a6a876072c8d52d4aad432 - pristine_git_object: 3b780231fa744fce7868f8d0213fa0b975081c00 - docs/sdk/models/shared/sourceaccountv2prototype.md: - id: 6b82ee044a9e - last_write_checksum: sha1:cd51b5c9c233a2547afe8c373a93d458fe311a04 - pristine_git_object: 13d5b35107a24f4957d06a30df228083f6139b76 - docs/sdk/models/shared/sourceaccountwebhook.md: - id: 9b42f25c1394 - last_write_checksum: sha1:f3672350eb986b4c160daa33092ecbd64412577d - pristine_git_object: 6dfa7bb6c002a56fa97d3b166cceabbe4c2fb5a9 - docs/sdk/models/shared/sourceaccountwebhookpayload.md: - id: fea79ccea3d1 - last_write_checksum: sha1:b472c36708366d64ec1168ec52b5e3e070d4bf5c - pristine_git_object: 7d15c55e5ac09835463d93f5ab263fd3409f0df1 - docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md: - id: b5ec2caf4f38 - last_write_checksum: sha1:118e0153284db2cffc5ae7dd8481827a39203692 - pristine_git_object: a89d113965528b91d70727393cfc7aa4e4379f71 - docs/sdk/models/shared/sourcetype.md: - id: 3ec91bdaf5e7 - last_write_checksum: sha1:99ad5be52a5979e09cc2f318af354c3d27af59f6 - pristine_git_object: 2b2a5e0daed1458fefd0c5deb1987c5fc4a5ab16 - docs/sdk/models/shared/startscheduledsyncresult.md: - id: d7cb0c9d8f65 - last_write_checksum: sha1:9274ecd7adba21f3fe128ffdd65408a0011c03c4 - pristine_git_object: d3d6ae40d93fa932f336749e6a10896893d0834a - docs/sdk/models/shared/status.md: - id: d40dc096aca1 - last_write_checksum: sha1:e58e324abda7448b844415cc93eb39830debc137 - pristine_git_object: 38d0d662b054bc8377a67d33606a1d197a0a818b - docs/sdk/models/shared/supplementaldata.md: - id: 0cbf04657884 - last_write_checksum: sha1:391602018c0ea72963975cfb8f0437f7d86c4f40 - pristine_git_object: ba5bab80a596673a87ab6efa3d9d98131ae27a4d - docs/sdk/models/shared/syncstatusresult.md: - id: 4ebffc555f5f - last_write_checksum: sha1:ce6bc82205bc4f95e4a163ce554ff476c8b139eb - pristine_git_object: cc17370905457140c94a0bd8203d922353817d8c - docs/sdk/models/shared/targetaccountoption.md: - id: cb24a65c1618 - last_write_checksum: sha1:09481dcea5271fe1dddde70ba89d781623688f27 - pristine_git_object: 9c567a39cc4b97373c18ff9d9ff332c9a718c2d0 - docs/sdk/models/shared/type.md: - id: 04645f7284d8 - last_write_checksum: sha1:6b8641f4916f4743575e4f21d0f57875f10f49b0 - pristine_git_object: a54da2e05bdd00ad94bad357df73bfd0efcc3bc5 - docs/sdk/models/shared/validation.md: - id: b9ffd70ca98d - last_write_checksum: sha1:cc3a4d109667cd28e86c4bd25f5f6930fcbab68d - pristine_git_object: 947c1d2e7d9a71471dcec6696aef1db1288a97c7 - docs/sdk/models/shared/validationitem.md: - id: 4e3848a26890 - last_write_checksum: sha1:376efd38cecc4d6b2087d49ed54055370e71b58d - pristine_git_object: 37bf8eff42e72fdcfa2d732c4221876f5f70dc7d - docs/sdks/accountmapping/README.md: - id: 7ad9f6f15c0f - last_write_checksum: sha1:495f909fbd8070caa84b8f4df8205e96177603c6 - pristine_git_object: e7323ddf2c5b7f44beaa9cbfefd440f44d21e316 - docs/sdks/bankaccounts/README.md: - id: 510ffee224ea - last_write_checksum: sha1:5cdd9af0cf11deb082b90b63ed5504961108188a - pristine_git_object: e699973dc5d7cd7bf6ee44b8cb26d45387d1d408 - docs/sdks/companies/README.md: - id: 67e8a49afa67 - last_write_checksum: sha1:7ba44c235b0436ce5a8ef5b3d2aa3fde4ab3d79d - pristine_git_object: fcbd7fcd2cb72934cad1d4ba3c8c3a2c60a2bc2a - docs/sdks/companyinformation/README.md: - id: 319c7ed51023 - last_write_checksum: sha1:bdc6f0dd8e98086f60ee8c55e03c51b9d9b2ba03 - pristine_git_object: 33bcbdacda9e6cb8cde7f4dde00ccd6d4f0fd614 - docs/sdks/connections/README.md: - id: 3ef8931411ea - last_write_checksum: sha1:aef702e2088fa54b724fd3eb1b81d9194018eecb - pristine_git_object: 89dd065e9f4813f5079bf18ede862dfedd039af1 - docs/sdks/managedbankfeeds/README.md: - id: 65ae848bcac2 - last_write_checksum: sha1:62ca2d36dad3e1cdb3b572688fcf64bb2fd46830 - pristine_git_object: 4aebf113122e5a554979ccd8a7677fb05890a196 - docs/sdks/sourceaccounts/README.md: - id: 19ba068a7927 - last_write_checksum: sha1:c7745e1d33da0e3066d0cc6754911e9d9a0e3a0a - pristine_git_object: 42e5aeb0822b7d489b515821f78477a4e448ba92 - docs/sdks/transactions/README.md: - id: 85592abe3c6b - last_write_checksum: sha1:0f377424ee02c4d7f0aa8d1b56aaa1529c229c75 - pristine_git_object: 017e12b02e0b949e580a25db82c34f7c75f54ba8 - eslint.config.mjs: - id: 461c8d07f6da - last_write_checksum: sha1:9398f326377fe47f67af2df6eb6370750c0790b4 - pristine_git_object: 67bccfec985be20a00970d90155752832dd47135 - examples/.env.template: - id: 52cbe5afed92 - last_write_checksum: sha1:8567d0307ec65d15d6f629994073d5f0566e5030 - pristine_git_object: e054cc2dcbdfb96e6377e520dab5952e1be5f072 - examples/README.md: - id: 9d0f69d6e677 - last_write_checksum: sha1:e815c56caa19bc8e52882ab75c6da58bf26de373 - pristine_git_object: 8427890cadb7f2d7223862d94a6ce4c57edac3f5 - examples/companiesCreate.example.ts: - id: d8f031faa355 - last_write_checksum: sha1:2adc7ebcb5c23b92c9af8c8e8262bb3360ebdcef - pristine_git_object: deeb01ef8854b8ede79b287d46bb630da0dff006 - examples/package.json: - id: c1d7b0ec8e7e - last_write_checksum: sha1:59f674a9ce2a40334dacfce9b4b44e3a4b9aaf1c - pristine_git_object: 5849f7aa02de15c0673aa97ccb19d8de40e674ec - jsr.json: - id: 7f6ab7767282 - last_write_checksum: sha1:785fe3c38a1806d71cc2ecdb17cdad62920ed1fc - pristine_git_object: 2a79e4d746b917737220e7e32e08d1b7d7cb2f85 - package.json: - id: 7030d0b2f71b - last_write_checksum: sha1:d4439e40ea9604eb03f3444e92b43977da1183b8 - pristine_git_object: 4c485f34f6811f20a513fb7165383d2b4785d3cb - src/core.ts: - id: f431fdbcd144 - last_write_checksum: sha1:939d4d97f4ee72ccbb797678743af5d6560c7172 - pristine_git_object: 1dae31b240fe68744ef7dcac68191bb5258a03d3 - src/funcs/accountMappingCreate.ts: - id: 230eda741790 - last_write_checksum: sha1:98b1d912f6efd0b1654d4d8ea8b1c116298a7093 - pristine_git_object: 87afa539d19a2a2ef25333aba349c4a9c8e07ac4 - src/funcs/accountMappingGet.ts: - id: f92d2631a9c7 - last_write_checksum: sha1:00d6e2fd058ea5af89e8de85a7c19d160744194e - pristine_git_object: f773c9d0a836f46b363307bfe0c2a8c4d29285ab - src/funcs/bankAccountsCreate.ts: - id: c61c77ddef33 - last_write_checksum: sha1:345833c920a627fc72e475e9939f75f6a6d42d9f - pristine_git_object: 05bbe2119ac32b7576197fad7848be07ec6c9e63 - src/funcs/bankAccountsGetCreateModel.ts: - id: 2b1d95b79b3b - last_write_checksum: sha1:3ff902425b2be20f4944bb9ca4319658ad669c30 - pristine_git_object: b5af064e937569af7dabcfb11fc00788e4ddb492 - src/funcs/bankAccountsList.ts: - id: e3c9aa9e1c6a - last_write_checksum: sha1:4a4ef5be697976818802f689b3d5db68827b2c34 - pristine_git_object: cd9b297a304eb8b919589976f6bc6c802e677b63 - src/funcs/companiesCreate.ts: - id: becfb79b6222 - last_write_checksum: sha1:8b42bfd74af079d30c8625b9726744d78d8aa20a - pristine_git_object: 7e7a1db6d724a140e860d800aaf58b0292817101 - src/funcs/companiesDelete.ts: - id: d4b8d3c15935 - last_write_checksum: sha1:7d4fafa8406d80e9e2466a1bc9c7b80a5bd4fdf4 - pristine_git_object: 02b1e6e4120f2816d44d86c4765fbfc97eddec35 - src/funcs/companiesGet.ts: - id: 497c5e9320c2 - last_write_checksum: sha1:55b47c6fd6e3b0d5446b90d2a8af64249235f4ee - pristine_git_object: 545071735e8cf8ec017fcf24d98a8e0e0aafbe45 - src/funcs/companiesGetAccessToken.ts: - id: 9fd96bcbf643 - last_write_checksum: sha1:f08ed46c7b69d7764b21994a992bb6c36052c105 - pristine_git_object: 1bcac1174a70ca3c707e634b9402c75445edb092 - src/funcs/companiesList.ts: - id: c57fb769a99c - last_write_checksum: sha1:5c1b990c6360dc48b4e191941227e95733146553 - pristine_git_object: 15527202b66ecdcabe5369efa0d75e4e15942f70 - src/funcs/companiesReplace.ts: - id: c141cb91cc73 - last_write_checksum: sha1:f56a8baea5667f2d60a0314780dad92c0a600198 - pristine_git_object: afd29ec3c49c3d602b6ddcf27ed21eed343d0116 - src/funcs/companiesUpdate.ts: - id: e3d7bd676c21 - last_write_checksum: sha1:3281e28ab948bf82b42e53a8666bd373e0c938a7 - pristine_git_object: 3cc4daa5323bd9d99432b9840a096d8379b51e39 - src/funcs/companyInformationGet.ts: - id: d77e867a25e9 - last_write_checksum: sha1:0871891ffa02fa0bf49f1fcebb1f96b0545e8d64 - pristine_git_object: 5b69982a2e09054f52eec28daf9e1478fd6bea03 - src/funcs/connectionsCreate.ts: - id: 0423cc2d060b - last_write_checksum: sha1:cc2164f9f75b0993c9eba46db296d5eb56d935c3 - pristine_git_object: 873af2039a16ef81406e73f9ad8ae57d34ec7838 - src/funcs/connectionsDelete.ts: - id: f33b14b4a39d - last_write_checksum: sha1:928e5e982d2f4f811d83192548c2d8e27964c070 - pristine_git_object: 96b51de6659e11d0e577db8b4d23dfd68ff4786e - src/funcs/connectionsGet.ts: - id: 6a1b6227b285 - last_write_checksum: sha1:7ebe52ee28f4144454f7bff9cbf6257290efa090 - pristine_git_object: c943432c6626086e978fa02746af47964f0cc8dd - src/funcs/connectionsList.ts: - id: ca36cb8b50d3 - last_write_checksum: sha1:d0bbe6c3d0fbf71eec23c16c8b1c9c4ba67c6059 - pristine_git_object: 1a005b025418626c0519ce17a6588c2007c544be - src/funcs/connectionsUnlink.ts: - id: 0ff9d29a8016 - last_write_checksum: sha1:14a5e610b311d398496f606ef9921756176199d9 - pristine_git_object: 6ec90b312c98cdf018af7fd41ef19ddbc1fa5bd8 - src/funcs/managedBankFeedsGetLatestSync.ts: - id: db7edb619f5d - last_write_checksum: sha1:555239587e9e0a45f3f98f9daf67042b43b3552f - pristine_git_object: 431765f8674c5c38d616437158091da319ca81eb - src/funcs/managedBankFeedsGetSync.ts: - id: d1150c7b8fd7 - last_write_checksum: sha1:536a3cde84e4fd33637e42257f86b11d4f6b189c - pristine_git_object: 50f342967813ac30701d90b3136eb606f56c5059 - src/funcs/managedBankFeedsRunAdHocSync.ts: - id: b0a5823e6a0a - last_write_checksum: sha1:1f001f71fd0c241571a666c64dc78297dfa01efe - pristine_git_object: 97783820614c44d51d99324e90cee99458cda0ec - src/funcs/sourceAccountsCreate.ts: - id: 1e20443bfa89 - last_write_checksum: sha1:657edbe41814454e70e33f0caef90d008bfba8c9 - pristine_git_object: d0bd398eb52518e32607a30be46fd01e25e49ae8 - src/funcs/sourceAccountsCreateBatch.ts: - id: ce1a9fe55a5c - last_write_checksum: sha1:288b34f5fb6e68434794a828ef1b1eb69bbf545c - pristine_git_object: 3334dbc33c7b7cdbf0d44cc4ee48ce7dabc4694f - src/funcs/sourceAccountsDelete.ts: - id: bc9977d38917 - last_write_checksum: sha1:7402cd6dd4ccf9f558a23261544bf6798ec1125e - pristine_git_object: f5a7b697b5a63d279c29b42d8497d0c9e3d2484f - src/funcs/sourceAccountsDeleteCredentials.ts: - id: 6391c6e8efe2 - last_write_checksum: sha1:74c79c66f670996b5d7ecf83d1317bb9e1ecd231 - pristine_git_object: 727a5d231bcb26d21ee96b4d24de06204dbf0c2c - src/funcs/sourceAccountsGenerateCredentials.ts: - id: c986697c3d47 - last_write_checksum: sha1:bcd92e16f9c8e9bfae790cad0944e95572afa80d - pristine_git_object: e63f500a254aaf1961682223d280465e6c6870c4 - src/funcs/sourceAccountsGenerateOtp.ts: - id: dbbd220df401 - last_write_checksum: sha1:4d81fcd21af1c4450a7d2c888dce539879445b52 - pristine_git_object: b7272f79eadffa9a356aaa91d167d64809725fe6 - src/funcs/sourceAccountsList.ts: - id: d308b8c480c8 - last_write_checksum: sha1:71fe9e971d8d5dfa4466fe93254d623091d9cc89 - pristine_git_object: 27729b81b8ad4da2551f2a942029638ecd594c91 - src/funcs/sourceAccountsUpdate.ts: - id: c358e8701e67 - last_write_checksum: sha1:e69b56d2f33f98d2feddf613e102f59795887bdd - pristine_git_object: ba81169e5f107e6a23869f1b94c104aef2d502fb - src/funcs/transactionsCreate.ts: - id: f64f7fcda797 - last_write_checksum: sha1:d986174d5afb19443d9417b4db37d55008cbc771 - pristine_git_object: 26442c9217bc97c32fae0742540e986039c8032d - src/funcs/transactionsGetCreateModel.ts: - id: 8423af1719f0 - last_write_checksum: sha1:95cef546c9963fa6d3ee484570683ba596250a74 - pristine_git_object: 02d7357d76b741ce3da8e0b2c5d535b7d3ab8bb0 - src/funcs/transactionsGetCreateOperation.ts: - id: c2cfb726d9d6 - last_write_checksum: sha1:b9590844b568a350decc5d3abb373bb5e1604dca - pristine_git_object: aba97517504ae1d544c136371c66091f4f7b82a7 - src/funcs/transactionsListCreateOperations.ts: - id: aff48913ea84 - last_write_checksum: sha1:876f308b4350ebcb7a2711cb4900c8e7b27eedb8 - pristine_git_object: 7fe300d466c7d5337dacb01a126e7fee8fdad1d4 - src/funcs/validateWebhook.ts: - id: f3ebc1bebb84 - last_write_checksum: sha1:d0ce779958c66a2178c6aeb4d3e98892ef154dff - pristine_git_object: b565cd47f7da3216e5f0a816c8b5bab39e82b193 - src/hooks/hooks.ts: - id: a2463fc6f69b - last_write_checksum: sha1:9a569ea8f3177ddcdfe6cd903feaf5c2d2c36a9a - pristine_git_object: d34c88497fb1cfb22a725e52b4c218f36d0b5c8e - src/hooks/index.ts: - id: 5f2dab62b520 - last_write_checksum: sha1:1a11c073a6cd792932218e1d4ed36b8567bad8ef - pristine_git_object: f60ec7acd76141a71d78008c5a362eb0236d8335 - src/hooks/types.ts: - id: 2a02d86ec24f - last_write_checksum: sha1:a2145ca7943102b61791b4b067fb593f221349b3 - pristine_git_object: 494395f66d0a6de6f6cd8b1dc918557843158c1d - src/index.ts: - id: c5fb850250c7 - last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 - pristine_git_object: dbcba164a0082e3bb8c43cf21fa7f8ffb9d35dfc - src/lib/base64.ts: - id: "598522066688" - last_write_checksum: sha1:b0b12ddbd8625efb47c0e955a18641aeb10c6532 - pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 - src/lib/config.ts: - id: 320761608fb3 - last_write_checksum: sha1:47fff5d9e31379a17ae9216bdaa65d0be9d76158 - pristine_git_object: dd2fab6e9cc02d5cc482b77f75eba6590b1fbb8f - src/lib/dlv.ts: - id: b1988214835a - last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 - pristine_git_object: e81091f5e536f82739f71379b1fddc2d147c49e2 - src/lib/encodings.ts: - id: 3bd8ead98afd - last_write_checksum: sha1:d47614c415b37e092965c34cb668562195701004 - pristine_git_object: 2791d25bc4f7cf6eec17a65f899851e225fa3deb - src/lib/files.ts: - id: e5efa54fcb95 - last_write_checksum: sha1:795c14026405d547bfc47012f7ad9666e530fa7f - pristine_git_object: 6ca6b37d35a12448da176ee2517cc036db12c81c - src/lib/http.ts: - id: 63a80782d37e - last_write_checksum: sha1:797cbf16d3c7c4d62d3ba0eedb08617524938457 - pristine_git_object: 13cf1fd7894a89f727b8d2db2ad24313a94f68c7 - src/lib/is-plain-object.ts: - id: b9862591096a - last_write_checksum: sha1:df687f25a9590b6fd95d39df41a652ae3fd4e517 - pristine_git_object: 61070d3d7c7e5e95b1ed7e7ea21869eb0767db77 - src/lib/logger.ts: - id: 7ee7741a02bf - last_write_checksum: sha1:0ec9d3a2a34c362746b767e4f9a746c055d57a7b - pristine_git_object: d181f2937d4128afbe9b0327e0f81d1fa9c877b7 - src/lib/matchers.ts: - id: d54b2253b719 - last_write_checksum: sha1:4775ae173392e86f356bb1ffd0d16f3c2d7b0d54 - pristine_git_object: b096d6f201a8f1b24dea405dc0cb1c75efdf4c97 - src/lib/primitives.ts: - id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 - src/lib/retries.ts: - id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b - src/lib/schemas.ts: - id: deb4b531fae1 - last_write_checksum: sha1:b8517a14d3043f488f44e3b10ddd6cabdd22242f - pristine_git_object: dc2510e330727b01894e4d3954ea92a62c962e5d - src/lib/sdks.ts: - id: 8a6d91f1218d - last_write_checksum: sha1:66d56bfdbd12a17c58ca2b03f6b10b1c34380dbe - pristine_git_object: 43fcf336ef4986ed91de77f38e0cc8b3d9c4ed76 - src/lib/security.ts: - id: 0502afa7922e - last_write_checksum: sha1:808e939964cd1393080c8b6428dabf33f746bae5 - pristine_git_object: 3da8e733b499dfb3c174dab84751a95ebc42324a - src/lib/url.ts: - id: b0057e24ed76 - last_write_checksum: sha1:3bceadd74bf0b31adf13eb06b7531077c3e07d65 - pristine_git_object: 79e7ce660b3732053e3adcbb5a4cdeb51496e8aa - src/sdk/accountmapping.ts: - id: 5cac3f0dbbb0 - last_write_checksum: sha1:f9e9ffbd02dc9502164dae12298c64ab15f0eb25 - pristine_git_object: 6534541b4b8de8753a160bf80fd733ec42d47e62 - src/sdk/bankaccounts.ts: - id: 0f1139473f13 - last_write_checksum: sha1:7270cb9645c92cbd88727838a5aed875284a67e2 - pristine_git_object: 13907819262d06adcfe8a822ff4eac5050c40c8f - src/sdk/companies.ts: - id: 7d7df3fca5ca - last_write_checksum: sha1:e604203b37b285acb13981aff05226a8f8c89f6d - pristine_git_object: f5755cd509a3aa9873f2640766e615e5f0c87942 - src/sdk/companyinformation.ts: - id: a31ed1f3ffb3 - last_write_checksum: sha1:d4516d03d6de7dd6bac5b0a07f5a0b5ffd025fd5 - pristine_git_object: 4bd519abfaeb57bb0777712d3e1c580678ae2e00 - src/sdk/connections.ts: - id: 5992fff3b5cd - last_write_checksum: sha1:7fbe7d6d1f9aa1ad7059a7d602c7d7704bf4faa5 - pristine_git_object: 9253cd633f20b78f1b3044025146fdeb3409ae97 - src/sdk/index.ts: - id: a857902a703f - last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f - pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 - src/sdk/managedbankfeeds.ts: - id: 570b20ac2f28 - last_write_checksum: sha1:4f1a2d07945d1ee3796bdecf8125a60341c03f75 - pristine_git_object: 0e454a1b70801c49eed30f059f904190c824e6b0 - src/sdk/models/errors/codatbankfeedserror.ts: - id: 409d019b0736 - last_write_checksum: sha1:6978404baf0b5837cbc89653c41c6af9771bdfb6 - pristine_git_object: 030f46e3056e7eff8ae1748fbd653788cd6b488b - src/sdk/models/errors/errormessage.ts: - id: 2bc5b9b70870 - last_write_checksum: sha1:31364c5729715e6c1042908f8683c11756fb201f - pristine_git_object: aaaa11f94b05c7b95a52cf1df514b18e659bfc80 - src/sdk/models/errors/httpclienterrors.ts: - id: 7be0894f205a - last_write_checksum: sha1:994ced121c54fecd0af038ccfb7855fbfd3868ec - pristine_git_object: b34f612124c797c2a1106b9735708f679a90b74f - src/sdk/models/errors/index.ts: - id: 017ae2dc215b - last_write_checksum: sha1:e34d64f352914993fb2b2e8394364a2532930733 - pristine_git_object: 3617ce96454b2f5959cad1f7f99389bcf859b50d - src/sdk/models/errors/responsevalidationerror.ts: - id: 0b76670204e7 - last_write_checksum: sha1:efd45803f6549c5acb3f2348ef0ecdaa38453a09 - pristine_git_object: 9504c0e67a736f69f1ce162a94ca057978670ece - src/sdk/models/errors/sdkerror.ts: - id: c231fdf3b914 - last_write_checksum: sha1:e5824cfbe0a32c44bcfe58a185788aea911ce981 - pristine_git_object: b81e466a8fa1d9a91c6f5b6465387671e6030d5c - src/sdk/models/errors/sdkvalidationerror.ts: - id: 7c8a11e099b9 - last_write_checksum: sha1:a69da17627bcc32b820544608f3400423ea53f26 - pristine_git_object: 6826e1208a5d7b7d310535d18909646522bf0fbd - src/sdk/models/operations/createbankaccount.ts: - id: 384f1f4b636d - last_write_checksum: sha1:6adfd11f3c298c333a5500ecc90222213a936153 - pristine_git_object: d1a7b8063077bcc4e9ad4ff5bef7b224b7155417 - src/sdk/models/operations/createbankaccountmapping.ts: - id: e98e4574d111 - last_write_checksum: sha1:80bfa4b00fd7227d274245e28e2d7c923b77e7fa - pristine_git_object: d21e548883549f646343ca4079574e41cb31b97c - src/sdk/models/operations/createbanktransactions.ts: - id: 17b77e6287bc - last_write_checksum: sha1:2156dad50cdd68c4e55a1a80d1999351f3df2313 - pristine_git_object: f9678d812e245c0b77758f234da87fc6307a27d2 - src/sdk/models/operations/createbatchsourceaccount.ts: - id: b105b991600f - last_write_checksum: sha1:f47fad870f048ba8a5a664aae63c5ec9eb2faa70 - pristine_git_object: 209a03ed4ea4a9b6019f704aaad7881fada1e248 - src/sdk/models/operations/createconnection.ts: - id: fd864cebfe91 - last_write_checksum: sha1:67abdd42c0f4b8669b59225b4cf97763bd0cca4c - pristine_git_object: dc5bcac12be709864c1f9a57ab0591899995abeb - src/sdk/models/operations/createsourceaccount.ts: - id: 3889d4709ad0 - last_write_checksum: sha1:49982516a6ba8b92be4247bd2d00b74488995939 - pristine_git_object: d0b3bc729fb05fce2e13250eecab083f1aadf388 - src/sdk/models/operations/deletebankfeedcredentials.ts: - id: eb25537fc734 - last_write_checksum: sha1:863ea71183ea748ec00f8e6f912bde6829cbe477 - pristine_git_object: 0fc6f9bdbf414dd397f974ac11be6a07ec963a6e - src/sdk/models/operations/deletecompany.ts: - id: feff26e831a7 - last_write_checksum: sha1:3c6c30970b77ef97770f4a9fed7866b08bfd1ad0 - pristine_git_object: dbe555534894ed6e7f64cf4f034fff5fb58ddedb - src/sdk/models/operations/deleteconnection.ts: - id: 918aad3d3a4a - last_write_checksum: sha1:47fa476012d016921380a863c5457ef7babdd186 - pristine_git_object: 83f75997084050b7c35824dc9e065e81e3677b69 - src/sdk/models/operations/deletesourceaccount.ts: - id: bdd9daad69e4 - last_write_checksum: sha1:695946fb017f04210aefe85ed0b3e71b7ae13dd1 - pristine_git_object: 1fa06856e70335ccbc2e8da100d79ff05e6c37ea - src/sdk/models/operations/generatecredentials.ts: - id: ce522bd62e38 - last_write_checksum: sha1:780db3063ecf81fb7d6199ea385633e13ab3cb9e - pristine_git_object: 3266d8687510c48799f06b3782a38aff18a22532 - src/sdk/models/operations/generateotp.ts: - id: 24d915e13d7f - last_write_checksum: sha1:ade4a0915f1de5debcfeb3e770c529b03f8139aa - pristine_git_object: 0852b56ea6b0c8d24eb7d22ab6c953d17e8d9ecc - src/sdk/models/operations/getbankaccountmapping.ts: - id: a25417b7b0d0 - last_write_checksum: sha1:e6a249654fcfec6934fe7ee27b9520ad1344b161 - pristine_git_object: acfa54967558ba0b68864a3bc1573008ad238b51 - src/sdk/models/operations/getcompany.ts: - id: 4bef19281ada - last_write_checksum: sha1:3c30540e6bcdad8e8a51c616dc9e9b21934890ca - pristine_git_object: 77734decc381321230c2bfb8f340633b2064f315 - src/sdk/models/operations/getcompanyaccesstoken.ts: - id: 2d5fc9dd3264 - last_write_checksum: sha1:c0fe9828a6d274e8e301d5b5f1c468eef4220ef4 - pristine_git_object: 6b76f47f238c15e4c80683a6f3081dd5c275a47a - src/sdk/models/operations/getcompanyinformation.ts: - id: 8d727455797f - last_write_checksum: sha1:e3816c8b8f064c4d74ef49a3f5a5dd9e26ded9c1 - pristine_git_object: bcfcdff0ae86f247239cfc63eb26bb55d8f67d27 - src/sdk/models/operations/getconnection.ts: - id: e6be8d1eab2c - last_write_checksum: sha1:94309b857129d317a91f50bae1e58ab670779062 - pristine_git_object: 126d23b8515e33d0e3c796e642e68ee0f74a6e00 - src/sdk/models/operations/getcreatebankaccountsmodel.ts: - id: d2a66212235e - last_write_checksum: sha1:fc4bd85addf7319a97a5a9d57bb5de0e824bc8b2 - pristine_git_object: 455e4e838e4ab6d1db4d47c8850f33ce8398d32c - src/sdk/models/operations/getcreatebanktransactionsmodel.ts: - id: df7a52491e0a - last_write_checksum: sha1:bbc0534c9742b97c566731e75c8c7e237c4ede3b - pristine_git_object: fa76cc44ff82ac4a41927fd8fd84a744f0099ef7 - src/sdk/models/operations/getcreateoperation.ts: - id: 5c83f50e472b - last_write_checksum: sha1:a7b6be219fe9b4c5548972c0499fa15b41ee5f3e - pristine_git_object: 4df2424d9c3cdb9bc5cf6f387f3b2d68be3a795f - src/sdk/models/operations/getlatestmanagedbankfeedsync.ts: - id: 914eda6bdb62 - last_write_checksum: sha1:dbda1687d23b0729d0bc26693e53754f3317992d - pristine_git_object: 3439c9df2f0de77e42174c7f66b6a3706f7b8b85 - src/sdk/models/operations/getmanagedbankfeedsync.ts: - id: f504a167dada - last_write_checksum: sha1:b95b5b410be4d5a24912689f7726c12f34200540 - pristine_git_object: 7dc149bbcad6277af453868529c5c5c43d8a8b81 - src/sdk/models/operations/index.ts: - id: b2864d0519d7 - last_write_checksum: sha1:8e349d266d384d3fc139c311f3d29565cddd385a - pristine_git_object: 30110bc84c89028f02c8fbd9a20242ebf9c7f349 - src/sdk/models/operations/listbankaccounts.ts: - id: 105e8b509f91 - last_write_checksum: sha1:443e961cc5e2b9ae2099cc2e2a2288d58efaf3cb - pristine_git_object: b4244f676ffbeb0ee4409c5bbe0bb3d371b40269 - src/sdk/models/operations/listcompanies.ts: - id: bd514f2d5c1c - last_write_checksum: sha1:1487d8f67d5a1c439e6581e854213aa1a386b9f3 - pristine_git_object: 837a6aae587e8a038402fbcedcd4fcc1873136ba - src/sdk/models/operations/listconnections.ts: - id: 5797f5b9be29 - last_write_checksum: sha1:0e709e410d2b500143f63d78e8eaa9ce4c810a6d - pristine_git_object: d1be0d9421b3b0d768650208abc91adcf7a9b721 - src/sdk/models/operations/listcreateoperations.ts: - id: e24a3a175772 - last_write_checksum: sha1:89b278398f4b381ed74a93ff0528577c575a1004 - pristine_git_object: 069bc8d41c79246d0ed8e6bb7085c95f2ec45656 - src/sdk/models/operations/listsourceaccounts.ts: - id: "645922746142" - last_write_checksum: sha1:9a2c7d7744362c95bbf56e419502e0b4a4c6fc99 - pristine_git_object: ce1e11557f4547a779043d9d7740b3a023cce93e - src/sdk/models/operations/replacecompany.ts: - id: 15f9deaaf7eb - last_write_checksum: sha1:dd56621b0a190db2faed25c4f3f8ccc58c20210e - pristine_git_object: 5ee35551d47caea122b4f502f81b95691cc291ef - src/sdk/models/operations/runmanagedbankfeedadhocsync.ts: - id: 0202819ba043 - last_write_checksum: sha1:0811f1ff7b013a1e9a3d7b60cfd5f681a3e87953 - pristine_git_object: d00834b8601fe7cf1daac9eb2d378f362a4f05e2 - src/sdk/models/operations/unlinkconnection.ts: - id: 91e6d25ecd14 - last_write_checksum: sha1:5f4e32b0424df5658a94c777839f8a75adbe40ed - pristine_git_object: dbdba4a38ab397554e0d92300812dda648e941fd - src/sdk/models/operations/updatecompany.ts: - id: dbafb9e0f8d9 - last_write_checksum: sha1:937aaa5e965aae942c6550456dbe3c37b5d2b280 - pristine_git_object: 37ead4428659b0b2409ad7f6cf54515e544e23ec - src/sdk/models/operations/updatesourceaccount.ts: - id: cd8d92e4c257 - last_write_checksum: sha1:5e7dd3b84e98aff66325c8575ac311337f99a884 - pristine_git_object: 835ff5d804491ab2ff28759162f7a1c08e1ec275 - src/sdk/models/shared/accountinfo.ts: - id: c2e9a79aa7b2 - last_write_checksum: sha1:7fc6b8d19078261ca15cf132c210a41a6466d6ed - pristine_git_object: 3bc9590208c5b1ec4cc3c942ffa27611af33f885 - src/sdk/models/shared/accounttype.ts: - id: d660396c78b5 - last_write_checksum: sha1:07b0a2e16c1c03dda1a9e3a11b690a52046e19d5 - pristine_git_object: 97dd1abbf0bd39810433ae93c285d783cc25b5c6 - src/sdk/models/shared/bankaccountcreateresponse.ts: - id: abf71fe5a767 - last_write_checksum: sha1:21de7e70152606fb42e5a7d59ab358736f20489d - pristine_git_object: 26996d727b6047c2d21f437727284b7d129cc256 - src/sdk/models/shared/bankaccountcredentials.ts: - id: 80896d65d18f - last_write_checksum: sha1:74ccdb29f830b12cfa64e5a0063e39e991a777fb - pristine_git_object: c53a6fa27c96479b0d3dc9011f8cd28d00c12763 - src/sdk/models/shared/bankaccountprototype.ts: - id: 94ee5a709dfb - last_write_checksum: sha1:7f9f29fbc945daa7d53fe74b257e845d4ee12f3f - pristine_git_object: 550cf21be9088d666996406617d10b8c77715e93 - src/sdk/models/shared/bankaccounts.ts: - id: 018343ecedf0 - last_write_checksum: sha1:27d60f2bbc8c2ec663a3561aabd5ff550a77ebb5 - pristine_git_object: 06555a9c96f0a45e6638e33da4c35b3cfd0dee06 - src/sdk/models/shared/bankaccountstatus.ts: - id: 01e2b1dd61c8 - last_write_checksum: sha1:f52ba944c93769df04b70451d9e993db5e89571f - pristine_git_object: bca71b03045f81a36808773116eaa37664a1e10b - src/sdk/models/shared/bankfeedaccountmapping.ts: - id: bad43cff7b97 - last_write_checksum: sha1:27c1296c62cfa2f5e631d820277c257414595cd9 - pristine_git_object: f6c18e8b1764c0143b0b77d8be6daf88434853bb - src/sdk/models/shared/bankfeedaccountmappingresponse.ts: - id: a1343c288be0 - last_write_checksum: sha1:f95cd4f817e98c5d036a46a13738020b17a06ab3 - pristine_git_object: 5f2e99e252d377670092cc477be2a6629c2384ea - src/sdk/models/shared/bankfeedmapping.ts: - id: c66f7d81a7c7 - last_write_checksum: sha1:94f6753cd3c23e547429c17e20b1bee0c48c94f0 - pristine_git_object: 07be2dcfff64c57b46b53a5690f1a329deceaead - src/sdk/models/shared/banktransactions.ts: - id: fcd7e5927a15 - last_write_checksum: sha1:201724a6f3dd04067919a9c2d4a2edb69d76d6a9 - pristine_git_object: 2b4d9da513d277276aee1e19f69c4a2f4d5cfc0e - src/sdk/models/shared/clientratelimitwebhook.ts: - id: c691f6d7f890 - last_write_checksum: sha1:873cdc12f8278470e382ae879c4bb2eb17f7f029 - pristine_git_object: cdc40c0b87eb15c3725596b713a38dec90aa9083 - src/sdk/models/shared/clientratelimitwebhookpayload.ts: - id: d068d62c8d39 - last_write_checksum: sha1:e9a21951c06c14ff5a39fd7379cd1c3bafc314d1 - pristine_git_object: 72605d6242434c3e2be999f0006634d5a193e129 - src/sdk/models/shared/companies.ts: - id: a4b81f9ba7c8 - last_write_checksum: sha1:81432b885d166aad72ebfcdf5b25eb9c822545b4 - pristine_git_object: 0f308542ebb67c7b1d3262721bbe236d1176ef3c - src/sdk/models/shared/company.ts: - id: 8f41ac6a5b4f - last_write_checksum: sha1:0ec439ff0347551f04150b451142cbb5b794241b - pristine_git_object: 945f5eb6651b7c6359e6a36740a323058dcfe018 - src/sdk/models/shared/companyaccesstoken.ts: - id: de9d8c6237e5 - last_write_checksum: sha1:8bbef263606dc3c3a1981ba4f21ffc2d9bb74ae6 - pristine_git_object: 456b2749690603ad7beb11af880bbc444140633c - src/sdk/models/shared/companyinformation.ts: - id: 1ebdfe14e999 - last_write_checksum: sha1:9dbc0cd1df2e1fb556a6d89cb28e22823fdb609a - pristine_git_object: 9efea464cfbceb00a1b57077d2945b75d88bde07 - src/sdk/models/shared/companyreference.ts: - id: f80ee466bdc7 - last_write_checksum: sha1:a13593197e2c55252dac28abfd5493a76a400e5b - pristine_git_object: e40af5e267211b26d0d3b0296484b7450c485126 - src/sdk/models/shared/companyrequestbody.ts: - id: 9e2dd8b2247d - last_write_checksum: sha1:a3027f00426e9affb8b7f8d930db63b89c197607 - pristine_git_object: 5e438635a0842512ed8dd3a9ee464187ed7ff3fe - src/sdk/models/shared/companyupdaterequest.ts: - id: 9a4400207ec8 - last_write_checksum: sha1:371f7f83676f4130f9885c506c8184c53e202390 - pristine_git_object: 442b7a78cb3fde01477e7bb5cec5626c06a9a58b - src/sdk/models/shared/connection.ts: - id: 18ea99cdadfb - last_write_checksum: sha1:1c3498904be31a13124a357c3d5c2be29b635d61 - pristine_git_object: 832a913ba40ccf7a7ed02840d57bf0b81bf015a5 - src/sdk/models/shared/connections.ts: - id: 221acd1ae99a - last_write_checksum: sha1:ef2d949a3163430d3095303bf231c18b7dc93c9c - pristine_git_object: 1278d54c36183c06f6113dd14c25f115be7a6465 - src/sdk/models/shared/createbanktransactions.ts: - id: 54c0e7fdb43a - last_write_checksum: sha1:197bdaaff3303e6fa28a48537b1858076b755001 - pristine_git_object: 4755c3ab9d95e8740673a2b540c76df58205cfe3 - src/sdk/models/shared/createbanktransactionsresponse.ts: - id: cf3b7c29673b - last_write_checksum: sha1:8a4c208436342c6527cddf53a117ab1eb787c6f0 - pristine_git_object: be2265e725fda298bd6f59a3cd9726d134969353 - src/sdk/models/shared/dataconnectionerror.ts: - id: c94cddffcec9 - last_write_checksum: sha1:e968b9983e395410ddd93aa9967671e46066eae2 - pristine_git_object: 1cb816d0f2b87e31e36ad1ece98b6f25bcdb148b - src/sdk/models/shared/dataconnectionstatus.ts: - id: 506ff77d012f - last_write_checksum: sha1:6ab2241aa8830aafaeb937d48e97918a68b9dac7 - pristine_git_object: 88889c800a39f393c9445929bbd2150fc6daf7ca - src/sdk/models/shared/datatype.ts: - id: 24637063ef68 - last_write_checksum: sha1:0f30ba0fccb2ccb50799396e1087fda1034636e1 - pristine_git_object: d2a4952efcce6d31320d5737eab80efbfd05737e - src/sdk/models/shared/errorvalidation.ts: - id: 7595eed057da - last_write_checksum: sha1:b7f44c1f99c9de84a9177a6fba2f76704a894a48 - pristine_git_object: dc97b86b1b0a47cc49cc6ce168bbf2dc7362a7d4 - src/sdk/models/shared/errorvalidationitem.ts: - id: 0fbe584c7194 - last_write_checksum: sha1:ea42d03e55f11719c38dc24ffdd5d982be3b1ce3 - pristine_git_object: cd21ec230bfad899a805264c87467c3a1762e9bc - src/sdk/models/shared/generateotpresponse.ts: - id: 486194f69c02 - last_write_checksum: sha1:2305aff9cdd9b7b1a134208b0dfffc4a755f5847 - pristine_git_object: 82654e5b3531a2d412682d515c458f83859c6a94 - src/sdk/models/shared/halref.ts: - id: 1c4609be4603 - last_write_checksum: sha1:b64b146493fe3613970c549edffd33e58402662a - pristine_git_object: 921d594fb96fe80f20787e9118d3def4a9e2d53c - src/sdk/models/shared/index.ts: - id: e97e906e3c14 - last_write_checksum: sha1:773e370c128255c5d3b4e90590285db3e6f63c3b - pristine_git_object: 7f0f1fd50de64b3de46edb56bf94627ee0951f1e - src/sdk/models/shared/links.ts: - id: 5c9b3efadf74 - last_write_checksum: sha1:453659d4b39a592c99b3b459eb9f44055f4c4195 - pristine_git_object: 751d7d00e4248ebfd0d28dadcc799607e058635b - src/sdk/models/shared/pushchangetype.ts: - id: cf67386a1d21 - last_write_checksum: sha1:455bd6b2ebf2a0aeee8a914030cc903e9fb12b47 - pristine_git_object: 42040ea23eda83d8cb202d9f3239f5a7c62f4bd2 - src/sdk/models/shared/pushfieldvalidation.ts: - id: 8d8e835e5634 - last_write_checksum: sha1:c377b5bd6ef9fd9ab4e480b3e7e9e2a974a741a8 - pristine_git_object: 15fc3a0f565d8c493fb5461a56309ecadbdd69b2 - src/sdk/models/shared/pushoperation.ts: - id: b6592db339e9 - last_write_checksum: sha1:96d6c00dc8a56e64e4430b54f79446ef89a0601c - pristine_git_object: 470b4a2d4afd9205740a70286893f98e91e9637f - src/sdk/models/shared/pushoperationchange.ts: - id: 137f5337781d - last_write_checksum: sha1:c4fcd4f27955e10750e151667bb4ed7b1ecf29f9 - pristine_git_object: 5d771700a367ef509098146f474f10136fe3a577 - src/sdk/models/shared/pushoperationref.ts: - id: 61a311ce2153 - last_write_checksum: sha1:5a308570d299cf4068a5413fcb49296460fd5c79 - pristine_git_object: 9f851e4bac3b7c6a5cda84532fe579e5145896a9 - src/sdk/models/shared/pushoperations.ts: - id: b0489702427e - last_write_checksum: sha1:df0ddbf54bebf12f184c59ce0b7f9cdf5df010c9 - pristine_git_object: 35c08c7262eaf602936441cf831b2d63aafe9faf - src/sdk/models/shared/pushoperationstatus.ts: - id: 4d9d57d9f800 - last_write_checksum: sha1:7de289ab7d0d5365eae9fe17aed4caddaed26622 - pristine_git_object: 133e3b65f122ffae8912b5ca2a3e91c190c97ddf - src/sdk/models/shared/pushoption.ts: - id: 7b36845bb057 - last_write_checksum: sha1:e6da3557367628a63dd0789986bda82a2ac1c8a9 - pristine_git_object: af6a0a0a363f287ee7bc1e6a19bd87942579dfa7 - src/sdk/models/shared/pushoptionchoice.ts: - id: 4f9141171f1d - last_write_checksum: sha1:a254424966daf3d5185d1b272d0f2214424dce0f - pristine_git_object: 315b39f913390a0e7a4785a7d1c7f21693c7ca9d - src/sdk/models/shared/pushoptionproperty.ts: - id: 27745de0e67f - last_write_checksum: sha1:dd3f7838ac5ff9f5edc531b7bddc809dac397111 - pristine_git_object: 0100bc7b68eb80d19a298dc7276202c9faf85575 - src/sdk/models/shared/pushoptiontype.ts: - id: 4f2314173517 - last_write_checksum: sha1:795906b3ad06204f1dcc551385d5bb849607f61a - pristine_git_object: 298c02e2ea74d44d765eebcb7cc7b1054226aed7 - src/sdk/models/shared/pushvalidationinfo.ts: - id: c3bac2e0d020 - last_write_checksum: sha1:233611708647ac824c46a354d05fc0f3b87cdbe3 - pristine_git_object: 3479adce121324a58a8bb938a974762be7f3cae0 - src/sdk/models/shared/routinginfo.ts: - id: 77067a94535c - last_write_checksum: sha1:85f4dc8a828f099d2bf59ad3a3dd7bf998f26044 - pristine_git_object: 14fc385750de821a9bc7e4cf131ee1f8826a0149 - src/sdk/models/shared/security.ts: - id: 4a9790ed1c2f - last_write_checksum: sha1:1b51b365245ab2a0f5f5a06b90093bceb61fc084 - pristine_git_object: 675eaa5827f48cff71e28d1627f8d65a74e10623 - src/sdk/models/shared/sourceaccount.ts: - id: 9af960cebf29 - last_write_checksum: sha1:0386060fe363359d09c9c03fa8ba9e696e31f521 - pristine_git_object: a37867959ff55aae08f692326fa64572c2317c21 - src/sdk/models/shared/sourceaccountbatchcreateresponse.ts: - id: f7f1e60b6a3f - last_write_checksum: sha1:5a7f6e1c08dfc0eb35982826cf37d639a7ced4c8 - pristine_git_object: fa059a9619fb6468e0542e84a4d897275fd011cd - src/sdk/models/shared/sourceaccountbatchcreateresult.ts: - id: 33fe1982385c - last_write_checksum: sha1:77ddfbbd9b2b42bb97ac0eeadbc4b30b90c68250 - pristine_git_object: 2f766665667dcf0205c693ac13818295e474b04b - src/sdk/models/shared/sourceaccountbatcherrorresponse.ts: - id: 053d7e889b64 - last_write_checksum: sha1:ecb0460bfc0953e9ca3cd5cbf3da2738639d893f - pristine_git_object: 2d781c13a81d4e99164e1e842ec3d92d766f9e29 - src/sdk/models/shared/sourceaccountprototype.ts: - id: 12840a2fe33d - last_write_checksum: sha1:daa110e549c4f8fbdce15434372380b3ffe9b626 - pristine_git_object: 02e7f40425e9acb0ca9d858d003007dca16a69eb - src/sdk/models/shared/sourceaccountv2.ts: - id: 9c5e6622649d - last_write_checksum: sha1:9a52c547b1e7164f850921f5d7786eabfd14a607 - pristine_git_object: 22b689c082c8f5ea627177afb9860dba961d2e1d - src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts: - id: 1a2e691a71b9 - last_write_checksum: sha1:332f35b21898a6cad5a2598d5a7885db1d63cf6c - pristine_git_object: 4dd9910be5c8ec2f81bde74d2912132f4a0563ee - src/sdk/models/shared/sourceaccountv2batchcreateresult.ts: - id: 036564b9d7e7 - last_write_checksum: sha1:a7e06271230ea3103ec17b470807b1240f17c16d - pristine_git_object: ab92e513a26dea018f238bc0890d086ea1fe76d7 - src/sdk/models/shared/sourceaccountv2prototype.ts: - id: ada80a3d0663 - last_write_checksum: sha1:37a8ecfb20ffdee52bc8faf83db1dd8418c4f3fa - pristine_git_object: 40ed0379146cbac05b2204b3b355790d5b101e5b - src/sdk/models/shared/sourceaccountwebhook.ts: - id: debf62a50b7b - last_write_checksum: sha1:5414f24d3046dee372a924ee8eb1a284fff7f7ff - pristine_git_object: 60b37d13f719025a0157e5f86f14ab328a9a60c1 - src/sdk/models/shared/sourceaccountwebhookpayload.ts: - id: b216b0d74292 - last_write_checksum: sha1:75384d542e75532b2be3e4aa35d495a2f534a3ea - pristine_git_object: dc27e1b29864368acb8b860ddf7b49cfa8b57bed - src/sdk/models/shared/startscheduledsyncresult.ts: - id: e7a783adc221 - last_write_checksum: sha1:2f8a254f52850a1ea29d47ae00e1543cb02a8c99 - pristine_git_object: 33d6da3a6f8fa6af1476ad15607f2ec861f917cf - src/sdk/models/shared/syncstatusresult.ts: - id: e3f468c0a8f7 - last_write_checksum: sha1:f8a05f726efd5e656e0d20b3eb18067f855f387f - pristine_git_object: ee12fa1695d7b7513a8c5f04776c8739bfeb644d - src/sdk/models/shared/targetaccountoption.ts: - id: 8300966e9d5a - last_write_checksum: sha1:4dad1be6402bc92d79e974e68534022cb07d113f - pristine_git_object: 4a5824cc9656fd587b8802c76bc93216d1d47b1a - src/sdk/models/shared/validation.ts: - id: e4418d9ed08e - last_write_checksum: sha1:ecb74ca87689c6554c1520c793ce71f4d889f15c - pristine_git_object: 3a6a92030507280977e021e0012fd0064b5debff - src/sdk/models/shared/validationitem.ts: - id: 0e34cb6ff62f - last_write_checksum: sha1:7f82caee4bbad4d6d8ddf69c64bf3ebdfdf492cd - pristine_git_object: ca354aa0beffed45e429ad92c2b3e14df222ec00 - src/sdk/sdk.ts: - id: 784571af2f69 - last_write_checksum: sha1:320cfc33672607c566f2f6c2f1d619d60f7aeedf - pristine_git_object: a088bc4f65b1edeb5444cf396b2d2db3529b6958 - src/sdk/sourceaccounts.ts: - id: 8aeb3d8248a0 - last_write_checksum: sha1:ba60634ce5c777156d60ba6e7fe8efe6eddae32c - pristine_git_object: 483b53a2d4954c0a86afa5781f7155d138854ea4 - src/sdk/transactions.ts: - id: bcd7a9b32ed7 - last_write_checksum: sha1:32cf606589edce64a2e6e019a09f8076323bb44e - pristine_git_object: f92b2dd1877522d160bb765427a85b1279ae52c5 - src/sdk/types/async.ts: - id: 966026768b05 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 - src/sdk/types/blobs.ts: - id: 1def31341768 - last_write_checksum: sha1:cf45d78916671cb6345a11c97c633c64402bc27c - pristine_git_object: cce2892d4f573a120ef3907db90ab15f5979cfda - src/sdk/types/constdatetime.ts: - id: 7e64cb450e63 - last_write_checksum: sha1:dfaaf9adfaf49808bd4c9dea0039f21b7088d9c0 - pristine_git_object: fe62144eaf6a2054fc8ca9a98466e70f41b5434d - src/sdk/types/decimal.ts: - id: 4c47ee438ee8 - last_write_checksum: sha1:9e679d0ebb0a5b1efcbae4926d24893181f3fe8f - pristine_git_object: a7895d555b147e9bf9e3cd79f0b0e9f340d5ecd1 - src/sdk/types/enums.ts: - id: 2ac17fb928cd - last_write_checksum: sha1:ee590453d2c87e33e89c633d37ee46907eca0e58 - pristine_git_object: aba0ffd2a3308a31e516d83b52823d80aa65a8f9 - src/sdk/types/fp.ts: - id: d9ec77b9460c - last_write_checksum: sha1:d24994d58f37a1ca106847fcc6d2e976c6f1c093 - pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 - src/sdk/types/index.ts: - id: 8c869d66c5f3 - last_write_checksum: sha1:0e06df309f1646981212f4103ea27cbd65e1f50e - pristine_git_object: 19a7bd013477d20d80a670e6833a0f0c9b1c8aa7 - src/sdk/types/operations.ts: - id: c5e9c75d4266 - last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 - pristine_git_object: beb81e10f0b9eee2ed398a853fe6f737b743f818 - src/sdk/types/rfcdate.ts: - id: fc969c92a7c1 - last_write_checksum: sha1:8e5f382e02fe21c2f2e24deb1b7bbf8cddd3dd16 - pristine_git_object: c79b3f53a3dd922aa2ace5a4191c8652cf9a8e89 - src/sdk/types/streams.ts: - id: e556b428e8dc - last_write_checksum: sha1:cc9ced2dd34a76c3a1bd7784ccda1cc3b37ab9a9 - pristine_git_object: a0163e7a99cea88f21d0ad4ce3af1c720180ee20 - src/sdk/types/unrecognized.ts: - id: 690d294a1973 - last_write_checksum: sha1:d33ac686528492f4cdc0dbf81ed343b4afe020fe - pristine_git_object: b7a2a13f3dff50663429df24ae2f55b647ff1084 - src/sdk/types/webhooks.ts: - id: 0f676e5e22a7 - last_write_checksum: sha1:dbce0cb417bcdcfcae0827fa045ee93ccab1c2c8 - pristine_git_object: 9510d20c09d8dd689f6e37254030de22e997f3cc - tsconfig.json: - id: 61ebb9fd6e8c - last_write_checksum: sha1:79dc1550d921fefec69f8632ed3b24dad41ca2f6 - pristine_git_object: 76110f883cac40bb04fb2f376cd69ea8c8d6d215 -examples: - create-company: - With no description: - requestBody: - application/json: {"name": "Technicalium"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a description: - requestBody: - application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a tag: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - Malformed query: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-companies: - speakeasy-default-list-companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - One company: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - List of Companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - Malformed query: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - Parent multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} - Subsidiary multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-company: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {} - "500": - application/json: {} - replace-company: - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Update description: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Same name", "description": "Additional documents required"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-replace-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - update-company: - Update tags: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"tags": {"refrence": "new reference"}} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": - application/json: {} - "500": - application/json: {} - get-company-access-token: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"expiresIn": 86400, "accessToken": "string", "tokenType": "Bearer"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-connections: - speakeasy-default-list-connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "string"}, "current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-connection: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {} - "500": - application/json: {} - unlink-connection: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"status": "Unlinked"} - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-unlink-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} - "401": - application/json: {} - "500": - application/json: {} - list-bank-accounts: - speakeasy-default-list-bank-accounts: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Dynamics 365 Business Central: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-03-27T14:21:10Z", "sourceModifiedDate": "2023-02-07T00:00:00", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "accountName": "55", "accountType": "Unknown", "nominalCode": "10500", "sortCode": "", "accountNumber": "", "iBan": "", "currency": "GBP", "balance": -352.03, "overdraftLimit": 0, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-27T14:21:10Z", "sourceModifiedDate": "2022-06-07T00:00:00", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "accountName": "555", "accountType": "Unknown", "nominalCode": "40300", "sortCode": "", "accountNumber": "", "iBan": "", "currency": "PLN", "balance": 661.79, "overdraftLimit": 0, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 28, "_links": {"self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}, "current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}}} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-04-25T14:19:12Z", "id": "738783", "accountName": "\\w3fw", "accountType": "Debit", "sortCode": "236972", "accountNumber": "A06268209", "currency": "GBP", "balance": -10484.65, "availableBalance": -10484.65, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-25T14:19:12Z", "id": "738778", "accountName": "2e2bna45hy\\", "accountType": "Debit", "sortCode": "236972", "accountNumber": "D01825250", "currency": "GBP", "balance": -114.4, "availableBalance": -114.4, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 82, "_links": {"self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}, "current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}}} - KashFlow: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2022-09-30T10:29:16Z", "id": "765768", "accountName": "16th Account", "accountType": "Unknown", "nominalCode": "70700", "currency": "GBP", "balance": 326, "availableBalance": 326}, {"modifiedDate": "2022-09-30T10:29:16Z", "id": "765766", "accountName": "1a1a", "accountType": "Unknown", "nominalCode": "70600", "currency": "GBP", "balance": 0, "availableBalance": 0}], "pageNumber": 1, "pageSize": 2, "totalResults": 56, "_links": {"self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}, "current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}}} - Oracle NetSuite: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-05-02T13:24:36Z", "sourceModifiedDate": "2022-07-15T11:34:02", "id": "825", "accountName": "Codat Europe Bank", "accountType": "Debit", "nominalCode": "111111122222111", "currency": "GBP", "balance": 558.22, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-05-02T13:24:36Z", "sourceModifiedDate": "2021-03-26T10:31:40", "id": "826", "accountName": "Codat Europe Bank USD", "accountType": "Debit", "nominalCode": "1133221133", "currency": "USD", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 4, "_links": {"self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}, "current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}}} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-04-26T09:12:37Z", "sourceModifiedDate": "2023-12-16T05:06:45", "id": "20000-933270541", "accountName": "Checking", "accountType": "Unknown", "nominalCode": "10100", "currency": "GBP", "balance": 46954.1, "availableBalance": 46954.1, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:12:37Z", "sourceModifiedDate": "2023-12-16T05:06:45", "id": "550001-1071509830", "accountName": "Petty Cash", "accountType": "Unknown", "nominalCode": "10400", "currency": "GBP", "balance": 500, "availableBalance": 500, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 3, "_links": {"self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}, "current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}}} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z", "id": "164", "accountName": "00", "accountType": "Debit", "nominalCode": "123567", "currency": "GBP", "balance": 0, "availableBalance": 0, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z", "id": "163", "accountName": "11", "accountType": "Debit", "currency": "GBP", "balance": 0, "availableBalance": 0, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 57, "_links": {"self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}, "current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}}} - QuickBooks Online: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z", "id": "202", "accountName": "\\aa", "accountType": "Debit", "currency": "GBP", "balance": 123, "availableBalance": 123}, {"modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z", "id": "193", "accountName": "1 year ago", "accountType": "Debit", "currency": "GBP", "balance": 5300.02, "availableBalance": 5300.02}], "pageNumber": 1, "pageSize": 2, "totalResults": 140, "_links": {"self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}, "current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}}} - Sage 50 (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-03-30T14:42:37Z", "sourceModifiedDate": "2022-11-25T09:25:48", "id": "1200", "accountName": "Bank Current Account", "accountType": "Unknown", "nominalCode": "1200", "sortCode": "23-34-34", "accountNumber": "003234234", "iBan": "", "currency": "GBP", "balance": -20091.04, "institution": "Lloyds Bank PLC", "availableBalance": -20091.04, "overdraftLimit": 120000, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-30T14:42:37Z", "sourceModifiedDate": "2022-11-25T09:25:48", "id": "1210", "accountName": "Bank Deposit Account", "accountType": "Unknown", "nominalCode": "1210", "sortCode": "45-45-45", "accountNumber": "9/00474345", "iBan": "", "currency": "GBP", "balance": 3510, "institution": "Halifax Building Society", "availableBalance": 3510, "overdraftLimit": 0, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 6, "_links": {"self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}, "current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2022-10-24T14:52:53Z", "sourceModifiedDate": "2020-01-27T10:53:26Z", "id": "154d05abe9f24c4babe0f6a741dec1b9", "accountName": "Abdi Internet Bank", "accountType": "Unknown", "nominalCode": "1560", "sortCode": "010101", "accountNumber": "11111", "currency": "GBP", "balance": 49.61, "availableBalance": 49.61}, {"modifiedDate": "2022-10-24T14:52:53Z", "sourceModifiedDate": "2020-01-28T14:00:20Z", "id": "565ce07212bc492c8c2d04f43f9f67e3", "accountName": "Abdi Live Test", "accountType": "Unknown", "nominalCode": "147852", "sortCode": "123456", "accountNumber": "1234567", "currency": "GBP", "balance": -225830.75, "availableBalance": -225830.75}], "pageNumber": 1, "pageSize": 2, "totalResults": 45, "_links": {"self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}, "current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}}} - Sage Intacct: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-04-04T16:31:46Z", "sourceModifiedDate": "2023-03-27T14:11:48", "id": "CREDITCARD:55", "accountName": "CoT Credit Card", "accountType": "Credit", "nominalCode": "10021", "currency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-04T16:31:46Z", "sourceModifiedDate": "2023-03-27T14:15:11", "id": "CREDITCARD:58", "accountName": "Cot Credit Card 2", "accountType": "Credit", "nominalCode": "11112", "currency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 14, "_links": {"self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}, "current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}}} - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-03-15T20:35:07", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "accountName": "Business Bank Account", "accountType": "Debit", "sortCode": "990404", "accountNumber": "987654321", "currency": "GBP", "balance": 6681.79, "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-03-15T20:36:06", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "accountName": "Business Savings Account", "accountType": "Debit", "sortCode": "890303", "accountNumber": "876543210", "currency": "GBP", "balance": 0, "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 2, "_links": {"self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}, "current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}}} - Zoho Books: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"modifiedDate": "2022-10-03T08:40:38Z", "id": "104957000000060010", "accountName": "Abdi Test", "accountType": "Unknown", "sortCode": "112233", "accountNumber": "xxxx5678", "currency": "GBP", "balance": 69858.44, "institution": "Test Bank"}, {"modifiedDate": "2022-10-03T08:40:38Z", "id": "104957000000065002", "accountName": "Abdi Test 2", "accountType": "Unknown", "sortCode": "", "accountNumber": "", "currency": "AED", "balance": 98.03, "institution": ""}], "pageNumber": 1, "pageSize": 2, "totalResults": 4, "_links": {"self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}, "current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-create-bankAccounts-model: - Dynamics 365 Business Central: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [], "information": [{"field": "AccountName", "details": "Needs to be of the format '{No.}-{Name}'"}]}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Bank Account Posting Group with Nominal Account must exist"}]}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "SortCode", "details": "Must have a length between 0 and 20 characters"}]}}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false}, "overdraftLimit": {"type": "Number", "displayName": "Overdraft Limit", "description": "The pre-arranged overdraft limit of the account", "required": false, "validation": {"warnings": [], "information": [{"field": "OverdraftLimit", "details": "Default value is 0"}]}}}} - Exact (Netherlands): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true, "validation": {"warnings": [{"field": "AccountNumber", "details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP."}], "information": []}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must be 6 characters long if the specified currency is GBP."}, {"field": "SortCode", "details": "Must be provided if the specified currency is GBP."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false}}} - Exact (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true, "validation": {"warnings": [{"field": "AccountNumber", "details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP."}], "information": []}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must be 6 characters long if the specified currency is GBP."}, {"field": "SortCode", "details": "Must be provided if the specified currency is GBP."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false}}} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must have a length between 0 and 8 characters"}], "information": []}}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true, "options": [{"value": "AED", "type": "String", "displayName": "AED", "required": false}, {"value": "AMD", "type": "String", "displayName": "AMD", "required": false}, {"value": "AOA", "type": "String", "displayName": "AOA", "required": false}, {"value": "ARS", "type": "String", "displayName": "ARS", "required": false}, {"value": "AUD", "type": "String", "displayName": "AUD", "required": false}, {"value": "AWG", "type": "String", "displayName": "AWG", "required": false}, {"value": "AZN", "type": "String", "displayName": "AZN", "required": false}, {"value": "BBD", "type": "String", "displayName": "BBD", "required": false}, {"value": "BDT", "type": "String", "displayName": "BDT", "required": false}, {"value": "BGN", "type": "String", "displayName": "BGN", "required": false}, {"value": "BRL", "type": "String", "displayName": "BRL", "required": false}, {"value": "BWP", "type": "String", "displayName": "BWP", "required": false}, {"value": "CAD", "type": "String", "displayName": "CAD", "required": false}, {"value": "CHF", "type": "String", "displayName": "CHF", "required": false}, {"value": "CLP", "type": "String", "displayName": "CLP", "required": false}, {"value": "CNY", "type": "String", "displayName": "CNY", "required": false}, {"value": "COP", "type": "String", "displayName": "COP", "required": false}, {"value": "CRC", "type": "String", "displayName": "CRC", "required": false}, {"value": "CUC", "type": "String", "displayName": "CUC", "required": false}, {"value": "CUP", "type": "String", "displayName": "CUP", "required": false}, {"value": "CZK", "type": "String", "displayName": "CZK", "required": false}, {"value": "DKK", "type": "String", "displayName": "DKK", "required": false}, {"value": "DOP", "type": "String", "displayName": "DOP", "required": false}, {"value": "EGP", "type": "String", "displayName": "EGP", "required": false}, {"value": "EUR", "type": "String", "displayName": "EUR", "required": false}, {"value": "FJD", "type": "String", "displayName": "FJD", "required": false}, {"value": "GBP", "type": "String", "displayName": "GBP", "required": false}, {"value": "GEL", "type": "String", "displayName": "GEL", "required": false}, {"value": "GHS", "type": "String", "displayName": "GHS", "required": false}, {"value": "GTQ", "type": "String", "displayName": "GTQ", "required": false}, {"value": "GYD", "type": "String", "displayName": "GYD", "required": false}, {"value": "HKD", "type": "String", "displayName": "HKD", "required": false}, {"value": "HNL", "type": "String", "displayName": "HNL", "required": false}, {"value": "HRK", "type": "String", "displayName": "HRK", "required": false}, {"value": "HUF", "type": "String", "displayName": "HUF", "required": false}, {"value": "IDR", "type": "String", "displayName": "IDR", "required": false}, {"value": "ILS", "type": "String", "displayName": "ILS", "required": false}, {"value": "INR", "type": "String", "displayName": "INR", "required": false}, {"value": "ISK", "type": "String", "displayName": "ISK", "required": false}, {"value": "JMD", "type": "String", "displayName": "JMD", "required": false}, {"value": "JPY", "type": "String", "displayName": "JPY", "required": false}, {"value": "KES", "type": "String", "displayName": "KES", "required": false}, {"value": "KRW", "type": "String", "displayName": "KRW", "required": false}, {"value": "KWD", "type": "String", "displayName": "KWD", "required": false}, {"value": "KYD", "type": "String", "displayName": "KYD", "required": false}, {"value": "KZT", "type": "String", "displayName": "KZT", "required": false}, {"value": "LAK", "type": "String", "displayName": "LAK", "required": false}, {"value": "LBP", "type": "String", "displayName": "LBP", "required": false}, {"value": "LKR", "type": "String", "displayName": "LKR", "required": false}, {"value": "LTL", "type": "String", "displayName": "LTL", "required": false}, {"value": "LVL", "type": "String", "displayName": "LVL", "required": false}, {"value": "MAD", "type": "String", "displayName": "MAD", "required": false}, {"value": "MDL", "type": "String", "displayName": "MDL", "required": false}, {"value": "MGA", "type": "String", "displayName": "MGA", "required": false}, {"value": "MUR", "type": "String", "displayName": "MUR", "required": false}, {"value": "MVR", "type": "String", "displayName": "MVR", "required": false}, {"value": "MWK", "type": "String", "displayName": "MWK", "required": false}, {"value": "MXN", "type": "String", "displayName": "MXN", "required": false}, {"value": "MYR", "type": "String", "displayName": "MYR", "required": false}, {"value": "MZN", "type": "String", "displayName": "MZN", "required": false}, {"value": "NAD", "type": "String", "displayName": "NAD", "required": false}, {"value": "NGN", "type": "String", "displayName": "NGN", "required": false}, {"value": "NOK", "type": "String", "displayName": "NOK", "required": false}, {"value": "NPR", "type": "String", "displayName": "NPR", "required": false}, {"value": "NZD", "type": "String", "displayName": "NZD", "required": false}, {"value": "OMR", "type": "String", "displayName": "OMR", "required": false}, {"value": "PEN", "type": "String", "displayName": "PEN", "required": false}, {"value": "PHP", "type": "String", "displayName": "PHP", "required": false}, {"value": "PKR", "type": "String", "displayName": "PKR", "required": false}, {"value": "PLN", "type": "String", "displayName": "PLN", "required": false}, {"value": "QAR", "type": "String", "displayName": "QAR", "required": false}, {"value": "RON", "type": "String", "displayName": "RON", "required": false}, {"value": "RSD", "type": "String", "displayName": "RSD", "required": false}, {"value": "RUB", "type": "String", "displayName": "RUB", "required": false}, {"value": "RWF", "type": "String", "displayName": "RWF", "required": false}, {"value": "SAR", "type": "String", "displayName": "SAR", "required": false}, {"value": "SCR", "type": "String", "displayName": "SCR", "required": false}, {"value": "SEK", "type": "String", "displayName": "SEK", "required": false}, {"value": "SGD", "type": "String", "displayName": "SGD", "required": false}, {"value": "THB", "type": "String", "displayName": "THB", "required": false}, {"value": "TND", "type": "String", "displayName": "TND", "required": false}, {"value": "TRY", "type": "String", "displayName": "TRY", "required": false}, {"value": "TTD", "type": "String", "displayName": "TTD", "required": false}, {"value": "TWD", "type": "String", "displayName": "TWD", "required": false}, {"value": "TZS", "type": "String", "displayName": "TZS", "required": false}, {"value": "UAH", "type": "String", "displayName": "UAH", "required": false}, {"value": "UGX", "type": "String", "displayName": "UGX", "required": false}, {"value": "USD", "type": "String", "displayName": "USD", "required": false}, {"value": "UYU", "type": "String", "displayName": "UYU", "required": false}, {"value": "VEF", "type": "String", "displayName": "VEF", "required": false}, {"value": "VND", "type": "String", "displayName": "VND", "required": false}, {"value": "VUV", "type": "String", "displayName": "VUV", "required": false}, {"value": "XAF", "type": "String", "displayName": "XAF", "required": false}, {"value": "XCD", "type": "String", "displayName": "XCD", "required": false}, {"value": "XOF", "type": "String", "displayName": "XOF", "required": false}, {"value": "ZAR", "type": "String", "displayName": "ZAR", "required": false}, {"value": "ZMK", "type": "String", "displayName": "ZMK", "required": false}]}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "Balance", "details": "The opening balance, in the account currency"}]}}, "institution": {"type": "String", "displayName": "Institution", "description": "The institution of the bank account", "required": false}}} - KashFlow: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Account Name", "description": "Name of the bank account as it appears in Kashflow.", "required": true}, "balance": {"type": "Number", "displayName": "Balance", "description": "The opening balance, in the account currency.", "required": false}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account.", "required": true}}} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "Max length of 7 characters."}], "information": []}}, "accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [{"field": "AccountName", "details": "Max length of 31 characters."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false, "validation": {"warnings": [{"field": "Currency", "details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'"}, {"field": "Currency", "details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company"}, {"field": "Currency", "details": "Can only be set if the QuickBooks Desktop company has Multicurrency enabled."}], "information": [{"field": "Currency", "details": "If not set, will default to the base currency of the QuickBooks Desktop company"}]}}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": false}}} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Account Name", "description": "Name of account as it appears in the chart of accounts or general ledger.", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "User-defined account number to help the user in identifying the account within the chart-of-accounts and in deciding what should be posted to the account.", "required": true}, "currency": {"type": "String", "displayName": "Currency", "description": "Currency of the bank account.", "required": true}}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [], "information": [{"field": "AccountName", "details": "Must be provided."}, {"field": "AccountName", "details": "Should not be longer than 50 characters."}]}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true, "validation": {"warnings": [], "information": [{"field": "Currency", "details": "Must be provided."}, {"field": "Currency", "details": "Must match the company's base currency."}]}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "SortCode", "details": "Should be a 6 digit number."}]}}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "AccountNumber", "details": "Should not be longer than 25 characters."}]}}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false, "validation": {"warnings": [], "information": [{"field": "IBan", "details": "Should be in the international bank account number format."}]}}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Should be a number between 1 and 99999999."}]}}}} - Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountType": {"type": "String", "displayName": "Account Type", "description": "The type of account", "required": true}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": true}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": true}, "availableBalance": {"type": "Number", "displayName": "Available Balance", "description": "The available balance of the bank account", "required": true}, "overdraftLimit": {"type": "Number", "displayName": "Overdraft Limit", "description": "The pre-arranged overdraft limit of the account", "required": true}, "institution": {"type": "String", "displayName": "Institution", "description": "The institution of the bank account", "required": true}, "metadata": {"type": "Object", "displayName": "Metadata", "description": "Miscellaneous data about the item", "required": true, "properties": {"isDeleted": {"type": "Boolean", "displayName": "IsDeleted", "description": "A boolean to indicate whether the object has been deleted", "required": true}}}}} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bank-account: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"currency": "GBP", "status": "Active"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-bank-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"currency": "GBP", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "bbf55378-5e09-4654-9ce4-ff3208e30267", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 16290} - "400": - application/json: {} - "500": - application/json: {} - create-batch-source-account: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: [{"id": "", "currency": "GBP", "modifiedDate": "2022-10-23T00:00:00Z"}] - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-batch-source-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: [{"id": "", "currency": "GBP", "modifiedDate": "2022-10-23T00:00:00Z"}] - responses: - "201": - application/json: [{"sourceAccountId": "12345", "result": {"account": {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"}}}] - "207": - application/json: [{"sourceAccountId": "12345", "result": {"statusCode": "409", "error": "A bank account already exists with the same Id"}}] - "400": - application/json: {} - "500": - application/json: {} - create-source-account: - Version 2: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"id": "", "currency": "GBP", "modifiedDate": "2022-10-23T00:00:00Z"} - responses: - "200": - application/json: {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"} - "400": - application/json: {} - "500": - application/json: {} - Version 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z"} - responses: - "200": - application/json: {"id": "acc-001", "accountName": "account-081", "accountType": "checking", "accountNumber": "12345670", "routingInfo": {"bankCode": "21001088", "type": "bankcode"}, "currency": "GBP", "balance": 99.99, "accountInfo": {"description": "account description 1", "nickname": "account 123", "accountOpenDate": "2023-05-06", "availableBalance": 10}, "modifiedDate": "2024-08-02T00:00:00.000Z", "status": "pending", "feedStartDate": "2024-05-01"} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"id": "", "currency": "GBP", "modifiedDate": "2022-10-23T00:00:00Z"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-source-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"id": "", "accountName": "", "accountType": "prepaidCard", "accountNumber": "", "currency": "GBP", "balance": 9024.27, "modifiedDate": "2022-10-23T00:00:00Z", "accountInfo": {"accountOpenDate": "2022-10-23"}} - responses: - "200": - application/json: {"id": "acc-001", "accountName": "account-081", "accountType": "checking", "accountNumber": "12345670", "routingInfo": {"bankCode": "21001088", "type": "bankcode"}, "currency": "GBP", "balance": 99.99, "accountInfo": {"description": "account description 1", "nickname": "account 123", "accountOpenDate": "2023-05-06", "availableBalance": 10}, "modifiedDate": "2024-08-02T00:00:00.000Z", "status": "pending", "feedStartDate": "2024-05-01"} - "400": - application/json: {} - "500": - application/json: {} - list-source-accounts: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-source-accounts: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: [{"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"}, {"id": "acc-003", "accountName": "account-095", "accountType": "Credit", "accountNumber": "12345671", "sortCode": "123456", "currency": "USD", "balance": 0, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"}] - "401": - application/json: {} - "500": - application/json: {} - update-source-account: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-source-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - requestBody: - application/json: {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"} - responses: - "200": - application/json: {"id": "acc-002", "accountName": "account-081", "accountType": "Credit", "accountNumber": "12345670", "sortCode": "123456", "currency": "GBP", "balance": 99.99, "modifiedDate": "2023-01-09T14:14:14.1057478Z", "status": "pending"} - "400": - application/json: {} - "500": - application/json: {} - delete-source-account: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-source-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {} - "500": - application/json: {} - generate-credentials: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: "x-file: example.file" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-generate-credentials: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: "x-file: example.file" - responses: - "200": - application/json: {"username": "S0MW-TR0P-7DS0", "password": "cO0ajh0uGyTN0Pwh"} - "401": - application/json: {} - "500": - application/json: {} - delete-bank-feed-credentials: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-bank-feed-credentials: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {} - "500": - application/json: {} - get-bank-account-mapping: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: [{"sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": 99.99, "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456", "accountNumber": "789"}, {"id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866", "accountNumber": "99887766"}, {"id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456", "accountNumber": "123456789"}]}] - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bank-account-mapping: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"sourceAccountId": "acc-002", "targetAccountId": "account-081"} - responses: - "200": - application/json: {"sourceAccountId": "acc-002", "targetAccountId": "account-081", "status": "Failed", "error": "A feed connection already exists to this account"} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"sourceAccountId": "acc-002", "targetAccountId": "account-081"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-bank-account-mapping: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"sourceAccountId": "acc-002", "targetAccountId": "account-081"} - responses: - "200": - application/json: {"sourceAccountId": "acc-002", "targetAccountId": "account-081", "status": "Failed", "error": "A feed connection already exists to this account"} - "400": - application/json: {} - "500": - application/json: {} - get-company-information: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-company-information: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {} - "400": - application/json: {} - "500": - application/json: {} - create-bank-transactions: - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"id": "716422529", "date": "2023-08-22T10:21:00", "description": "Repayment of Credit Card", "counterparty": "Bank of Example", "reference": "Ref-12345", "reconciled": true, "amount": 100, "balance": 100, "transactionType": "Credit"}, {"id": "716422530", "date": "2023-08-22T10:22:00", "description": "Amazon Purchase", "counterparty": "Amazon", "reference": "Ref-12346", "reconciled": false, "amount": -100, "balance": 0, "transactionType": "Debit"}, {"id": "716422531", "date": "2023-08-22T10:23:00", "description": "Office Supplies", "counterparty": "Office Mart", "reference": "Ref-12347", "reconciled": false, "amount": -60, "balance": -60, "transactionType": "Debit"}]} - responses: - "200": - application/json: {"data": {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "19a8e230-a2ea-404d-9207-3c44a3a3202d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 362560} - "400": - application/json: {} - "500": - application/json: {} - QuickBooks Online Bank Feeds: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"id": "716422529", "date": "2023-08-22T10:21:00", "description": "Repayment of Credit Card", "amount": 100, "balance": 100, "transactionType": "Credit"}, {"id": "716422530", "date": "2023-08-22T10:22:00", "description": "Amazon Purchase", "amount": -100, "balance": 0, "transactionType": "Debit"}, {"id": "716422531", "date": "2023-08-22T10:23:00", "description": "Office Supplies", "amount": -60, "balance": -60, "transactionType": "Debit"}]} - responses: - "200": - application/json: {"data": {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "19a8e230-a2ea-404d-9207-3c44a3a3202d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 362560} - "400": - application/json: {} - "500": - application/json: {} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"id": "716422529", "date": "2023-08-22T10:21:00", "description": "Repayment of Credit Card", "amount": 100, "transactionType": "Credit"}, {"id": "716422530", "date": "2023-08-22T10:22:00", "description": "Amazon Purchase", "amount": -100, "transactionType": "Debit"}, {"id": "716422531", "date": "2023-08-22T10:23:00", "description": "Office Supplies", "amount": -60, "transactionType": "Debit"}]} - responses: - "200": - application/json: {"data": {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "19a8e230-a2ea-404d-9207-3c44a3a3202d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 362560} - "400": - application/json: {} - "500": - application/json: {} - Sage: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"id": "716422529", "date": "2023-08-22T10:21:00", "description": "Repayment of Credit Card", "counterparty": "Bank of Example", "reference": "Ref-12345", "amount": 100, "balance": 100, "transactionType": "Credit"}, {"id": "716422530", "date": "2023-08-22T10:22:00", "description": "Amazon Purchase", "counterparty": "Amazon", "reference": "Ref-12346", "amount": -100, "balance": 0, "transactionType": "Debit"}, {"id": "716422531", "date": "2023-08-22T10:23:00", "description": "Office Supplies", "counterparty": "Office Mart", "reference": "Ref-12347", "amount": -60, "balance": -60, "transactionType": "Debit"}]} - responses: - "200": - application/json: {"data": {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "19a8e230-a2ea-404d-9207-3c44a3a3202d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 362560} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-bank-transactions: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []} - responses: - "200": - application/json: {"data": {"accountId": "13d946f0-c5d5-42bc-b092-97ece17923ab", "transactions": []}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "19a8e230-a2ea-404d-9207-3c44a3a3202d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 362560} - "400": - application/json: {} - "500": - application/json: {} - get-create-bank-transactions-model: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-create-bank-transactions-model: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"type": "Array", "displayName": "Brenden23", "required": false} - "401": - application/json: {} - "500": - application/json: {} - get-create-operation: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "23a26d56-6e3d-4414-865c-4fa7ebbb43e3" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-create-operation: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "197f974c-e0cb-4960-8815-8e12361fefbe" - responses: - "200": - application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "9f05beba-f0a7-475d-99a4-4221b3f2c954", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 52725} - "401": - application/json: {} - "500": - application/json: {} - list-create-operations: - speakeasy-default-list-create-operations: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-managed-bank-feed-sync: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - syncId: "823d304f-a204-4760-9b5d-b8a89bf29bed" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-managed-bank-feed-sync: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - syncId: "b89ec542-23d5-468f-b86b-93cb50c6249f" - responses: - "200": - application/json: {"syncId": "a1280f30-6917-4efb-8222-49e19f7e700e", "clientId": "f31d8807-69d3-4eb2-a98d-03f006e33d7f", "companyId": "50157221-31f1-4500-ad52-64c31630c43f", "companyName": "Murphy, Champlin and Schuster", "dataConnectionId": "eb796e5e-a5d4-4793-8158-fdec931e731b", "sourceAccountId": "", "periodStartUtc": "2026-05-07T16:25:47.798Z", "periodEndUtc": "2024-06-07T08:12:35.901Z", "executionStartUtc": "2025-05-10T13:11:00.042Z", "status": "SuccessDataPushed"} - "401": - application/json: {} - "500": - application/json: {} - get-latest-managed-bank-feed-sync: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-latest-managed-bank-feed-sync: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - responses: - "200": - application/json: {"syncId": "de0dc6cc-ed99-40d6-bbcc-46bb4d95126e", "clientId": "5c51f9bf-6e8d-4d07-ad21-384942c510fc", "companyId": "ec17e9c0-a2a7-4866-8bed-c63378e5e052", "companyName": "Russel - Auer", "dataConnectionId": "df875c1b-ba32-4d04-ae75-b6da6e84dcc5", "sourceAccountId": "", "periodStartUtc": "2025-11-10T07:19:56.550Z", "periodEndUtc": "2024-04-30T07:43:47.855Z", "executionStartUtc": "2026-06-10T13:55:09.403Z", "status": "SuccessDataPushed"} - "401": - application/json: {} - "500": - application/json: {} - run-managed-bank-feed-ad-hoc-sync: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-run-managed-bank-feed-ad-hoc-sync: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - sourceAccountId: "" - responses: - "201": - application/json: {"syncId": "ed4e184d-3807-47c5-8310-ac4104fb0d08"} - "400": - application/json: {} - "500": - application/json: {} - generate-otp: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-generate-otp: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"otp": "GT40U4", "expiry": "2026-04-08T10:30:00Z"} - "400": - application/json: {} - "500": - application/json: {} -examplesVersion: 1.0.2 -generatedTests: {} -releaseNotes: | - ## Typescript SDK Changes: - * `codatbankfeeds.companies.create()`: `response.dataConnections[].integrationKey` **Changed** - * `codatbankfeeds.companies.list()`: `response.results[].dataConnections[].integrationKey` **Changed** - * `codatbankfeeds.companies.get()`: `response.dataConnections[].integrationKey` **Changed** - * `codatbankfeeds.companies.replace()`: `response.dataConnections[].integrationKey` **Changed** - * `codatbankfeeds.companies.update()`: `response.dataConnections[].integrationKey` **Changed** - * `codatbankfeeds.connections.list()`: `response.results[].integrationKey` **Changed** - * `codatbankfeeds.connections.create()`: `response.integrationKey` **Changed** - * `codatbankfeeds.connections.get()`: `response.integrationKey` **Changed** - * `codatbankfeeds.connections.unlink()`: `response.integrationKey` **Changed** -generatedFiles: - - .eslintrc.cjs - - .gitattributes - - .npmignore - - CONTRIBUTING.md - - FUNCTIONS.md - - RUNTIMES.md - - USAGE.md - - docs/lib/utils/retryconfig.md - - docs/sdk/models/errors/errormessage.md - - docs/sdk/models/operations/createbankaccountmappingrequest.md - - docs/sdk/models/operations/createbankaccountrequest.md - - docs/sdk/models/operations/createbanktransactionsrequest.md - - docs/sdk/models/operations/createbatchsourceaccountrequest.md - - docs/sdk/models/operations/createbatchsourceaccountrequestbody.md - - docs/sdk/models/operations/createbatchsourceaccountresponse.md - - docs/sdk/models/operations/createbatchsourceaccountresponsebody.md - - docs/sdk/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md - - docs/sdk/models/operations/createconnectionrequest.md - - docs/sdk/models/operations/createconnectionrequestbody.md - - docs/sdk/models/operations/createsourceaccountrequest.md - - docs/sdk/models/operations/createsourceaccountrequestbody.md - - docs/sdk/models/operations/createsourceaccountresponsebody.md - - docs/sdk/models/operations/deletebankfeedcredentialsrequest.md - - docs/sdk/models/operations/deletecompanyrequest.md - - docs/sdk/models/operations/deleteconnectionrequest.md - - docs/sdk/models/operations/deletesourceaccountrequest.md - - docs/sdk/models/operations/generatecredentialsrequest.md - - docs/sdk/models/operations/getbankaccountmappingrequest.md - - docs/sdk/models/operations/getcompanyaccesstokenrequest.md - - docs/sdk/models/operations/getcompanyinformationrequest.md - - docs/sdk/models/operations/getcompanyrequest.md - - docs/sdk/models/operations/getconfigurationrequest.md - - docs/sdk/models/operations/getconnectionrequest.md - - docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md - - docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md - - docs/sdk/models/operations/getcreateoperationrequest.md - - docs/sdk/models/operations/getlastsuccessfulrequest.md - - docs/sdk/models/operations/listbankaccountsrequest.md - - docs/sdk/models/operations/listcompaniesrequest.md - - docs/sdk/models/operations/listconnectionsrequest.md - - docs/sdk/models/operations/listcreateoperationsrequest.md - - docs/sdk/models/operations/listsourceaccountsrequest.md - - docs/sdk/models/operations/listsourceaccountsresponsebody.md - - docs/sdk/models/operations/one.md - - docs/sdk/models/operations/responsebody1.md - - docs/sdk/models/operations/setconfigurationrequest.md - - docs/sdk/models/operations/unlinkconnectionrequest.md - - docs/sdk/models/operations/unlinkconnectionupdateconnection.md - - docs/sdk/models/operations/updatecompanyrequest.md - - docs/sdk/models/operations/updatesourceaccountrequest.md - - docs/sdk/models/shared/accountinfo.md - - docs/sdk/models/shared/accountingbankaccount.md - - docs/sdk/models/shared/accounttype.md - - docs/sdk/models/shared/bankaccountcreateresponse.md - - docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md - - docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md - - docs/sdk/models/shared/bankaccountcreateresponsemetadata.md - - docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md - - docs/sdk/models/shared/bankaccountcredentials.md - - docs/sdk/models/shared/bankaccountoption.md - - docs/sdk/models/shared/bankaccountprototype.md - - docs/sdk/models/shared/bankaccounts.md - - docs/sdk/models/shared/bankaccountsbankaccounttype.md - - docs/sdk/models/shared/bankaccountstatus.md - - docs/sdk/models/shared/bankaccounttype.md - - docs/sdk/models/shared/bankfeedaccountmapping.md - - docs/sdk/models/shared/bankfeedaccountmappingresponse.md - - docs/sdk/models/shared/bankfeedmapping.md - - docs/sdk/models/shared/banktransactions.md - - docs/sdk/models/shared/banktransactiontype.md - - docs/sdk/models/shared/clientratelimitreachedwebhook.md - - docs/sdk/models/shared/clientratelimitreachedwebhookdata.md - - docs/sdk/models/shared/clientratelimitresetwebhook.md - - docs/sdk/models/shared/clientratelimitresetwebhookdata.md - - docs/sdk/models/shared/clientratelimitwebhook.md - - docs/sdk/models/shared/clientratelimitwebhookpayload.md - - docs/sdk/models/shared/companies.md - - docs/sdk/models/shared/company.md - - docs/sdk/models/shared/companyaccesstoken.md - - docs/sdk/models/shared/companyinformation.md - - docs/sdk/models/shared/companyreference.md - - docs/sdk/models/shared/companyreferencelinks.md - - docs/sdk/models/shared/companyrequestbody.md - - docs/sdk/models/shared/companysyncstatus.md - - docs/sdk/models/shared/configuration.md - - docs/sdk/models/shared/configurationcontactref.md - - docs/sdk/models/shared/configurationcustomer.md - - docs/sdk/models/shared/configurationschedule.md - - docs/sdk/models/shared/configurationsupplier.md - - docs/sdk/models/shared/connection.md - - docs/sdk/models/shared/connections.md - - docs/sdk/models/shared/createbanktransactions.md - - docs/sdk/models/shared/createbanktransactionsresponse.md - - docs/sdk/models/shared/dataconnectionerror.md - - docs/sdk/models/shared/dataconnectionstatus.md - - docs/sdk/models/shared/datatype.md - - docs/sdk/models/shared/errorstatus.md - - docs/sdk/models/shared/errorvalidation.md - - docs/sdk/models/shared/errorvalidationitem.md - - docs/sdk/models/shared/halref.md - - docs/sdk/models/shared/links.md - - docs/sdk/models/shared/metadata.md - - docs/sdk/models/shared/pushchangetype.md - - docs/sdk/models/shared/pushfieldvalidation.md - - docs/sdk/models/shared/pushoperation.md - - docs/sdk/models/shared/pushoperationchange.md - - docs/sdk/models/shared/pushoperationref.md - - docs/sdk/models/shared/pushoperations.md - - docs/sdk/models/shared/pushoperationstatus.md - - docs/sdk/models/shared/pushoption.md - - docs/sdk/models/shared/pushoptionchoice.md - - docs/sdk/models/shared/pushoptionproperty.md - - docs/sdk/models/shared/pushoptiontype.md - - docs/sdk/models/shared/pushvalidationinfo.md - - docs/sdk/models/shared/result.md - - docs/sdk/models/shared/routinginfo.md - - docs/sdk/models/shared/security.md - - docs/sdk/models/shared/sourceaccount.md - - docs/sdk/models/shared/sourceaccountbatchcreateresponse.md - - docs/sdk/models/shared/sourceaccountbatcherrorresponse.md - - docs/sdk/models/shared/sourceaccountprototype.md - - docs/sdk/models/shared/sourceaccountstatus.md - - docs/sdk/models/shared/sourceaccountv2.md - - docs/sdk/models/shared/sourceaccountv2accounttype.md - - docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md - - docs/sdk/models/shared/sourceaccountv2prototype.md - - docs/sdk/models/shared/sourceaccountwebhook.md - - docs/sdk/models/shared/sourceaccountwebhookpayload.md - - docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md - - docs/sdk/models/shared/sourcetype.md - - docs/sdk/models/shared/status.md - - docs/sdk/models/shared/supplementaldata.md - - docs/sdk/models/shared/syncasbankfeeds.md - - docs/sdk/models/shared/syncasexpenses.md - - docs/sdk/models/shared/syncconfiguration.md - - docs/sdk/models/shared/targetaccountoption.md - - docs/sdk/models/shared/type.md - - docs/sdk/models/shared/validation.md - - docs/sdk/models/shared/validationitem.md - - docs/sdks/accountmapping/README.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/codatbankfeeds/README.md - - docs/sdks/companies/README.md - - docs/sdks/companyinformation/README.md - - docs/sdks/configuration/README.md - - docs/sdks/connections/README.md - - docs/sdks/sourceaccounts/README.md - - docs/sdks/sync/README.md - - docs/sdks/transactions/README.md - - jsr.json - - package.json - - src/core.ts - - src/funcs/accountMappingCreate.ts - - src/funcs/accountMappingGet.ts - - src/funcs/bankAccountsCreate.ts - - src/funcs/bankAccountsGetCreateModel.ts - - src/funcs/bankAccountsList.ts - - src/funcs/companiesCreate.ts - - src/funcs/companiesDelete.ts - - src/funcs/companiesGet.ts - - src/funcs/companiesGetAccessToken.ts - - src/funcs/companiesList.ts - - src/funcs/companiesUpdate.ts - - src/funcs/companyInformationGet.ts - - src/funcs/configurationGet.ts - - src/funcs/configurationSet.ts - - src/funcs/connectionsCreate.ts - - src/funcs/connectionsDelete.ts - - src/funcs/connectionsGet.ts - - src/funcs/connectionsList.ts - - src/funcs/connectionsUnlink.ts - - src/funcs/sourceAccountsCreate.ts - - src/funcs/sourceAccountsCreateBatch.ts - - src/funcs/sourceAccountsDelete.ts - - src/funcs/sourceAccountsDeleteCredentials.ts - - src/funcs/sourceAccountsGenerateCredentials.ts - - src/funcs/sourceAccountsList.ts - - src/funcs/sourceAccountsUpdate.ts - - src/funcs/syncGetLastSuccessfulSync.ts - - src/funcs/transactionsCreate.ts - - src/funcs/transactionsGetCreateModel.ts - - src/funcs/transactionsGetCreateOperation.ts - - src/funcs/transactionsListCreateOperations.ts - - src/hooks/hooks.ts - - src/hooks/index.ts - - src/hooks/types.ts - - src/index.ts - - src/lib/base64.ts - - src/lib/config.ts - - src/lib/dlv.ts - - src/lib/encodings.ts - - src/lib/files.ts - - src/lib/http.ts - - src/lib/is-plain-object.ts - - src/lib/logger.ts - - src/lib/matchers.ts - - src/lib/primitives.ts - - src/lib/retries.ts - - src/lib/schemas.ts - - src/lib/sdks.ts - - src/lib/security.ts - - src/lib/url.ts - - src/sdk/accountmapping.ts - - src/sdk/bankaccounts.ts - - src/sdk/companies.ts - - src/sdk/companyinformation.ts - - src/sdk/configuration.ts - - src/sdk/connections.ts - - src/sdk/index.ts - - src/sdk/models/errors/errormessage.ts - - src/sdk/models/errors/httpclienterrors.ts - - src/sdk/models/errors/index.ts - - src/sdk/models/errors/sdkerror.ts - - src/sdk/models/errors/sdkvalidationerror.ts - - src/sdk/models/operations/createbankaccount.ts - - src/sdk/models/operations/createbankaccountmapping.ts - - src/sdk/models/operations/createbanktransactions.ts - - src/sdk/models/operations/createbatchsourceaccount.ts - - src/sdk/models/operations/createconnection.ts - - src/sdk/models/operations/createsourceaccount.ts - - src/sdk/models/operations/deletebankfeedcredentials.ts - - src/sdk/models/operations/deletecompany.ts - - src/sdk/models/operations/deleteconnection.ts - - src/sdk/models/operations/deletesourceaccount.ts - - src/sdk/models/operations/generatecredentials.ts - - src/sdk/models/operations/getbankaccountmapping.ts - - src/sdk/models/operations/getcompany.ts - - src/sdk/models/operations/getcompanyaccesstoken.ts - - src/sdk/models/operations/getcompanyinformation.ts - - src/sdk/models/operations/getconfiguration.ts - - src/sdk/models/operations/getconnection.ts - - src/sdk/models/operations/getcreatebankaccountsmodel.ts - - src/sdk/models/operations/getcreatebanktransactionsmodel.ts - - src/sdk/models/operations/getcreateoperation.ts - - src/sdk/models/operations/getlastsuccessful.ts - - src/sdk/models/operations/index.ts - - src/sdk/models/operations/listbankaccounts.ts - - src/sdk/models/operations/listcompanies.ts - - src/sdk/models/operations/listconnections.ts - - src/sdk/models/operations/listcreateoperations.ts - - src/sdk/models/operations/listsourceaccounts.ts - - src/sdk/models/operations/setconfiguration.ts - - src/sdk/models/operations/unlinkconnection.ts - - src/sdk/models/operations/updatecompany.ts - - src/sdk/models/operations/updatesourceaccount.ts - - src/sdk/models/shared/accountinfo.ts - - src/sdk/models/shared/accounttype.ts - - src/sdk/models/shared/bankaccountcreateresponse.ts - - src/sdk/models/shared/bankaccountcredentials.ts - - src/sdk/models/shared/bankaccountoption.ts - - src/sdk/models/shared/bankaccountprototype.ts - - src/sdk/models/shared/bankaccounts.ts - - src/sdk/models/shared/bankaccountstatus.ts - - src/sdk/models/shared/bankfeedaccountmapping.ts - - src/sdk/models/shared/bankfeedaccountmappingresponse.ts - - src/sdk/models/shared/bankfeedmapping.ts - - src/sdk/models/shared/banktransactions.ts - - src/sdk/models/shared/clientratelimitreachedwebhook.ts - - src/sdk/models/shared/clientratelimitreachedwebhookdata.ts - - src/sdk/models/shared/clientratelimitresetwebhook.ts - - src/sdk/models/shared/clientratelimitresetwebhookdata.ts - - src/sdk/models/shared/clientratelimitwebhook.ts - - src/sdk/models/shared/clientratelimitwebhookpayload.ts - - src/sdk/models/shared/companies.ts - - src/sdk/models/shared/company.ts - - src/sdk/models/shared/companyaccesstoken.ts - - src/sdk/models/shared/companyinformation.ts - - src/sdk/models/shared/companyreference.ts - - src/sdk/models/shared/companyrequestbody.ts - - src/sdk/models/shared/companysyncstatus.ts - - src/sdk/models/shared/configuration.ts - - src/sdk/models/shared/configurationcontactref.ts - - src/sdk/models/shared/configurationcustomer.ts - - src/sdk/models/shared/configurationschedule.ts - - src/sdk/models/shared/configurationsupplier.ts - - src/sdk/models/shared/connection.ts - - src/sdk/models/shared/connections.ts - - src/sdk/models/shared/createbanktransactions.ts - - src/sdk/models/shared/createbanktransactionsresponse.ts - - src/sdk/models/shared/dataconnectionerror.ts - - src/sdk/models/shared/dataconnectionstatus.ts - - src/sdk/models/shared/datatype.ts - - src/sdk/models/shared/errorvalidation.ts - - src/sdk/models/shared/errorvalidationitem.ts - - src/sdk/models/shared/halref.ts - - src/sdk/models/shared/index.ts - - src/sdk/models/shared/links.ts - - src/sdk/models/shared/pushchangetype.ts - - src/sdk/models/shared/pushfieldvalidation.ts - - src/sdk/models/shared/pushoperation.ts - - src/sdk/models/shared/pushoperationchange.ts - - src/sdk/models/shared/pushoperationref.ts - - src/sdk/models/shared/pushoperations.ts - - src/sdk/models/shared/pushoperationstatus.ts - - src/sdk/models/shared/pushoption.ts - - src/sdk/models/shared/pushoptionchoice.ts - - src/sdk/models/shared/pushoptionproperty.ts - - src/sdk/models/shared/pushoptiontype.ts - - src/sdk/models/shared/pushvalidationinfo.ts - - src/sdk/models/shared/routinginfo.ts - - src/sdk/models/shared/security.ts - - src/sdk/models/shared/sourceaccount.ts - - src/sdk/models/shared/sourceaccountbatchcreateresponse.ts - - src/sdk/models/shared/sourceaccountbatcherrorresponse.ts - - src/sdk/models/shared/sourceaccountprototype.ts - - src/sdk/models/shared/sourceaccountv2.ts - - src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts - - src/sdk/models/shared/sourceaccountv2prototype.ts - - src/sdk/models/shared/sourceaccountwebhook.ts - - src/sdk/models/shared/sourceaccountwebhookpayload.ts - - src/sdk/models/shared/syncasbankfeeds.ts - - src/sdk/models/shared/syncasexpenses.ts - - src/sdk/models/shared/syncconfiguration.ts - - src/sdk/models/shared/targetaccountoption.ts - - src/sdk/models/shared/validation.ts - - src/sdk/models/shared/validationitem.ts - - src/sdk/sdk.ts - - src/sdk/sourceaccounts.ts - - src/sdk/sync.ts - - src/sdk/transactions.ts - - src/sdk/types/blobs.ts - - src/sdk/types/constdatetime.ts - - src/sdk/types/decimal.ts - - src/sdk/types/enums.ts - - src/sdk/types/fp.ts - - src/sdk/types/index.ts - - src/sdk/types/operations.ts - - src/sdk/types/rfcdate.ts - - src/sdk/types/streams.ts - - src/sdk/types/webhooks.ts - - tsconfig.json diff --git a/bank-feeds/.speakeasy/gen.yaml b/bank-feeds/.speakeasy/gen.yaml deleted file mode 100644 index 28703b371..000000000 --- a/bank-feeds/.speakeasy/gen.yaml +++ /dev/null @@ -1,91 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: CodatBankFeeds - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - sdkInitStyle: constructor - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false - sharedNestedComponentsJan2026: false - nameOverrideFeb2026: false - auth: - oAuth2ClientCredentialsEnabled: false - oAuth2PasswordEnabled: false - hoistGlobalSecurity: true - schemas: - allOfMergeStrategy: shallowMerge - requestBodyFieldName: "" - versioningStrategy: automatic - persistentEdits: {} - tests: - generateTests: true - generateNewTests: false - skipResponseBodyAssertions: false - telemetryEnabled: true -typescript: - version: 8.2.1 - acceptHeaderEnum: true - additionalDependencies: - dependencies: {} - devDependencies: {} - peerDependencies: {} - additionalPackageJSON: {} - additionalScripts: {} - alwaysIncludeInboundAndOutbound: false - author: Codat - baseErrorName: CodatBankFeedsError - clientServerStatusCodesAsErrors: true - constFieldsAlwaysOptional: false - defaultErrorName: SDKError - description: Set up bank feeds from accounts in your application to supported accounting platforms. - enableCustomCodeRegions: false - enableMCPServer: false - enableReactQuery: false - enumFormat: union - exportZodModelNamespace: false - fixEnumNameSanitization: false - flatAdditionalProperties: false - flattenGlobalSecurity: true - flatteningOrder: body-first - formStringArrayEncodeMode: encoded-string - forwardCompatibleEnumsByDefault: false - forwardCompatibleUnionsByDefault: "false" - generateExamples: true - imports: - option: openapi - paths: - callbacks: sdk/models/callbacks - errors: sdk/models/errors - operations: sdk/models/operations - shared: sdk/models/shared - webhooks: sdk/models/webhooks - inferUnionDiscriminators: true - inputModelSuffix: input - jsonpath: legacy - laxMode: strict - legacyFileNaming: true - maxMethodParams: 0 - methodArguments: infer-optional-args - modelPropertyCasing: camel - moduleFormat: commonjs - multipartArrayFormat: legacy - outputModelSuffix: output - packageName: '@codat/bank-feeds' - preApplyUnionDiscriminators: true - preserveModelFieldNames: false - responseFormat: flat - sseFlatResponse: false - templateVersion: v2 - unionStrategy: left-to-right - usageSDKInitImports: [] - useIndexModules: true - useOxlint: false - useTsgo: false - zodVersion: v3 diff --git a/bank-feeds/RELEASES.md b/bank-feeds/RELEASES.md index afde8fea2..45e553930 100644 --- a/bank-feeds/RELEASES.md +++ b/bank-feeds/RELEASES.md @@ -796,4 +796,14 @@ Based on: ### Generated - [typescript v8.2.1] bank-feeds ### Releases -- [NPM v8.2.1] https://www.npmjs.com/package/@codat/bank-feeds/v/8.2.1 - bank-feeds \ No newline at end of file +- [NPM v8.2.1] https://www.npmjs.com/package/@codat/bank-feeds/v/8.2.1 - bank-feeds + +## 2026-08-05 19:30:12 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Bank-Feeds.yaml +- codat sdk-codegen 1b5626f25df09d713121c5e8a048d9b44b3b7178 https://github.com/codat-spikes/sdk-codegen +### Generated +- [typescript v8.2.2] bank-feeds +### Releases +- [NPM v8.2.2] https://www.npmjs.com/package/@codat/bank-feeds/v/8.2.2 - bank-feeds diff --git a/bank-feeds/USAGE.md b/bank-feeds/USAGE.md index 33eccf510..0d1a88cde 100644 --- a/bank-feeds/USAGE.md +++ b/bank-feeds/USAGE.md @@ -1,20 +1,20 @@ - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.create({ - name: "Technicalium", - }); - - console.log(result); -} - -run(); - -``` + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.accountMapping.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` \ No newline at end of file diff --git a/bank-feeds/docs/lib/utils/retryconfig.md b/bank-feeds/docs/lib/utils/retryconfig.md index 08f95f455..69da01b9f 100644 --- a/bank-feeds/docs/lib/utils/retryconfig.md +++ b/bank-feeds/docs/lib/utils/retryconfig.md @@ -1,24 +1,24 @@ -# RetryConfig - -Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. - -## Fields - -| Name | Type | Description | Example | -| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | -| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | -| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | -| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | - -## BackoffStrategy - -The backoff strategy allows retrying a request with an exponential backoff between each retry. - -### Fields - -| Name | Type | Description | Example | -| ------------------ | ------------ | ----------------------------------------- | -------- | -| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | -| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | -| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | | `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/errors/errormessage.md b/bank-feeds/docs/sdk/models/errors/errormessage.md index 077dd904c..f122b3ac3 100644 --- a/bank-feeds/docs/sdk/models/errors/errormessage.md +++ b/bank-feeds/docs/sdk/models/errors/errormessage.md @@ -1,23 +1,21 @@ -# ErrorMessage - -The request made is not valid. - -## Example Usage - -```typescript -import { ErrorMessage } from "@codat/bank-feeds/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | -| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | -| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | -| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +# ErrorMessage + +## Example Usage + +```typescript +import { ErrorMessage } from "@codat/bank-feeds/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | +| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | +| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | | `detailedErrorCode` | *number* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbankaccountmappingrequest.md b/bank-feeds/docs/sdk/models/operations/createbankaccountmappingrequest.md index ef576a25e..5a592663d 100644 --- a/bank-feeds/docs/sdk/models/operations/createbankaccountmappingrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createbankaccountmappingrequest.md @@ -1,20 +1,20 @@ -# CreateBankAccountMappingRequest - -## Example Usage - -```typescript -import { CreateBankAccountMappingRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateBankAccountMappingRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# CreateBankAccountMappingRequest + +## Example Usage + +```typescript +import { CreateBankAccountMappingRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateBankAccountMappingRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `bankFeedAccountMapping` | [shared.BankFeedAccountMapping](../../../sdk/models/shared/bankfeedaccountmapping.md) | :heavy_minus_sign: | N/A | {
"sourceAccountId": "acc-002",
"targetAccountId": "account-081"
} | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbankaccountrequest.md b/bank-feeds/docs/sdk/models/operations/createbankaccountrequest.md index 6aa491e5e..36fd00170 100644 --- a/bank-feeds/docs/sdk/models/operations/createbankaccountrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createbankaccountrequest.md @@ -1,21 +1,21 @@ -# CreateBankAccountRequest - -## Example Usage - -```typescript -import { CreateBankAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateBankAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +# CreateBankAccountRequest + +## Example Usage + +```typescript +import { CreateBankAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateBankAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | | `bankAccountPrototype` | [shared.BankAccountPrototype](../../../sdk/models/shared/bankaccountprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbanktransactionsrequest.md b/bank-feeds/docs/sdk/models/operations/createbanktransactionsrequest.md index 2692adc1a..52212388c 100644 --- a/bank-feeds/docs/sdk/models/operations/createbanktransactionsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createbanktransactionsrequest.md @@ -1,24 +1,24 @@ -# CreateBankTransactionsRequest - -## Example Usage - -```typescript -import { CreateBankTransactionsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateBankTransactionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +# CreateBankTransactionsRequest + +## Example Usage + +```typescript +import { CreateBankTransactionsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateBankTransactionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | | `createBankTransactions` | [shared.CreateBankTransactions](../../../sdk/models/shared/createbanktransactions.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequest.md b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequest.md index 8aac7450b..f003e66cb 100644 --- a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequest.md @@ -1,20 +1,20 @@ -# CreateBatchSourceAccountRequest - -## Example Usage - -```typescript -import { CreateBatchSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateBatchSourceAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestBody` | *operations.CreateBatchSourceAccountRequestBody* | :heavy_minus_sign: | N/A | | \ No newline at end of file +# CreateBatchSourceAccountRequest + +## Example Usage + +```typescript +import { CreateBatchSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateBatchSourceAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestBody` | *CreateBatchSourceAccountRequestBody* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequestbody.md b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequestbody.md index 8ce10aa40..d92050bf5 100644 --- a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequestbody.md +++ b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountrequestbody.md @@ -1,23 +1,16 @@ -# CreateBatchSourceAccountRequestBody - - -## Supported Types - -### `shared.SourceAccountV2Prototype[]` - -```typescript -const value: shared.SourceAccountV2Prototype[] = []; -``` - -### `shared.SourceAccountPrototype[]` - -```typescript -const value: shared.SourceAccountPrototype[] = [ - { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, -]; -``` - +# CreateBatchSourceAccountRequestBody + + +## Supported Types + +### `shared.Array` + +```typescript +const value: shared.Array = {}; +``` + +### `shared.Array` + +```typescript +const value: shared.Array = {}; +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponse.md b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponse.md index 8c074b4ea..6d34f5a3d 100644 --- a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponse.md +++ b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponse.md @@ -1,17 +1,15 @@ -# CreateBatchSourceAccountResponse - - -## Supported Types - -### `operations.ResponseBody[]` - -```typescript -const value: operations.ResponseBody[] = []; -``` - -### `operations.CreateBatchSourceAccountResponseBody[]` - -```typescript -const value: operations.CreateBatchSourceAccountResponseBody[] = []; -``` - +# + +## Example Usage + +```typescript +import { } from "@codat/bank-feeds/sdk/models/operations"; + +let value: = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponsebody.md b/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponsebody.md deleted file mode 100644 index 770cff4e2..000000000 --- a/bank-feeds/docs/sdk/models/operations/createbatchsourceaccountresponsebody.md +++ /dev/null @@ -1,68 +0,0 @@ -# CreateBatchSourceAccountResponseBody - - -## Supported Types - -### `shared.SourceAccountV2BatchCreateResponse` - -```typescript -const value: shared.SourceAccountV2BatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, - }, -}; -``` - -### `shared.SourceAccountBatchCreateResponse` - -```typescript -const value: shared.SourceAccountBatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - }, -}; -``` - -### `shared.SourceAccountBatchErrorResponse` - -```typescript -const value: shared.SourceAccountBatchErrorResponse = { - sourceAccountId: "12345", - result: { - statusCode: "409", - error: "A bank account already exists with the same Id", - }, -}; -``` - diff --git a/bank-feeds/docs/sdk/models/operations/createconnectionrequest.md b/bank-feeds/docs/sdk/models/operations/createconnectionrequest.md index 4f893963e..653930602 100644 --- a/bank-feeds/docs/sdk/models/operations/createconnectionrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createconnectionrequest.md @@ -1,18 +1,18 @@ -# CreateConnectionRequest - -## Example Usage - -```typescript -import { CreateConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateConnectionRequest + +## Example Usage + +```typescript +import { CreateConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [operations.CreateConnectionRequestBody](../../../sdk/models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createconnectionrequestbody.md b/bank-feeds/docs/sdk/models/operations/createconnectionrequestbody.md index d9e9bd1da..8e02aa205 100644 --- a/bank-feeds/docs/sdk/models/operations/createconnectionrequestbody.md +++ b/bank-feeds/docs/sdk/models/operations/createconnectionrequestbody.md @@ -1,17 +1,17 @@ -# CreateConnectionRequestBody - -## Example Usage - -```typescript -import { CreateConnectionRequestBody } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateConnectionRequestBody = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# CreateConnectionRequestBody + +## Example Usage + +```typescript +import { CreateConnectionRequestBody } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateConnectionRequestBody = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `platformKey` | *string* | :heavy_minus_sign: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createsourceaccountrequest.md b/bank-feeds/docs/sdk/models/operations/createsourceaccountrequest.md index dcaad0418..8f0414f84 100644 --- a/bank-feeds/docs/sdk/models/operations/createsourceaccountrequest.md +++ b/bank-feeds/docs/sdk/models/operations/createsourceaccountrequest.md @@ -1,20 +1,20 @@ -# CreateSourceAccountRequest - -## Example Usage - -```typescript -import { CreateSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: CreateSourceAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestBody` | *operations.CreateSourceAccountRequestBody* | :heavy_minus_sign: | N/A | | \ No newline at end of file +# CreateSourceAccountRequest + +## Example Usage + +```typescript +import { CreateSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: CreateSourceAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestBody` | *CreateSourceAccountRequestBody* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createsourceaccountrequestbody.md b/bank-feeds/docs/sdk/models/operations/createsourceaccountrequestbody.md index 1d60d9d63..bf49b1f65 100644 --- a/bank-feeds/docs/sdk/models/operations/createsourceaccountrequestbody.md +++ b/bank-feeds/docs/sdk/models/operations/createsourceaccountrequestbody.md @@ -1,30 +1,16 @@ -# CreateSourceAccountRequestBody - - -## Supported Types - -### `shared.SourceAccountV2Prototype` - -```typescript -const value: shared.SourceAccountV2Prototype = { - id: "", - accountName: "", - accountType: "checking", - accountNumber: "", - currency: "GBP", - balance: new Decimal("9826.32"), - modifiedDate: "2022-10-23T00:00:00Z", - accountInfo: null, -}; -``` - -### `shared.SourceAccountPrototype` - -```typescript -const value: shared.SourceAccountPrototype = { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", -}; -``` - +# CreateSourceAccountRequestBody + + +## Supported Types + +### `shared.SourceAccountPrototype` + +```typescript +const value: shared.SourceAccountPrototype = {}; +``` + +### `shared.SourceAccountV2Prototype` + +```typescript +const value: shared.SourceAccountV2Prototype = {}; +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/createsourceaccountresponsebody.md b/bank-feeds/docs/sdk/models/operations/createsourceaccountresponsebody.md index 7fac96dbe..6d34f5a3d 100644 --- a/bank-feeds/docs/sdk/models/operations/createsourceaccountresponsebody.md +++ b/bank-feeds/docs/sdk/models/operations/createsourceaccountresponsebody.md @@ -1,48 +1,15 @@ -# CreateSourceAccountResponseBody - -Success - - -## Supported Types - -### `shared.SourceAccountV2` - -```typescript -const value: shared.SourceAccountV2 = { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", -}; -``` - -### `shared.SourceAccount` - -```typescript -const value: shared.SourceAccount = { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", -}; -``` - +# + +## Example Usage + +```typescript +import { } from "@codat/bank-feeds/sdk/models/operations"; + +let value: = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/deletebankfeedcredentialsrequest.md b/bank-feeds/docs/sdk/models/operations/deletebankfeedcredentialsrequest.md index 86bde6db5..3678b13b6 100644 --- a/bank-feeds/docs/sdk/models/operations/deletebankfeedcredentialsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/deletebankfeedcredentialsrequest.md @@ -1,19 +1,19 @@ -# DeleteBankFeedCredentialsRequest - -## Example Usage - -```typescript -import { DeleteBankFeedCredentialsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: DeleteBankFeedCredentialsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# DeleteBankFeedCredentialsRequest + +## Example Usage + +```typescript +import { DeleteBankFeedCredentialsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: DeleteBankFeedCredentialsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/deletecompanyrequest.md b/bank-feeds/docs/sdk/models/operations/deletecompanyrequest.md index 41d2a5e19..a0d87696b 100644 --- a/bank-feeds/docs/sdk/models/operations/deletecompanyrequest.md +++ b/bank-feeds/docs/sdk/models/operations/deletecompanyrequest.md @@ -1,17 +1,17 @@ -# DeleteCompanyRequest - -## Example Usage - -```typescript -import { DeleteCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: DeleteCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# DeleteCompanyRequest + +## Example Usage + +```typescript +import { DeleteCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: DeleteCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/deleteconnectionrequest.md b/bank-feeds/docs/sdk/models/operations/deleteconnectionrequest.md index cb98633e2..015d1d537 100644 --- a/bank-feeds/docs/sdk/models/operations/deleteconnectionrequest.md +++ b/bank-feeds/docs/sdk/models/operations/deleteconnectionrequest.md @@ -1,19 +1,19 @@ -# DeleteConnectionRequest - -## Example Usage - -```typescript -import { DeleteConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: DeleteConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# DeleteConnectionRequest + +## Example Usage + +```typescript +import { DeleteConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: DeleteConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/deletesourceaccountrequest.md b/bank-feeds/docs/sdk/models/operations/deletesourceaccountrequest.md index ed8bb1ab1..5c0447203 100644 --- a/bank-feeds/docs/sdk/models/operations/deletesourceaccountrequest.md +++ b/bank-feeds/docs/sdk/models/operations/deletesourceaccountrequest.md @@ -1,21 +1,21 @@ -# DeleteSourceAccountRequest - -## Example Usage - -```typescript -import { DeleteSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: DeleteSourceAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# DeleteSourceAccountRequest + +## Example Usage + +```typescript +import { DeleteSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: DeleteSourceAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/generatecredentialsrequest.md b/bank-feeds/docs/sdk/models/operations/generatecredentialsrequest.md index 1d7e2648e..f94dd7ca5 100644 --- a/bank-feeds/docs/sdk/models/operations/generatecredentialsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/generatecredentialsrequest.md @@ -1,17 +1,20 @@ -# GenerateCredentialsRequest - -## Example Usage - -```typescript -import { GenerateCredentialsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestBody` | *ReadableStream* | :heavy_check_mark: | N/A | | \ No newline at end of file +# GenerateCredentialsRequest + +## Example Usage + +```typescript +import { GenerateCredentialsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GenerateCredentialsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestBody` | *ReadableStream | Blob | ArrayBuffer | Uint8Array* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/generateotprequest.md b/bank-feeds/docs/sdk/models/operations/generateotprequest.md index f3091a853..18b7ae651 100644 --- a/bank-feeds/docs/sdk/models/operations/generateotprequest.md +++ b/bank-feeds/docs/sdk/models/operations/generateotprequest.md @@ -1,19 +1,19 @@ -# GenerateOtpRequest - -## Example Usage - -```typescript -import { GenerateOtpRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GenerateOtpRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GenerateOtpRequest + +## Example Usage + +```typescript +import { GenerateOtpRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GenerateOtpRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getbankaccountmappingrequest.md b/bank-feeds/docs/sdk/models/operations/getbankaccountmappingrequest.md index f131f56a9..a2527fa0f 100644 --- a/bank-feeds/docs/sdk/models/operations/getbankaccountmappingrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getbankaccountmappingrequest.md @@ -1,19 +1,19 @@ -# GetBankAccountMappingRequest - -## Example Usage - -```typescript -import { GetBankAccountMappingRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetBankAccountMappingRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetBankAccountMappingRequest + +## Example Usage + +```typescript +import { GetBankAccountMappingRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetBankAccountMappingRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcompanyaccesstokenrequest.md b/bank-feeds/docs/sdk/models/operations/getcompanyaccesstokenrequest.md index 20bf1699a..c79138f54 100644 --- a/bank-feeds/docs/sdk/models/operations/getcompanyaccesstokenrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcompanyaccesstokenrequest.md @@ -1,17 +1,17 @@ -# GetCompanyAccessTokenRequest - -## Example Usage - -```typescript -import { GetCompanyAccessTokenRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCompanyAccessTokenRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyAccessTokenRequest + +## Example Usage + +```typescript +import { GetCompanyAccessTokenRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCompanyAccessTokenRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcompanyinformationrequest.md b/bank-feeds/docs/sdk/models/operations/getcompanyinformationrequest.md index c26fb4b1a..557348f65 100644 --- a/bank-feeds/docs/sdk/models/operations/getcompanyinformationrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcompanyinformationrequest.md @@ -1,19 +1,19 @@ -# GetCompanyInformationRequest - -## Example Usage - -```typescript -import { GetCompanyInformationRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCompanyInformationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCompanyInformationRequest + +## Example Usage + +```typescript +import { GetCompanyInformationRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCompanyInformationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcompanyrequest.md b/bank-feeds/docs/sdk/models/operations/getcompanyrequest.md index 862827f09..e83277391 100644 --- a/bank-feeds/docs/sdk/models/operations/getcompanyrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcompanyrequest.md @@ -1,17 +1,17 @@ -# GetCompanyRequest - -## Example Usage - -```typescript -import { GetCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyRequest + +## Example Usage + +```typescript +import { GetCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getconnectionrequest.md b/bank-feeds/docs/sdk/models/operations/getconnectionrequest.md index 24a597c3e..c8e604d3e 100644 --- a/bank-feeds/docs/sdk/models/operations/getconnectionrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getconnectionrequest.md @@ -1,19 +1,19 @@ -# GetConnectionRequest - -## Example Usage - -```typescript -import { GetConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetConnectionRequest + +## Example Usage + +```typescript +import { GetConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md b/bank-feeds/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md index e30f53b82..2a53899ef 100644 --- a/bank-feeds/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md @@ -1,19 +1,19 @@ -# GetCreateBankAccountsModelRequest - -## Example Usage - -```typescript -import { GetCreateBankAccountsModelRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCreateBankAccountsModelRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCreateBankAccountsModelRequest + +## Example Usage + +```typescript +import { GetCreateBankAccountsModelRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCreateBankAccountsModelRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md b/bank-feeds/docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md index 03782762d..7d283ddae 100644 --- a/bank-feeds/docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcreatebanktransactionsmodelrequest.md @@ -1,21 +1,21 @@ -# GetCreateBankTransactionsModelRequest - -## Example Usage - -```typescript -import { GetCreateBankTransactionsModelRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCreateBankTransactionsModelRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# GetCreateBankTransactionsModelRequest + +## Example Usage + +```typescript +import { GetCreateBankTransactionsModelRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCreateBankTransactionsModelRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getcreateoperationrequest.md b/bank-feeds/docs/sdk/models/operations/getcreateoperationrequest.md index 5551e9453..f6e16c8ac 100644 --- a/bank-feeds/docs/sdk/models/operations/getcreateoperationrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getcreateoperationrequest.md @@ -1,19 +1,18 @@ -# GetCreateOperationRequest - -## Example Usage - -```typescript -import { GetCreateOperationRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetCreateOperationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "ab6924f9-5f88-45a4-9930-c36dc0697c8a", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCreateOperationRequest + +## Example Usage + +```typescript +import { GetCreateOperationRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetCreateOperationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `pushOperationKey` | *string* | :heavy_check_mark: | Push operation key. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md b/bank-feeds/docs/sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md index e65f2fede..6509958d4 100644 --- a/bank-feeds/docs/sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md @@ -1,21 +1,20 @@ -# GetLatestManagedBankFeedSyncRequest - -## Example Usage - -```typescript -import { GetLatestManagedBankFeedSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetLatestManagedBankFeedSyncRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# GetLatestManagedBankFeedSyncRequest + +## Example Usage + +```typescript +import { GetLatestManagedBankFeedSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetLatestManagedBankFeedSyncRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/getmanagedbankfeedsyncrequest.md b/bank-feeds/docs/sdk/models/operations/getmanagedbankfeedsyncrequest.md index 954060207..9c13e277b 100644 --- a/bank-feeds/docs/sdk/models/operations/getmanagedbankfeedsyncrequest.md +++ b/bank-feeds/docs/sdk/models/operations/getmanagedbankfeedsyncrequest.md @@ -1,23 +1,21 @@ -# GetManagedBankFeedSyncRequest - -## Example Usage - -```typescript -import { GetManagedBankFeedSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: GetManagedBankFeedSyncRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - syncId: "a87728cf-9cad-4ba1-835d-09ce3880055c", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account. | | +# GetManagedBankFeedSyncRequest + +## Example Usage + +```typescript +import { GetManagedBankFeedSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: GetManagedBankFeedSyncRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account. | | | `syncId` | *string* | :heavy_check_mark: | The ID of the sync. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listbankaccountsrequest.md b/bank-feeds/docs/sdk/models/operations/listbankaccountsrequest.md index fd6642976..752fbd74d 100644 --- a/bank-feeds/docs/sdk/models/operations/listbankaccountsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/listbankaccountsrequest.md @@ -1,25 +1,25 @@ -# ListBankAccountsRequest - -## Example Usage - -```typescript -import { ListBankAccountsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ListBankAccountsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListBankAccountsRequest + +## Example Usage + +```typescript +import { ListBankAccountsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ListBankAccountsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listcompaniesrequest.md b/bank-feeds/docs/sdk/models/operations/listcompaniesrequest.md index 98745ca15..e965a9d8e 100644 --- a/bank-feeds/docs/sdk/models/operations/listcompaniesrequest.md +++ b/bank-feeds/docs/sdk/models/operations/listcompaniesrequest.md @@ -1,23 +1,23 @@ -# ListCompaniesRequest - -## Example Usage - -```typescript -import { ListCompaniesRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ListCompaniesRequest = { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +# ListCompaniesRequest + +## Example Usage + +```typescript +import { ListCompaniesRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ListCompaniesRequest = { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `tags` | *string* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listconnectionsrequest.md b/bank-feeds/docs/sdk/models/operations/listconnectionsrequest.md index 7ce46fba9..a4aa02705 100644 --- a/bank-feeds/docs/sdk/models/operations/listconnectionsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/listconnectionsrequest.md @@ -1,23 +1,23 @@ -# ListConnectionsRequest - -## Example Usage - -```typescript -import { ListConnectionsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ListConnectionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListConnectionsRequest + +## Example Usage + +```typescript +import { ListConnectionsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ListConnectionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listcreateoperationsrequest.md b/bank-feeds/docs/sdk/models/operations/listcreateoperationsrequest.md index 7ef11b13b..30cff974c 100644 --- a/bank-feeds/docs/sdk/models/operations/listcreateoperationsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/listcreateoperationsrequest.md @@ -1,23 +1,23 @@ -# ListCreateOperationsRequest - -## Example Usage - -```typescript -import { ListCreateOperationsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ListCreateOperationsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListCreateOperationsRequest + +## Example Usage + +```typescript +import { ListCreateOperationsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ListCreateOperationsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listsourceaccountsrequest.md b/bank-feeds/docs/sdk/models/operations/listsourceaccountsrequest.md index 6807d9d46..d170111bb 100644 --- a/bank-feeds/docs/sdk/models/operations/listsourceaccountsrequest.md +++ b/bank-feeds/docs/sdk/models/operations/listsourceaccountsrequest.md @@ -1,19 +1,19 @@ -# ListSourceAccountsRequest - -## Example Usage - -```typescript -import { ListSourceAccountsRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ListSourceAccountsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# ListSourceAccountsRequest + +## Example Usage + +```typescript +import { ListSourceAccountsRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ListSourceAccountsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/listsourceaccountsresponsebody.md b/bank-feeds/docs/sdk/models/operations/listsourceaccountsresponsebody.md index 863e2b26a..6d34f5a3d 100644 --- a/bank-feeds/docs/sdk/models/operations/listsourceaccountsresponsebody.md +++ b/bank-feeds/docs/sdk/models/operations/listsourceaccountsresponsebody.md @@ -1,83 +1,15 @@ -# ListSourceAccountsResponseBody - -Success - - -## Supported Types - -### `shared.SourceAccountV2[]` - -```typescript -const value: shared.SourceAccountV2[] = [ - { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, - { - id: "acc-002", - accountName: "account-083", - accountType: "savings", - accountNumber: "23456789", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("400"), - accountInfo: { - description: "account description 2", - nickname: "account 1290", - accountOpenDate: "2023-05-23", - availableBalance: new Decimal("400"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, -]; -``` - -### `shared.SourceAccount[]` - -```typescript -const value: shared.SourceAccount[] = [ - { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - { - id: "acc-003", - accountName: "account-095", - accountType: "Credit", - accountNumber: "12345671", - sortCode: "123456", - currency: "USD", - balance: new Decimal("0"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, -]; -``` - +# + +## Example Usage + +```typescript +import { } from "@codat/bank-feeds/sdk/models/operations"; + +let value: = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/replacecompanyrequest.md b/bank-feeds/docs/sdk/models/operations/replacecompanyrequest.md index 925a5157b..763be67d8 100644 --- a/bank-feeds/docs/sdk/models/operations/replacecompanyrequest.md +++ b/bank-feeds/docs/sdk/models/operations/replacecompanyrequest.md @@ -1,18 +1,18 @@ -# ReplaceCompanyRequest - -## Example Usage - -```typescript -import { ReplaceCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: ReplaceCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# ReplaceCompanyRequest + +## Example Usage + +```typescript +import { ReplaceCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: ReplaceCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyRequestBody` | [shared.CompanyRequestBody](../../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/responsebody.md b/bank-feeds/docs/sdk/models/operations/responsebody.md deleted file mode 100644 index a753dbbd2..000000000 --- a/bank-feeds/docs/sdk/models/operations/responsebody.md +++ /dev/null @@ -1,56 +0,0 @@ -# ResponseBody - - -## Supported Types - -### `shared.SourceAccountV2BatchCreateResponse` - -```typescript -const value: shared.SourceAccountV2BatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, - }, -}; -``` - -### `shared.SourceAccountBatchCreateResponse` - -```typescript -const value: shared.SourceAccountBatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - }, -}; -``` - diff --git a/bank-feeds/docs/sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md b/bank-feeds/docs/sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md index 4f07e7d33..148b3596a 100644 --- a/bank-feeds/docs/sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md +++ b/bank-feeds/docs/sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md @@ -1,21 +1,20 @@ -# RunManagedBankFeedAdHocSyncRequest - -## Example Usage - -```typescript -import { RunManagedBankFeedAdHocSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: RunManagedBankFeedAdHocSyncRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# RunManagedBankFeedAdHocSyncRequest + +## Example Usage + +```typescript +import { RunManagedBankFeedAdHocSyncRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: RunManagedBankFeedAdHocSyncRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/unlinkconnectionrequest.md b/bank-feeds/docs/sdk/models/operations/unlinkconnectionrequest.md index 860ed8519..f16f590bb 100644 --- a/bank-feeds/docs/sdk/models/operations/unlinkconnectionrequest.md +++ b/bank-feeds/docs/sdk/models/operations/unlinkconnectionrequest.md @@ -1,20 +1,20 @@ -# UnlinkConnectionRequest - -## Example Usage - -```typescript -import { UnlinkConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: UnlinkConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# UnlinkConnectionRequest + +## Example Usage + +```typescript +import { UnlinkConnectionRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: UnlinkConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `requestBody` | [operations.UnlinkConnectionUpdateConnection](../../../sdk/models/operations/unlinkconnectionupdateconnection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/unlinkconnectionupdateconnection.md b/bank-feeds/docs/sdk/models/operations/unlinkconnectionupdateconnection.md index 9719a8ed1..f886bb5be 100644 --- a/bank-feeds/docs/sdk/models/operations/unlinkconnectionupdateconnection.md +++ b/bank-feeds/docs/sdk/models/operations/unlinkconnectionupdateconnection.md @@ -1,15 +1,15 @@ -# UnlinkConnectionUpdateConnection - -## Example Usage - -```typescript -import { UnlinkConnectionUpdateConnection } from "@codat/bank-feeds/sdk/models/operations"; - -let value: UnlinkConnectionUpdateConnection = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file +# UnlinkConnectionUpdateConnection + +## Example Usage + +```typescript +import { UnlinkConnectionUpdateConnection } from "@codat/bank-feeds/sdk/models/operations"; + +let value: UnlinkConnectionUpdateConnection = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/updatecompanyrequest.md b/bank-feeds/docs/sdk/models/operations/updatecompanyrequest.md index 4ee26e57b..3b5e92f2a 100644 --- a/bank-feeds/docs/sdk/models/operations/updatecompanyrequest.md +++ b/bank-feeds/docs/sdk/models/operations/updatecompanyrequest.md @@ -1,18 +1,18 @@ -# UpdateCompanyRequest - -## Example Usage - -```typescript -import { UpdateCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: UpdateCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# UpdateCompanyRequest + +## Example Usage + +```typescript +import { UpdateCompanyRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: UpdateCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyUpdateRequest` | [shared.CompanyUpdateRequest](../../../sdk/models/shared/companyupdaterequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/operations/updatesourceaccountrequest.md b/bank-feeds/docs/sdk/models/operations/updatesourceaccountrequest.md index a18d6f6df..53f12253b 100644 --- a/bank-feeds/docs/sdk/models/operations/updatesourceaccountrequest.md +++ b/bank-feeds/docs/sdk/models/operations/updatesourceaccountrequest.md @@ -1,22 +1,22 @@ -# UpdateSourceAccountRequest - -## Example Usage - -```typescript -import { UpdateSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; - -let value: UpdateSourceAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `sourceAccount` | [shared.SourceAccount](../../../sdk/models/shared/sourceaccount.md) | :heavy_minus_sign: | N/A | **Example 1:** {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
}
**Example 2:** {
"id": "acc-003",
"accountName": "account-095",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345671",
"currency": "USD",
"balance": 0,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | \ No newline at end of file +# UpdateSourceAccountRequest + +## Example Usage + +```typescript +import { UpdateSourceAccountRequest } from "@codat/bank-feeds/sdk/models/operations"; + +let value: UpdateSourceAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `accountId` | *string* | :heavy_check_mark: | Unique identifier for an account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `sourceAccount` | [shared.SourceAccount](../../../sdk/models/shared/sourceaccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | **Example 1:** {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
}
**Example 2:** {
"id": "acc-003",
"accountName": "account-095",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345671",
"currency": "USD",
"balance": 0,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/accountinfo.md b/bank-feeds/docs/sdk/models/shared/accountinfo.md index 8905c80f1..e95637285 100644 --- a/bank-feeds/docs/sdk/models/shared/accountinfo.md +++ b/bank-feeds/docs/sdk/models/shared/accountinfo.md @@ -1,20 +1,20 @@ -# AccountInfo - -## Example Usage - -```typescript -import { AccountInfo } from "@codat/bank-feeds/sdk/models/shared"; - -let value: AccountInfo = { - accountOpenDate: "2022-10-23", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_minus_sign: | Description of the account. | | -| `nickname` | *string* | :heavy_minus_sign: | Name given to the account by the user. Used in UIs to assist in account selection. | | -| `accountOpenDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example:
```
2020-10-08
``` | 2022-10-23 | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Balance of funds available for use. This includes pending activity. | | \ No newline at end of file +# AccountInfo + +## Example Usage + +```typescript +import { AccountInfo } from "@codat/bank-feeds/sdk/models/shared"; + +let value: AccountInfo = { + accountOpenDate: "2022-10-23", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_minus_sign: | Description of the account. | | +| `nickname` | *string* | :heavy_minus_sign: | Name given to the account by the user. Used in UIs to assist in account selection. | | +| `accountOpenDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example:
```
2020-10-08
``` | 2022-10-23 | +| `availableBalance` | *Decimal | number* | :heavy_minus_sign: | Balance of funds available for use. This includes pending activity. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/accountingbankaccount.md b/bank-feeds/docs/sdk/models/shared/accountingbankaccount.md index 665251198..c22e35f3c 100644 --- a/bank-feeds/docs/sdk/models/shared/accountingbankaccount.md +++ b/bank-feeds/docs/sdk/models/shared/accountingbankaccount.md @@ -1,51 +1,46 @@ -# AccountingBankAccount - -> **Accessing Bank Accounts through Banking API** -> -> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. -> -> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. - -## Overview - -A list of bank accounts associated with a company and a specific data connection. - -Bank accounts data includes: -* The name and ID of the account in the accounting software. -* The currency and balance of the account. -* The sort code and account number. - -## Example Usage - -```typescript -import { AccountingBankAccount } from "@codat/bank-feeds/sdk/models/shared"; - -let value: AccountingBankAccount = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | -| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountsBankAccountType](../../../sdk/models/shared/bankaccountsbankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | -| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | Balance of the bank account. | | -| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `overdraftLimit` | *Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file +# AccountingBankAccount + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting software. +* The currency and balance of the account. +* The sort code and account number. + +## Example Usage + +```typescript +import { AccountingBankAccount } from "@codat/bank-feeds/sdk/models/shared"; + +let value: AccountingBankAccount = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | +| `accountType` | [shared.BankAccountsBankAccountType](../../../sdk/models/shared/bankaccountsbankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | +| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | +| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | +| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Balance of the bank account. | +| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | +| `availableBalance` | *Decimal | number* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | +| `overdraftLimit` | *Decimal | number* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/accounttype.md b/bank-feeds/docs/sdk/models/shared/accounttype.md index b62adfe66..f84da8eb8 100644 --- a/bank-feeds/docs/sdk/models/shared/accounttype.md +++ b/bank-feeds/docs/sdk/models/shared/accounttype.md @@ -1,17 +1,15 @@ -# AccountType - -The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - -## Example Usage - -```typescript -import { AccountType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: AccountType = "prepaidCard"; -``` - -## Values - -```typescript -"checking" | "savings" | "loan" | "creditCard" | "prepaidCard" +# AccountType + +## Example Usage + +```typescript +import { AccountType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: AccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponse.md b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponse.md index f570b3194..bb75fa38a 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponse.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponse.md @@ -1,50 +1,28 @@ -# BankAccountCreateResponse - -## Example Usage - -```typescript -import { BankAccountCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCreateResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "892d79f8-ab9a-43b0-8f8b-cb5098ef8599", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "TimedOut", - statusCode: 645019, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.BankAccountCreateResponseAccountingBankAccount](../../../sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# BankAccountCreateResponse + +## Example Usage + +```typescript +import { BankAccountCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCreateResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | The type of data being pushed, eg invoices, customers. | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | +| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | +| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | +| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | +| `timeoutInSeconds` | *number* | :heavy_minus_sign: | Number of seconds the push operation must complete within before it times out. | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | N/A | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | N/A | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | +| `data` | *BankAccountCreateResponseAccountingBankAccount* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md index ba92df96c..f34fc35d0 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponseaccountingbankaccount.md @@ -1,53 +1,31 @@ -# ~~BankAccountCreateResponseAccountingBankAccount~~ - -> **Accessing Bank Accounts through Banking API** -> -> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. -> -> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. - -## Overview - -A list of bank accounts associated with a company and a specific data connection. - -Bank accounts data includes: -* The name and ID of the account in the accounting software. -* The currency and balance of the account. -* The sort code and account number. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { BankAccountCreateResponseAccountingBankAccount } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCreateResponseAccountingBankAccount = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | -| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountCreateResponseBankAccountType](../../../sdk/models/shared/bankaccountcreateresponsebankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | -| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | Balance of the bank account. | | -| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `overdraftLimit` | *Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | -| `metadata` | [shared.BankAccountCreateResponseMetadata](../../../sdk/models/shared/bankaccountcreateresponsemetadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.BankAccountCreateResponseSupplementalData](../../../sdk/models/shared/bankaccountcreateresponsesupplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file +# BankAccountCreateResponseAccountingBankAccount + +## Example Usage + +```typescript +import { BankAccountCreateResponseAccountingBankAccount } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCreateResponseAccountingBankAccount = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | +| `accountType` | [shared.BankAccountCreateResponseBankAccountType](../../../sdk/models/shared/bankaccountcreateresponsebankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | +| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | +| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | +| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Balance of the bank account. | +| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | +| `availableBalance` | *Decimal | number* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | +| `overdraftLimit` | *Decimal | number* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | +| `metadata` | *BankAccountCreateResponseMetadata* | :heavy_minus_sign: | N/A | +| `supplementalData` | *BankAccountCreateResponseSupplementalData* | :heavy_minus_sign: | N/A | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md index 827405a70..14e84573a 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsebankaccounttype.md @@ -1,19 +1,15 @@ -# BankAccountCreateResponseBankAccountType - -The type of transactions and balances on the account. -For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. -For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - -## Example Usage - -```typescript -import { BankAccountCreateResponseBankAccountType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCreateResponseBankAccountType = "Debit"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# BankAccountCreateResponseBankAccountType + +## Example Usage + +```typescript +import { BankAccountCreateResponseBankAccountType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCreateResponseBankAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsemetadata.md b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsemetadata.md index 3111533b9..179093186 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsemetadata.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsemetadata.md @@ -1,15 +1,15 @@ -# BankAccountCreateResponseMetadata - -## Example Usage - -```typescript -import { BankAccountCreateResponseMetadata } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCreateResponseMetadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +# BankAccountCreateResponseMetadata + +## Example Usage + +```typescript +import { BankAccountCreateResponseMetadata } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCreateResponseMetadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `isDeleted` | *boolean* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md index c2717966f..cd98230af 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcreateresponsesupplementaldata.md @@ -1,19 +1,15 @@ -# BankAccountCreateResponseSupplementalData - -Supplemental data is additional data you can include in our standard data types. - -It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - -## Example Usage - -```typescript -import { BankAccountCreateResponseSupplementalData } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCreateResponseSupplementalData = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +# BankAccountCreateResponseSupplementalData + +## Example Usage + +```typescript +import { BankAccountCreateResponseSupplementalData } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCreateResponseSupplementalData = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | | `content` | Record> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountcredentials.md b/bank-feeds/docs/sdk/models/shared/bankaccountcredentials.md index 564ab2f6f..c29e2b002 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountcredentials.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountcredentials.md @@ -1,21 +1,21 @@ -# BankAccountCredentials - -Result of generate credentials - -## Example Usage - -```typescript -import { BankAccountCredentials } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountCredentials = { - username: "S0MW-TR0P-7DS0", - password: "cO0ajh0uGyTN0Pwh", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `username` | *string* | :heavy_minus_sign: | Username used by the bank feeds platform to retrieve transactions | S0MW-TR0P-7DS0 | +# BankAccountCredentials + +Result of generate credentials + +## Example Usage + +```typescript +import { BankAccountCredentials } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountCredentials = { + username: "S0MW-TR0P-7DS0", + password: "cO0ajh0uGyTN0Pwh", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `username` | *string* | :heavy_minus_sign: | Username used by the bank feeds platform to retrieve transactions | S0MW-TR0P-7DS0 | | `password` | *string* | :heavy_minus_sign: | Password to enable the bank feeds platform to securely retrieve transactions. | cO0ajh0uGyTN0Pwh | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountprototype.md b/bank-feeds/docs/sdk/models/shared/bankaccountprototype.md index d7cfac381..26ac7c421 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountprototype.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountprototype.md @@ -1,29 +1,29 @@ -# BankAccountPrototype - -## Example Usage - -```typescript -import { BankAccountPrototype } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountPrototype = { - currency: "GBP", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | -| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | Balance of the bank account. | | -| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `overdraftLimit` | *Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +# BankAccountPrototype + +## Example Usage + +```typescript +import { BankAccountPrototype } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountPrototype = { + currency: "GBP", + status: "Active", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | +| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Balance of the bank account. | | +| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | +| `availableBalance` | *Decimal | number* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | +| `overdraftLimit` | *Decimal | number* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | | `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccounts.md b/bank-feeds/docs/sdk/models/shared/bankaccounts.md index 8e3ee75ba..3e3a1ddd7 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccounts.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccounts.md @@ -1,31 +1,23 @@ -# BankAccounts - -## Example Usage - -```typescript -import { BankAccounts } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccounts = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.AccountingBankAccount](../../../sdk/models/shared/accountingbankaccount.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# BankAccounts + +## Example Usage + +```typescript +import { BankAccounts } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccounts = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.AccountingBankAccount](../../../sdk/models/shared/accountingbankaccount.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountsbankaccounttype.md b/bank-feeds/docs/sdk/models/shared/bankaccountsbankaccounttype.md index 9532fc9bb..e581d1ab0 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountsbankaccounttype.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountsbankaccounttype.md @@ -1,19 +1,15 @@ -# BankAccountsBankAccountType - -The type of transactions and balances on the account. -For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. -For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - -## Example Usage - -```typescript -import { BankAccountsBankAccountType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountsBankAccountType = "Debit"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# BankAccountsBankAccountType + +## Example Usage + +```typescript +import { BankAccountsBankAccountType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountsBankAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccountstatus.md b/bank-feeds/docs/sdk/models/shared/bankaccountstatus.md index 5a3e4ca9a..e1f5ab773 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccountstatus.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccountstatus.md @@ -1,17 +1,17 @@ -# BankAccountStatus - -Status of the bank account. - -## Example Usage - -```typescript -import { BankAccountStatus } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountStatus = "Active"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" | "Pending" +# BankAccountStatus + +Status of the bank account. + +## Example Usage + +```typescript +import { BankAccountStatus } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" | "Pending" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankaccounttype.md b/bank-feeds/docs/sdk/models/shared/bankaccounttype.md index 740850306..feae0f6c8 100644 --- a/bank-feeds/docs/sdk/models/shared/bankaccounttype.md +++ b/bank-feeds/docs/sdk/models/shared/bankaccounttype.md @@ -1,19 +1,19 @@ -# BankAccountType - -The type of transactions and balances on the account. -For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. -For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - -## Example Usage - -```typescript -import { BankAccountType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankAccountType = "Unknown"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# BankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + +## Example Usage + +```typescript +import { BankAccountType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankfeedaccountmapping.md b/bank-feeds/docs/sdk/models/shared/bankfeedaccountmapping.md index 09196a7c8..e77f37991 100644 --- a/bank-feeds/docs/sdk/models/shared/bankfeedaccountmapping.md +++ b/bank-feeds/docs/sdk/models/shared/bankfeedaccountmapping.md @@ -1,20 +1,20 @@ -# BankFeedAccountMapping - -## Example Usage - -```typescript -import { BankFeedAccountMapping } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankFeedAccountMapping = { - sourceAccountId: "acc-002", - targetAccountId: "account-081", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `sourceAccountId` | *string* | :heavy_check_mark: | Unique ID for the source account | | -| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account | | +# BankFeedAccountMapping + +## Example Usage + +```typescript +import { BankFeedAccountMapping } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankFeedAccountMapping = { + sourceAccountId: "acc-002", + targetAccountId: "account-081", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sourceAccountId` | *string* | :heavy_check_mark: | Unique ID for the source account | | +| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account | | | `feedStartDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankfeedaccountmappingresponse.md b/bank-feeds/docs/sdk/models/shared/bankfeedaccountmappingresponse.md index 333a5a675..e6bdf4ff2 100644 --- a/bank-feeds/docs/sdk/models/shared/bankfeedaccountmappingresponse.md +++ b/bank-feeds/docs/sdk/models/shared/bankfeedaccountmappingresponse.md @@ -1,23 +1,23 @@ -# BankFeedAccountMappingResponse - -## Example Usage - -```typescript -import { BankFeedAccountMappingResponse } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankFeedAccountMappingResponse = { - sourceAccountId: "acc-002", - targetAccountId: "account-081", - status: "Failed", - error: "A feed connection already exists to this account", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | -| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account. | -| `status` | *string* | :heavy_minus_sign: | Status of the POST request. | +# BankFeedAccountMappingResponse + +## Example Usage + +```typescript +import { BankFeedAccountMappingResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankFeedAccountMappingResponse = { + sourceAccountId: "acc-002", + targetAccountId: "account-081", + status: "Failed", + error: "A feed connection already exists to this account", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | +| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account. | +| `status` | *string* | :heavy_minus_sign: | Status of the POST request. | | `error` | *string* | :heavy_minus_sign: | Error returned during the post request | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/bankfeedmapping.md b/bank-feeds/docs/sdk/models/shared/bankfeedmapping.md index d1def887a..c42da90bb 100644 --- a/bank-feeds/docs/sdk/models/shared/bankfeedmapping.md +++ b/bank-feeds/docs/sdk/models/shared/bankfeedmapping.md @@ -1,37 +1,36 @@ -# BankFeedMapping - -A bank feed connection between a source account and a target account, including potential target accounts. - -## Example Usage - -```typescript -import { BankFeedMapping } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: BankFeedMapping = { - sourceAccountId: "acc-002", - sourceAccountName: "ACME Bank", - sourceAccountNumber: "1234-5678", - sourceBalance: new Decimal("500"), - sourceCurrency: "USD", - targetAccountId: "account-081", - targetAccountName: "ACME Bank", - status: "Success", - feedStartDate: "2023-01-09T14:14:14.1057478Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | | -| `sourceAccountName` | *string* | :heavy_minus_sign: | Name for the source account. | | -| `sourceAccountNumber` | *string* | :heavy_minus_sign: | Account number for the source account. | | -| `sourceBalance` | *Decimal* | :heavy_minus_sign: | Balance for the source account. | | -| `sourceCurrency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account in the accounting software. | | -| `targetAccountName` | *string* | :heavy_minus_sign: | Name for the target account in the accounting software. | | -| `status` | *string* | :heavy_minus_sign: | The status. | | -| `targetAccountOptions` | [shared.TargetAccountOption](../../../sdk/models/shared/targetaccountoption.md)[] | :heavy_minus_sign: | An array of potential target accounts. | | +# BankFeedMapping + +A bank feed connection between a source account and a target account, including potential target accounts. + +## Example Usage + +```typescript +import { BankFeedMapping } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankFeedMapping = { + sourceAccountId: "acc-002", + sourceAccountName: "ACME Bank", + sourceAccountNumber: "1234-5678", + sourceBalance: 500, + sourceCurrency: "USD", + targetAccountId: "account-081", + targetAccountName: "ACME Bank", + status: "Success", + feedStartDate: "2023-01-09T14:14:14.1057478Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | | +| `sourceAccountName` | *string* | :heavy_minus_sign: | Name for the source account. | | +| `sourceAccountNumber` | *string* | :heavy_minus_sign: | Account number for the source account. | | +| `sourceBalance` | *Decimal | number* | :heavy_minus_sign: | Balance for the source account. | | +| `sourceCurrency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `targetAccountId` | *string* | :heavy_minus_sign: | Unique ID for the target account in the accounting software. | | +| `targetAccountName` | *string* | :heavy_minus_sign: | Name for the target account in the accounting software. | | +| `status` | *string* | :heavy_minus_sign: | The status. | | +| `targetAccountOptions` | [shared.TargetAccountOption](../../../sdk/models/shared/targetaccountoption.md)[] | :heavy_minus_sign: | An array of potential target accounts. | | | `feedStartDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/banktransactions.md b/bank-feeds/docs/sdk/models/shared/banktransactions.md index 2f275ae2b..d88fbdc45 100644 --- a/bank-feeds/docs/sdk/models/shared/banktransactions.md +++ b/bank-feeds/docs/sdk/models/shared/banktransactions.md @@ -1,34 +1,23 @@ -# BankTransactions - -## Example Usage - -```typescript -import { BankTransactions } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: BankTransactions = { - id: "716422529", - date: "2023-08-22T10:21:00", - description: - "Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60", - counterparty: "ACME INC", - reference: "reference for transaction", - reconciled: false, - amount: new Decimal("999.99"), - balance: new Decimal("-999.99"), -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting software. | 716422529 | -| `date` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2023-08-22T10:21:00
2023-08-22
```

When pushing bank transaction data to Codat, the date is treated as a local date. This means:

- The date/time is used exactly as provided, without any timezone conversion.
- If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used.
- We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). | **Example 1:** 2023-08-22T10:21:00
**Example 2:** 2023-08-22 | -| `description` | *string* | :heavy_minus_sign: | Description of the bank transaction. | Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60 | -| `counterparty` | *string* | :heavy_minus_sign: | The giving or receiving party such as a person or organization. | ACME INC | -| `reference` | *string* | :heavy_minus_sign: | An optional reference to the bank transaction. | reference for transaction | -| `reconciled` | *boolean* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. | false | -| `amount` | *Decimal* | :heavy_minus_sign: | The amount transacted in the bank transaction. | 999.99 | -| `balance` | *Decimal* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. | -999.99 | -| `transactionType` | [shared.BankTransactionType](../../../sdk/models/shared/banktransactiontype.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | | \ No newline at end of file +# BankTransactions + +## Example Usage + +```typescript +import { BankTransactions } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankTransactions = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting software. | +| `date` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2023-08-22T10:21:00
2023-08-22
```

When pushing bank transaction data to Codat, the date is treated as a local date. This means:

- The date/time is used exactly as provided, without any timezone conversion.
- If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used.
- We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). | +| `description` | *string* | :heavy_minus_sign: | Description of the bank transaction. | +| `counterparty` | *string* | :heavy_minus_sign: | The giving or receiving party such as a person or organization. | +| `reference` | *string* | :heavy_minus_sign: | An optional reference to the bank transaction. | +| `reconciled` | *boolean* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. | +| `amount` | *Decimal | number* | :heavy_minus_sign: | The amount transacted in the bank transaction. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. | +| `transactionType` | [shared.BankTransactionType](../../../sdk/models/shared/banktransactiontype.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/banktransactiontype.md b/bank-feeds/docs/sdk/models/shared/banktransactiontype.md index 65b9458d8..cef423b01 100644 --- a/bank-feeds/docs/sdk/models/shared/banktransactiontype.md +++ b/bank-feeds/docs/sdk/models/shared/banktransactiontype.md @@ -1,17 +1,17 @@ -# BankTransactionType - -Type of transaction for the bank statement line. - -## Example Usage - -```typescript -import { BankTransactionType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: BankTransactionType = "RepeatPmt"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" | "Int" | "Div" | "Fee" | "SerChg" | "Dep" | "Atm" | "Pos" | "Xfer" | "Check" | "Payment" | "Cash" | "DirectDep" | "DirectDebit" | "RepeatPmt" | "Other" +# BankTransactionType + +Type of transaction for the bank statement line. + +## Example Usage + +```typescript +import { BankTransactionType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: BankTransactionType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/clientratelimitwebhook.md b/bank-feeds/docs/sdk/models/shared/clientratelimitwebhook.md index c597b7bda..0bd91daf3 100644 --- a/bank-feeds/docs/sdk/models/shared/clientratelimitwebhook.md +++ b/bank-feeds/docs/sdk/models/shared/clientratelimitwebhook.md @@ -1,25 +1,22 @@ -# ClientRateLimitWebhook - -## Example Usage - -```typescript -import { ClientRateLimitWebhook } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ClientRateLimitWebhook = { - id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - eventType: "client.rateLimit.reset", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - expiryDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | -| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +# ClientRateLimitWebhook + +## Example Usage + +```typescript +import { ClientRateLimitWebhook } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ClientRateLimitWebhook = { + id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", + eventType: "client.rateLimit.reset", + generatedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | +| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/clientratelimitwebhookpayload.md b/bank-feeds/docs/sdk/models/shared/clientratelimitwebhookpayload.md index dfe894fe9..5a3aa9e5f 100644 --- a/bank-feeds/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ b/bank-feeds/docs/sdk/models/shared/clientratelimitwebhookpayload.md @@ -1,19 +1,19 @@ -# ClientRateLimitWebhookPayload - -## Example Usage - -```typescript -import { ClientRateLimitWebhookPayload } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ClientRateLimitWebhookPayload = { - expiryDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | -| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | +# ClientRateLimitWebhookPayload + +## Example Usage + +```typescript +import { ClientRateLimitWebhookPayload } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ClientRateLimitWebhookPayload = { + expiryDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | +| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | | `expiryDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companies.md b/bank-feeds/docs/sdk/models/shared/companies.md index 5af6e3b30..8455f4c4d 100644 --- a/bank-feeds/docs/sdk/models/shared/companies.md +++ b/bank-feeds/docs/sdk/models/shared/companies.md @@ -1,31 +1,23 @@ -# Companies - -## Example Usage - -```typescript -import { Companies } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Companies = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Companies + +## Example Usage + +```typescript +import { Companies } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Companies = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/company.md b/bank-feeds/docs/sdk/models/shared/company.md index d5f016150..bb7503ddc 100644 --- a/bank-feeds/docs/sdk/models/shared/company.md +++ b/bank-feeds/docs/sdk/models/shared/company.md @@ -1,63 +1,61 @@ -# Company - -In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - -Typically each company is one of your customers. - -When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - -## Example Usage - -```typescript -import { Company } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Company = { - id: "0498e921-9b53-4396-a412-4f2f5983b0a2", - name: "string", - redirect: - "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", - lastSync: "2022-01-01T12:00:00.000Z", - created: "2022-01-01T12:00:00.000Z", - createdByUserName: "string", - products: [ - "spend-insights", - "lending", - ], - tags: { - "region": "us", - "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c", - }, - dataConnections: [ - { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `redirect` | *string* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `created` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | -| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | -| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | -| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | +# Company + +In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + +Typically each company is one of your customers. + +When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + +## Example Usage + +```typescript +import { Company } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Company = { + id: "0498e921-9b53-4396-a412-4f2f5983b0a2", + name: "string", + redirect: "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", + lastSync: "2022-01-01T12:00:00.000Z", + created: "2022-01-01T12:00:00.000Z", + createdByUserName: "string", + products: [ + "spend-insights", + "lending", + ], + tags: { + "region": "us", + "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c", + }, + dataConnections: [ + { + id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", + integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", + integrationKey: "dfxm", + sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", + sourceType: "Banking", + platformName: "Basiq", + linkUrl: "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", + status: "Linked", + lastSync: "2022-10-27T10:22:43.6464237Z", + created: "2022-10-27T09:53:29Z", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `redirect` | *string* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | +| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | The parent entity or controlling organization of this company. Null if the company has no parent. | | +| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | | `dataConnections` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyaccesstoken.md b/bank-feeds/docs/sdk/models/shared/companyaccesstoken.md index 118d03696..f3f3a350e 100644 --- a/bank-feeds/docs/sdk/models/shared/companyaccesstoken.md +++ b/bank-feeds/docs/sdk/models/shared/companyaccesstoken.md @@ -1,23 +1,23 @@ -# CompanyAccessToken - -Details of the access token provisioned for a company. - -## Example Usage - -```typescript -import { CompanyAccessToken } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyAccessToken = { - expiresIn: 86400, - accessToken: "string", - tokenType: "Bearer", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `expiresIn` | *number* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | -| `accessToken` | *string* | :heavy_check_mark: | The access token for the company. | | +# CompanyAccessToken + +Details of the access token provisioned for a company. + +## Example Usage + +```typescript +import { CompanyAccessToken } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyAccessToken = { + expiresIn: 86400, + accessToken: "string", + tokenType: "Bearer", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `expiresIn` | *number* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | +| `accessToken` | *string* | :heavy_check_mark: | The access token for the company. | | | `tokenType` | *string* | :heavy_check_mark: | The type of token. | Bearer | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyinformation.md b/bank-feeds/docs/sdk/models/shared/companyinformation.md index be6ec7721..499e277e6 100644 --- a/bank-feeds/docs/sdk/models/shared/companyinformation.md +++ b/bank-feeds/docs/sdk/models/shared/companyinformation.md @@ -1,21 +1,21 @@ -# CompanyInformation - -Information about the company from the underlying accounting software. - -## Example Usage - -```typescript -import { CompanyInformation } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyInformation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | -| `baseCurrency` | *string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. | -| `planType` | *string* | :heavy_minus_sign: | Accounting software subscription type such as Trial, Demo, Standard. | -| `multicurrencyEnabled` | *boolean* | :heavy_minus_sign: | Boolean showing if the organisation has multicurrency enabled. | +# CompanyInformation + +Information about the company from the underlying accounting software. + +## Example Usage + +```typescript +import { CompanyInformation } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyInformation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | +| `baseCurrency` | *string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. | +| `planType` | *string* | :heavy_minus_sign: | Accounting software subscription type such as Trial, Demo, Standard. | +| `multicurrencyEnabled` | *boolean* | :heavy_minus_sign: | Boolean showing if the organisation has multicurrency enabled. | | `currencies` | *string*[] | :heavy_minus_sign: | Array of enabled currencies for the linked company. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyreference.md b/bank-feeds/docs/sdk/models/shared/companyreference.md index 30008f0b1..29f17b406 100644 --- a/bank-feeds/docs/sdk/models/shared/companyreference.md +++ b/bank-feeds/docs/sdk/models/shared/companyreference.md @@ -1,23 +1,23 @@ -# CompanyReference - -## Example Usage - -```typescript -import { CompanyReference } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyReference = { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | -| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +# CompanyReference + +## Example Usage + +```typescript +import { CompanyReference } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyReference = { + id: "8a210b68-6988-11ed-a1eb-0242ac120002", + name: "Codat Ltd.", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyreferencelinks.md b/bank-feeds/docs/sdk/models/shared/companyreferencelinks.md index 3426de5a4..77a69c581 100644 --- a/bank-feeds/docs/sdk/models/shared/companyreferencelinks.md +++ b/bank-feeds/docs/sdk/models/shared/companyreferencelinks.md @@ -1,17 +1,17 @@ -# CompanyReferenceLinks - -A collection of links for the company. - -## Example Usage - -```typescript -import { CompanyReferenceLinks } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyReferenceLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +# CompanyReferenceLinks + +A collection of links for the company. + +## Example Usage + +```typescript +import { CompanyReferenceLinks } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyReferenceLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | | `portal` | *string* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyrequestbody.md b/bank-feeds/docs/sdk/models/shared/companyrequestbody.md index e32e0a267..52abe8c0c 100644 --- a/bank-feeds/docs/sdk/models/shared/companyrequestbody.md +++ b/bank-feeds/docs/sdk/models/shared/companyrequestbody.md @@ -1,20 +1,20 @@ -# CompanyRequestBody - -## Example Usage - -```typescript -import { CompanyRequestBody } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyRequestBody = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | -| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +# CompanyRequestBody + +## Example Usage + +```typescript +import { CompanyRequestBody } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyRequestBody = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/companyupdaterequest.md b/bank-feeds/docs/sdk/models/shared/companyupdaterequest.md index ff85ddcb7..d1c411804 100644 --- a/bank-feeds/docs/sdk/models/shared/companyupdaterequest.md +++ b/bank-feeds/docs/sdk/models/shared/companyupdaterequest.md @@ -1,20 +1,20 @@ -# CompanyUpdateRequest - -## Example Usage - -```typescript -import { CompanyUpdateRequest } from "@codat/bank-feeds/sdk/models/shared"; - -let value: CompanyUpdateRequest = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | -| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +# CompanyUpdateRequest + +## Example Usage + +```typescript +import { CompanyUpdateRequest } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CompanyUpdateRequest = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/connection.md b/bank-feeds/docs/sdk/models/shared/connection.md index 736f40fee..dbf5d5ea9 100644 --- a/bank-feeds/docs/sdk/models/shared/connection.md +++ b/bank-feeds/docs/sdk/models/shared/connection.md @@ -1,49 +1,48 @@ -# Connection - -A connection represents a [company's](https://docs.codat.io/bank-feeds-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - -A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - -- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. -- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. -- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. -Any combination of accounting, banking, and commerce data connections is allowed. - -Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). - -## Example Usage - -```typescript -import { Connection } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Connection = { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | -| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | -| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | -| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | -| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | -| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `created` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | +# Connection + +A connection represents a [company's](https://docs.codat.io/bank-feeds-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + +A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + +- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. +- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. +- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. +Any combination of accounting, banking, and commerce data connections is allowed. + +Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + +## Example Usage + +```typescript +import { Connection } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Connection = { + id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", + integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", + integrationKey: "dfxm", + sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", + sourceType: "Banking", + platformName: "Basiq", + linkUrl: "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", + status: "Linked", + lastSync: "2022-10-27T10:22:43.6464237Z", + created: "2022-10-27T09:53:29Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | +| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | +| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | +| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | | `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/connections.md b/bank-feeds/docs/sdk/models/shared/connections.md index efc10143b..ba0233969 100644 --- a/bank-feeds/docs/sdk/models/shared/connections.md +++ b/bank-feeds/docs/sdk/models/shared/connections.md @@ -1,31 +1,23 @@ -# Connections - -## Example Usage - -```typescript -import { Connections } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Connections = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Connections + +## Example Usage + +```typescript +import { Connections } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Connections = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/createbanktransactions.md b/bank-feeds/docs/sdk/models/shared/createbanktransactions.md index f0acb4741..51fa5a684 100644 --- a/bank-feeds/docs/sdk/models/shared/createbanktransactions.md +++ b/bank-feeds/docs/sdk/models/shared/createbanktransactions.md @@ -1,32 +1,31 @@ -# CreateBankTransactions - -## Example Usage - -```typescript -import { CreateBankTransactions } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: CreateBankTransactions = { - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: - "Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60", - counterparty: "ACME INC", - reference: "reference for transaction", - reconciled: false, - amount: new Decimal("999.99"), - balance: new Decimal("-999.99"), - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `accountId` | *string* | :heavy_check_mark: | Unique identifier for a bank account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ
**Example 5:** Checking 0202 | +# CreateBankTransactions + +## Example Usage + +```typescript +import { CreateBankTransactions } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CreateBankTransactions = { + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60", + counterparty: "ACME INC", + reference: "reference for transaction", + reconciled: false, + amount: 999.99, + balance: -999.99, + transactionType: "string", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | Unique identifier for a bank account. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ
**Example 5:** Checking 0202 | | `transactions` | [shared.BankTransactions](../../../sdk/models/shared/banktransactions.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/createbanktransactionsresponse.md b/bank-feeds/docs/sdk/models/shared/createbanktransactionsresponse.md index 5665fb4e6..c6b8f032a 100644 --- a/bank-feeds/docs/sdk/models/shared/createbanktransactionsresponse.md +++ b/bank-feeds/docs/sdk/models/shared/createbanktransactionsresponse.md @@ -1,61 +1,37 @@ -# CreateBankTransactionsResponse - -## Example Usage - -```typescript -import { CreateBankTransactionsResponse } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: CreateBankTransactionsResponse = { - data: { - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: - "Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60", - counterparty: "ACME INC", - reference: "reference for transaction", - reconciled: false, - amount: new Decimal("999.99"), - balance: new Decimal("-999.99"), - }, - ], - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "29e924a1-3a14-4ee2-958a-e0584b032307", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 478039, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.CreateBankTransactions](../../../sdk/models/shared/createbanktransactions.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# CreateBankTransactionsResponse + +## Example Usage + +```typescript +import { CreateBankTransactionsResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: CreateBankTransactionsResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "2022-10-23T00:00:00Z", + completedOnUtc: "2022-10-23T00:00:00Z", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | [shared.CreateBankTransactions](../../../sdk/models/shared/createbanktransactions.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/dataconnectionerror.md b/bank-feeds/docs/sdk/models/shared/dataconnectionerror.md index ff1941795..79f9f011b 100644 --- a/bank-feeds/docs/sdk/models/shared/dataconnectionerror.md +++ b/bank-feeds/docs/sdk/models/shared/dataconnectionerror.md @@ -1,23 +1,23 @@ -# DataConnectionError - -## Example Usage - -```typescript -import { DataConnectionError } from "@codat/bank-feeds/sdk/models/shared"; - -let value: DataConnectionError = { - erroredOnUtc: "2022-10-23T00:00:00Z", - resolvedOnUtc: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | -| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | -| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +# DataConnectionError + +## Example Usage + +```typescript +import { DataConnectionError } from "@codat/bank-feeds/sdk/models/shared"; + +let value: DataConnectionError = { + erroredOnUtc: "2022-10-23T00:00:00Z", + resolvedOnUtc: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | +| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | | `resolvedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/dataconnectionstatus.md b/bank-feeds/docs/sdk/models/shared/dataconnectionstatus.md index e2d34ba7c..c0504a3a5 100644 --- a/bank-feeds/docs/sdk/models/shared/dataconnectionstatus.md +++ b/bank-feeds/docs/sdk/models/shared/dataconnectionstatus.md @@ -1,17 +1,17 @@ -# DataConnectionStatus - -The current authorization status of the data connection. - -## Example Usage - -```typescript -import { DataConnectionStatus } from "@codat/bank-feeds/sdk/models/shared"; - -let value: DataConnectionStatus = "Deauthorized"; -``` - -## Values - -```typescript -"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" +# DataConnectionStatus + +The current authorization status of the data connection. + +## Example Usage + +```typescript +import { DataConnectionStatus } from "@codat/bank-feeds/sdk/models/shared"; + +let value: DataConnectionStatus = "PendingAuth"; +``` + +## Values + +```typescript +"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/datatype.md b/bank-feeds/docs/sdk/models/shared/datatype.md index 0eea15b2d..af6699e5f 100644 --- a/bank-feeds/docs/sdk/models/shared/datatype.md +++ b/bank-feeds/docs/sdk/models/shared/datatype.md @@ -1,17 +1,17 @@ -# DataType - -Available data types - -## Example Usage - -```typescript -import { DataType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: DataType = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# DataType + +Available data types + +## Example Usage + +```typescript +import { DataType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: DataType = "accountTransactions"; +``` + +## Values + +```typescript +"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/errorstatus.md b/bank-feeds/docs/sdk/models/shared/errorstatus.md index cd6944da5..0071ab743 100644 --- a/bank-feeds/docs/sdk/models/shared/errorstatus.md +++ b/bank-feeds/docs/sdk/models/shared/errorstatus.md @@ -1,17 +1,17 @@ -# ErrorStatus - -The current status of a transient error. Null statuses indicate that the error is not transient. - -## Example Usage - -```typescript -import { ErrorStatus } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ErrorStatus = "Resolved"; -``` - -## Values - -```typescript -"Active" | "Resolved" +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + +## Example Usage + +```typescript +import { ErrorStatus } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ErrorStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/errorvalidation.md b/bank-feeds/docs/sdk/models/shared/errorvalidation.md index 78bd62404..491d7255f 100644 --- a/bank-feeds/docs/sdk/models/shared/errorvalidation.md +++ b/bank-feeds/docs/sdk/models/shared/errorvalidation.md @@ -1,18 +1,18 @@ -# ErrorValidation - -A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { ErrorValidation } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ErrorValidation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | +# ErrorValidation + +A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { ErrorValidation } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ErrorValidation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/errorvalidationitem.md b/bank-feeds/docs/sdk/models/shared/errorvalidationitem.md index 412e056fc..a5c7bdead 100644 --- a/bank-feeds/docs/sdk/models/shared/errorvalidationitem.md +++ b/bank-feeds/docs/sdk/models/shared/errorvalidationitem.md @@ -1,17 +1,17 @@ -# ErrorValidationItem - -## Example Usage - -```typescript -import { ErrorValidationItem } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ErrorValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ErrorValidationItem + +## Example Usage + +```typescript +import { ErrorValidationItem } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ErrorValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/generateotpresponse.md b/bank-feeds/docs/sdk/models/shared/generateotpresponse.md index f2fa1c91f..ec44657fc 100644 --- a/bank-feeds/docs/sdk/models/shared/generateotpresponse.md +++ b/bank-feeds/docs/sdk/models/shared/generateotpresponse.md @@ -1,21 +1,21 @@ -# GenerateOtpResponse - -Response containing a one-time password and its expiry time. - -## Example Usage - -```typescript -import { GenerateOtpResponse } from "@codat/bank-feeds/sdk/models/shared"; - -let value: GenerateOtpResponse = { - otp: "GT40U4", - expiry: "2026-04-08T10:30:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `otp` | *string* | :heavy_check_mark: | The one-time password. | | +# GenerateOtpResponse + +Response containing a one-time password and its expiry time. + +## Example Usage + +```typescript +import { GenerateOtpResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: GenerateOtpResponse = { + otp: "GT40U4", + expiry: "2026-04-08T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `otp` | *string* | :heavy_check_mark: | The one-time password. | | | `expiry` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/halref.md b/bank-feeds/docs/sdk/models/shared/halref.md index 4973e8957..856d2ef13 100644 --- a/bank-feeds/docs/sdk/models/shared/halref.md +++ b/bank-feeds/docs/sdk/models/shared/halref.md @@ -1,15 +1,15 @@ -# HalRef - -## Example Usage - -```typescript -import { HalRef } from "@codat/bank-feeds/sdk/models/shared"; - -let value: HalRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +# HalRef + +## Example Usage + +```typescript +import { HalRef } from "@codat/bank-feeds/sdk/models/shared"; + +let value: HalRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | | `href` | *string* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/links.md b/bank-feeds/docs/sdk/models/shared/links.md index 888c08008..4c661022a 100644 --- a/bank-feeds/docs/sdk/models/shared/links.md +++ b/bank-feeds/docs/sdk/models/shared/links.md @@ -1,25 +1,18 @@ -# Links - -## Example Usage - -```typescript -import { Links } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Links = { - self: { - href: "/companies", - }, - current: { - href: "/companies?page=1&pageSize=10", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | +# Links + +## Example Usage + +```typescript +import { Links } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Links = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | | `previous` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/metadata.md b/bank-feeds/docs/sdk/models/shared/metadata.md index 86dcfd950..dddf82d9f 100644 --- a/bank-feeds/docs/sdk/models/shared/metadata.md +++ b/bank-feeds/docs/sdk/models/shared/metadata.md @@ -1,15 +1,15 @@ -# Metadata - -## Example Usage - -```typescript -import { Metadata } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Metadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +# Metadata + +## Example Usage + +```typescript +import { Metadata } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Metadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `isDeleted` | *boolean* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushchangetype.md b/bank-feeds/docs/sdk/models/shared/pushchangetype.md index 4552fc17d..b1e5678e9 100644 --- a/bank-feeds/docs/sdk/models/shared/pushchangetype.md +++ b/bank-feeds/docs/sdk/models/shared/pushchangetype.md @@ -1,17 +1,17 @@ -# PushChangeType - -Type of change being applied to record in third party platform. - -## Example Usage - -```typescript -import { PushChangeType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushChangeType = "Created"; -``` - -## Values - -```typescript -"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" +# PushChangeType + +Type of change being applied to record in third party platform. + +## Example Usage + +```typescript +import { PushChangeType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushChangeType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushfieldvalidation.md b/bank-feeds/docs/sdk/models/shared/pushfieldvalidation.md index 3fd84a29f..71b47e26b 100644 --- a/bank-feeds/docs/sdk/models/shared/pushfieldvalidation.md +++ b/bank-feeds/docs/sdk/models/shared/pushfieldvalidation.md @@ -1,19 +1,19 @@ -# PushFieldValidation - -## Example Usage - -```typescript -import { PushFieldValidation } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushFieldValidation = { - details: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | -| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | +# PushFieldValidation + +## Example Usage + +```typescript +import { PushFieldValidation } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushFieldValidation = { + details: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | | `ref` | *string* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoperation.md b/bank-feeds/docs/sdk/models/shared/pushoperation.md index aa0794303..92b76e240 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoperation.md +++ b/bank-feeds/docs/sdk/models/shared/pushoperation.md @@ -1,37 +1,36 @@ -# PushOperation - -## Example Usage - -```typescript -import { PushOperation } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOperation = { - changes: null, - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "9c39f707-db6c-421b-b270-d82fde811810", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 143409, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +# PushOperation + +## Example Usage + +```typescript +import { PushOperation } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOperation = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "2022-10-23T00:00:00Z", + completedOnUtc: "2022-10-23T00:00:00Z", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `completedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | | `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoperationchange.md b/bank-feeds/docs/sdk/models/shared/pushoperationchange.md index f6e4fb113..f8cebe48a 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoperationchange.md +++ b/bank-feeds/docs/sdk/models/shared/pushoperationchange.md @@ -1,21 +1,17 @@ -# PushOperationChange - -## Example Usage - -```typescript -import { PushOperationChange } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOperationChange = { - recordRef: { - dataType: "invoices", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | -| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +# PushOperationChange + +## Example Usage + +```typescript +import { PushOperationChange } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOperationChange = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | N/A | +| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | | `attachmentId` | *string* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoperationref.md b/bank-feeds/docs/sdk/models/shared/pushoperationref.md index d2e2d036e..d16291415 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoperationref.md +++ b/bank-feeds/docs/sdk/models/shared/pushoperationref.md @@ -1,18 +1,16 @@ -# PushOperationRef - -## Example Usage - -```typescript -import { PushOperationRef } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOperationRef = { - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file +# PushOperationRef + +## Example Usage + +```typescript +import { PushOperationRef } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOperationRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoperations.md b/bank-feeds/docs/sdk/models/shared/pushoperations.md index 61dd9da1d..5a6013047 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoperations.md +++ b/bank-feeds/docs/sdk/models/shared/pushoperations.md @@ -1,31 +1,23 @@ -# PushOperations - -## Example Usage - -```typescript -import { PushOperations } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOperations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# PushOperations + +## Example Usage + +```typescript +import { PushOperations } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOperations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoperationstatus.md b/bank-feeds/docs/sdk/models/shared/pushoperationstatus.md index f38df5749..db5743383 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoperationstatus.md +++ b/bank-feeds/docs/sdk/models/shared/pushoperationstatus.md @@ -1,17 +1,17 @@ -# PushOperationStatus - -The current status of the push operation. - -## Example Usage - -```typescript -import { PushOperationStatus } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOperationStatus = "Failed"; -``` - -## Values - -```typescript -"Pending" | "Failed" | "Success" | "TimedOut" +# PushOperationStatus + +The current status of the push operation. + +## Example Usage + +```typescript +import { PushOperationStatus } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOperationStatus = "Pending"; +``` + +## Values + +```typescript +"Pending" | "Failed" | "Success" | "TimedOut" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoption.md b/bank-feeds/docs/sdk/models/shared/pushoption.md index 07cf6ff14..60043ac4f 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoption.md +++ b/bank-feeds/docs/sdk/models/shared/pushoption.md @@ -1,25 +1,25 @@ -# PushOption - -## Example Usage - -```typescript -import { PushOption } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOption = { - type: "MultiPart", - displayName: "Travis.Ebert-Fahey", - required: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOption + +## Example Usage + +```typescript +import { PushOption } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOption = { + type: "string", + displayName: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoptionchoice.md b/bank-feeds/docs/sdk/models/shared/pushoptionchoice.md index fee33ca7c..d008e96ee 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoptionchoice.md +++ b/bank-feeds/docs/sdk/models/shared/pushoptionchoice.md @@ -1,19 +1,19 @@ -# PushOptionChoice - -## Example Usage - -```typescript -import { PushOptionChoice } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOptionChoice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | -| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | +# PushOptionChoice + +## Example Usage + +```typescript +import { PushOptionChoice } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOptionChoice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | +| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | | `required` | *boolean* | :heavy_minus_sign: | The property is required if `True`. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoptionproperty.md b/bank-feeds/docs/sdk/models/shared/pushoptionproperty.md index 6c385187a..5e0fdc7eb 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoptionproperty.md +++ b/bank-feeds/docs/sdk/models/shared/pushoptionproperty.md @@ -1,27 +1,26 @@ -# PushOptionProperty - -## Example Usage - -```typescript -import { PushOptionProperty } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOptionProperty = { - type: "Array", - displayName: "Fannie10", - description: - "sonar very sympathetically notwithstanding alarmed modulo grizzled", - required: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_check_mark: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOptionProperty + +## Example Usage + +```typescript +import { PushOptionProperty } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOptionProperty = { + type: "string", + displayName: "string", + description: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_check_mark: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushoptiontype.md b/bank-feeds/docs/sdk/models/shared/pushoptiontype.md index 4a7ded0f9..f15252a5c 100644 --- a/bank-feeds/docs/sdk/models/shared/pushoptiontype.md +++ b/bank-feeds/docs/sdk/models/shared/pushoptiontype.md @@ -1,17 +1,17 @@ -# PushOptionType - -The option type. - -## Example Usage - -```typescript -import { PushOptionType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushOptionType = "DateTime"; -``` - -## Values - -```typescript -"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" +# PushOptionType + +The option type. + +## Example Usage + +```typescript +import { PushOptionType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushOptionType = "Array"; +``` + +## Values + +```typescript +"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/pushvalidationinfo.md b/bank-feeds/docs/sdk/models/shared/pushvalidationinfo.md index f607f4134..e87606270 100644 --- a/bank-feeds/docs/sdk/models/shared/pushvalidationinfo.md +++ b/bank-feeds/docs/sdk/models/shared/pushvalidationinfo.md @@ -1,16 +1,16 @@ -# PushValidationInfo - -## Example Usage - -```typescript -import { PushValidationInfo } from "@codat/bank-feeds/sdk/models/shared"; - -let value: PushValidationInfo = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | +# PushValidationInfo + +## Example Usage + +```typescript +import { PushValidationInfo } from "@codat/bank-feeds/sdk/models/shared"; + +let value: PushValidationInfo = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | | `information` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/result.md b/bank-feeds/docs/sdk/models/shared/result.md index 10e9aba1b..cb4fab707 100644 --- a/bank-feeds/docs/sdk/models/shared/result.md +++ b/bank-feeds/docs/sdk/models/shared/result.md @@ -1,19 +1,16 @@ -# Result - -## Example Usage - -```typescript -import { Result } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Result = { - statusCode: "409", - error: "A bank account already exists with the same Id", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `statusCode` | *string* | :heavy_minus_sign: | The error status code for the attempted creation of the source account. | 409 | -| `error` | *string* | :heavy_minus_sign: | The error description for the attempted creation of the source account. | A bank account already exists with the same Id | \ No newline at end of file +# Result + +## Example Usage + +```typescript +import { Result } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Result = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *string* | :heavy_minus_sign: | The error status code for the attempted creation of the source account. | +| `error` | *string* | :heavy_minus_sign: | The error description for the attempted creation of the source account. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/routinginfo.md b/bank-feeds/docs/sdk/models/shared/routinginfo.md index e5adefe6a..2a62c26a9 100644 --- a/bank-feeds/docs/sdk/models/shared/routinginfo.md +++ b/bank-feeds/docs/sdk/models/shared/routinginfo.md @@ -1,18 +1,18 @@ -# RoutingInfo - -Routing information for the bank. This does not include account number. - -## Example Usage - -```typescript -import { RoutingInfo } from "@codat/bank-feeds/sdk/models/shared"; - -let value: RoutingInfo = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `bankCode` | *string* | :heavy_minus_sign: | The numeric identifier of the routing number | +# RoutingInfo + +Routing information for the bank. This does not include account number. + +## Example Usage + +```typescript +import { RoutingInfo } from "@codat/bank-feeds/sdk/models/shared"; + +let value: RoutingInfo = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `bankCode` | *string* | :heavy_minus_sign: | The numeric identifier of the routing number | | `type` | [shared.Type](../../../sdk/models/shared/type.md) | :heavy_minus_sign: | The type of routing number. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/security.md b/bank-feeds/docs/sdk/models/shared/security.md index 4d603b133..ad360963d 100644 --- a/bank-feeds/docs/sdk/models/shared/security.md +++ b/bank-feeds/docs/sdk/models/shared/security.md @@ -1,17 +1,15 @@ -# Security - -## Example Usage - -```typescript -import { Security } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Security = { - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `authHeader` | *string* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file +# Security + +## Example Usage + +```typescript +import { Security } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Security = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `authHeader` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccount.md b/bank-feeds/docs/sdk/models/shared/sourceaccount.md index 269deb6a9..3fe4b2c58 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccount.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccount.md @@ -1,37 +1,36 @@ -# SourceAccount - -The target bank account in a supported accounting software for ingestion into a bank feed. - -## Example Usage - -```typescript -import { SourceAccount } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccount = { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | -| `accountName` | *string* | :heavy_minus_sign: | The bank account name. | | -| `accountType` | *string* | :heavy_minus_sign: | The type of bank account e.g. Credit. | | -| `accountNumber` | *string* | :heavy_minus_sign: | The account number. | | -| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | The latest balance for the bank account. | | -| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.SourceAccountStatus](../../../sdk/models/shared/sourceaccountstatus.md) | :heavy_minus_sign: | Status of the source account. | | +# SourceAccount + +The target bank account in a supported accounting software for ingestion into a bank feed. + +## Example Usage + +```typescript +import { SourceAccount } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccount = { + id: "acc-002", + accountName: "account-081", + accountType: "Credit", + accountNumber: "12345670", + sortCode: "123456", + currency: "GBP", + balance: 99.99, + modifiedDate: "2023-01-09T14:14:14.1057478Z", + status: "pending", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | +| `accountName` | *string* | :heavy_minus_sign: | The bank account name. | | +| `accountType` | *string* | :heavy_minus_sign: | The type of bank account e.g. Credit. | | +| `accountNumber` | *string* | :heavy_minus_sign: | The account number. | | +| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `balance` | *Decimal | number* | :heavy_minus_sign: | The latest balance for the bank account. | | +| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `status` | [shared.SourceAccountStatus](../../../sdk/models/shared/sourceaccountstatus.md) | :heavy_minus_sign: | Status of the source account. | | | `feedStartDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresponse.md b/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresponse.md index 688086a48..e316acbb5 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresponse.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresponse.md @@ -1,34 +1,20 @@ -# SourceAccountBatchCreateResponse - -Account ID and resulting object of the batch `Create source account` request. - -## Example Usage - -```typescript -import { SourceAccountBatchCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountBatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | +# SourceAccountBatchCreateResponse + +Account ID and resulting object of the batch `Create source account` request. + +## Example Usage + +```typescript +import { SourceAccountBatchCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountBatchCreateResponse = { + sourceAccountId: "12345", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | | `result` | [shared.SourceAccountBatchCreateResult](../../../sdk/models/shared/sourceaccountbatchcreateresult.md) | :heavy_minus_sign: | Status details and corresponding object of the `Create account` operation. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresult.md b/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresult.md index 706136b80..2fed65f74 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresult.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountbatchcreateresult.md @@ -1,32 +1,31 @@ -# SourceAccountBatchCreateResult - -Status details and corresponding object of the `Create account` operation. - -## Example Usage - -```typescript -import { SourceAccountBatchCreateResult } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountBatchCreateResult = { - account: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code for the creation of the source account | | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | | -| `account` | [shared.SourceAccount](../../../sdk/models/shared/sourceaccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | **Example 1:** {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
}
**Example 2:** {
"id": "acc-003",
"accountName": "account-095",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345671",
"currency": "USD",
"balance": 0,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | \ No newline at end of file +# SourceAccountBatchCreateResult + +Status details and corresponding object of the `Create account` operation. + +## Example Usage + +```typescript +import { SourceAccountBatchCreateResult } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountBatchCreateResult = { + account: { + id: "acc-002", + accountName: "account-081", + accountType: "Credit", + accountNumber: "12345670", + sortCode: "123456", + currency: "GBP", + balance: 99.99, + modifiedDate: "2023-01-09T14:14:14.1057478Z", + status: "pending", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code for the creation of the source account | | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | | +| `account` | [shared.SourceAccount](../../../sdk/models/shared/sourceaccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | **Example 1:** {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
}
**Example 2:** {
"id": "acc-003",
"accountName": "account-095",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345671",
"currency": "USD",
"balance": 0,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountbatcherrorresponse.md b/bank-feeds/docs/sdk/models/shared/sourceaccountbatcherrorresponse.md index 3dbbd4932..e7ce7ade3 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountbatcherrorresponse.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountbatcherrorresponse.md @@ -1,24 +1,20 @@ -# SourceAccountBatchErrorResponse - -Describes the error that occured when trying to create the specified source account. - -## Example Usage - -```typescript -import { SourceAccountBatchErrorResponse } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SourceAccountBatchErrorResponse = { - sourceAccountId: "12345", - result: { - statusCode: "409", - error: "A bank account already exists with the same Id", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | +# SourceAccountBatchErrorResponse + +Describes the error that occured when trying to create the specified source account. + +## Example Usage + +```typescript +import { SourceAccountBatchErrorResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountBatchErrorResponse = { + sourceAccountId: "12345", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | | `result` | [shared.Result](../../../sdk/models/shared/result.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountprototype.md b/bank-feeds/docs/sdk/models/shared/sourceaccountprototype.md index 20c6eb998..c9af321a2 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountprototype.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountprototype.md @@ -1,26 +1,22 @@ -# SourceAccountPrototype - -## Example Usage - -```typescript -import { SourceAccountPrototype } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SourceAccountPrototype = { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | -| `accountName` | *string* | :heavy_minus_sign: | The bank account name. | | -| `accountType` | *string* | :heavy_minus_sign: | The type of bank account e.g. Credit. | | -| `accountNumber` | *string* | :heavy_minus_sign: | The account number. | | -| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | The latest balance for the bank account. | | -| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# SourceAccountPrototype + +## Example Usage + +```typescript +import { SourceAccountPrototype } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountPrototype = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | +| `accountName` | *string* | :heavy_minus_sign: | The bank account name. | +| `accountType` | *string* | :heavy_minus_sign: | The type of bank account e.g. Credit. | +| `accountNumber` | *string* | :heavy_minus_sign: | The account number. | +| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | The latest balance for the bank account. | +| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountstatus.md b/bank-feeds/docs/sdk/models/shared/sourceaccountstatus.md index bcf75530b..fc2fe0d96 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountstatus.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountstatus.md @@ -1,17 +1,15 @@ -# SourceAccountStatus - -Status of the source account. - -## Example Usage - -```typescript -import { SourceAccountStatus } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SourceAccountStatus = "pending"; -``` - -## Values - -```typescript -"pending" | "connected" | "connecting" | "disconnected" | "unknown" +# SourceAccountStatus + +## Example Usage + +```typescript +import { SourceAccountStatus } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountv2.md b/bank-feeds/docs/sdk/models/shared/sourceaccountv2.md index 011893577..9edb92a92 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountv2.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountv2.md @@ -1,48 +1,48 @@ -# SourceAccountV2 - -The target bank account in a supported accounting software for ingestion into a bank feed. - -## Example Usage - -```typescript -import { SourceAccountV2 } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountV2 = { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | -| `accountName` | *string* | :heavy_check_mark: | The bank account name. | | -| `accountType` | [shared.SourceAccountV2AccountType](../../../sdk/models/shared/sourceaccountv2accounttype.md) | :heavy_check_mark: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | -| `accountNumber` | *string* | :heavy_check_mark: | The account number. | | -| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | -| `routingInfo` | [shared.RoutingInfo](../../../sdk/models/shared/routinginfo.md) | :heavy_minus_sign: | Routing information for the bank. This does not include account number. | | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_check_mark: | The latest balance for the bank account. | | -| `accountInfo` | [shared.AccountInfo](../../../sdk/models/shared/accountinfo.md) | :heavy_minus_sign: | N/A | | -| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_minus_sign: | Status of the source account. | | +# SourceAccountV2 + +The target bank account in a supported accounting software for ingestion into a bank feed. + +## Example Usage + +```typescript +import { SourceAccountV2 } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountV2 = { + id: "acc-001", + accountName: "account-081", + accountType: "checking", + accountNumber: "12345670", + routingInfo: { + bankCode: "021001088", + type: "bankcode", + }, + currency: "GBP", + balance: 99.99, + accountInfo: { + description: "account description 1", + nickname: "account 123", + accountOpenDate: "2023-05-06", + availableBalance: 10, + }, + modifiedDate: "2024-08-02T00:00:00.000Z", + status: "pending", + feedStartDate: "2024-05-01", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | +| `accountName` | *string* | :heavy_check_mark: | The bank account name. | | +| `accountType` | [shared.SourceAccountV2AccountType](../../../sdk/models/shared/sourceaccountv2accounttype.md) | :heavy_check_mark: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | +| `accountNumber` | *string* | :heavy_check_mark: | The account number. | | +| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | +| `routingInfo` | [shared.RoutingInfo](../../../sdk/models/shared/routinginfo.md) | :heavy_minus_sign: | Routing information for the bank. This does not include account number. | | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `balance` | *Decimal | number* | :heavy_check_mark: | The latest balance for the bank account. | | +| `accountInfo` | [shared.AccountInfo](../../../sdk/models/shared/accountinfo.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `status` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_minus_sign: | Status of the source account. | | | `feedStartDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example:
```
2020-10-08
``` | 2022-10-23 | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountv2accounttype.md b/bank-feeds/docs/sdk/models/shared/sourceaccountv2accounttype.md index 52ec0b0f0..ed343a826 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountv2accounttype.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountv2accounttype.md @@ -1,17 +1,15 @@ -# SourceAccountV2AccountType - -The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - -## Example Usage - -```typescript -import { SourceAccountV2AccountType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SourceAccountV2AccountType = "loan"; -``` - -## Values - -```typescript -"checking" | "savings" | "loan" | "creditCard" | "prepaidCard" +# SourceAccountV2AccountType + +## Example Usage + +```typescript +import { SourceAccountV2AccountType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountV2AccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md b/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md index 4edffb1ca..526170e11 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresponse.md @@ -1,43 +1,20 @@ -# SourceAccountV2BatchCreateResponse - -Account ID and resulting object of the batch `Create source account` request. - -## Example Usage - -```typescript -import { SourceAccountV2BatchCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountV2BatchCreateResponse = { - sourceAccountId: "12345", - result: { - account: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | +# SourceAccountV2BatchCreateResponse + +Account ID and resulting object of the batch `Create source account` request. + +## Example Usage + +```typescript +import { SourceAccountV2BatchCreateResponse } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountV2BatchCreateResponse = { + sourceAccountId: "12345", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `sourceAccountId` | *string* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | | `result` | [shared.SourceAccountV2BatchCreateResult](../../../sdk/models/shared/sourceaccountv2batchcreateresult.md) | :heavy_minus_sign: | Status details and corresponding object of the `Create account` operation. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresult.md b/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresult.md index 3b780231f..5d2da2ec5 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresult.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountv2batchcreateresult.md @@ -1,41 +1,41 @@ -# SourceAccountV2BatchCreateResult - -Status details and corresponding object of the `Create account` operation. - -## Example Usage - -```typescript -import { SourceAccountV2BatchCreateResult } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountV2BatchCreateResult = { - account: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code for the creation of the source account | | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | | -| `account` | [shared.SourceAccountV2](../../../sdk/models/shared/sourceaccountv2.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | **Example 1:** {
"id": "acc-001",
"accountName": "account-081",
"accountType": "checking",
"accountNumber": "12345670",
"routingInfo": {
"bankCode": 21001088,
"type": "bankcode"
},
"currency": "GBP",
"balance": 99.99,
"accountInfo": {
"description": "account description 1",
"nickname": "account 123",
"accountOpenDate": "2023-05-06",
"availableBalance": 10
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01"
}
**Example 2:** {
"id": "acc-002",
"accountName": "account-083",
"accountType": "savings",
"accountNumber": "23456789",
"routingInfo": {
"bankCode": 21001088,
"type": "bankcode"
},
"currency": "GBP",
"balance": 400,
"accountInfo": {
"description": "account description 2",
"nickname": "account 1290",
"accountOpenDate": "2023-05-23",
"availableBalance": 400
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01"
} | \ No newline at end of file +# SourceAccountV2BatchCreateResult + +Status details and corresponding object of the `Create account` operation. + +## Example Usage + +```typescript +import { SourceAccountV2BatchCreateResult } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountV2BatchCreateResult = { + account: { + id: "acc-001", + accountName: "account-081", + accountType: "checking", + accountNumber: "12345670", + routingInfo: { + bankCode: "021001088", + type: "bankcode", + }, + currency: "GBP", + balance: 99.99, + accountInfo: { + description: "account description 1", + nickname: "account 123", + accountOpenDate: "2023-05-06", + availableBalance: 10, + }, + modifiedDate: "2024-08-02T00:00:00.000Z", + status: "pending", + feedStartDate: "2024-05-01", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code for the creation of the source account | | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | | +| `account` | [shared.SourceAccountV2](../../../sdk/models/shared/sourceaccountv2.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | **Example 1:** {
"id": "acc-001",
"accountName": "account-081",
"accountType": "checking",
"accountNumber": "12345670",
"routingInfo": {
"bankCode": "021001088",
"type": "bankcode"
},
"currency": "GBP",
"balance": 99.99,
"accountInfo": {
"description": "account description 1",
"nickname": "account 123",
"accountOpenDate": "2023-05-06",
"availableBalance": 10
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01"
}
**Example 2:** {
"id": "acc-002",
"accountName": "account-083",
"accountType": "savings",
"accountNumber": "23456789",
"routingInfo": {
"bankCode": "021001088",
"type": "bankcode"
},
"currency": "GBP",
"balance": 400,
"accountInfo": {
"description": "account description 2",
"nickname": "account 1290",
"accountOpenDate": "2023-05-23",
"availableBalance": 400
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01"
} | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountv2prototype.md b/bank-feeds/docs/sdk/models/shared/sourceaccountv2prototype.md index 13d5b3510..e73d0fe81 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountv2prototype.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountv2prototype.md @@ -1,34 +1,24 @@ -# SourceAccountV2Prototype - -## Example Usage - -```typescript -import { SourceAccountV2Prototype } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountV2Prototype = { - id: "", - accountName: "", - accountType: "checking", - accountNumber: "", - currency: "GBP", - balance: new Decimal("9826.32"), - modifiedDate: "2022-10-23T00:00:00Z", - accountInfo: null, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | | -| `accountName` | *string* | :heavy_check_mark: | The bank account name. | | -| `accountType` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_check_mark: | The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. | | -| `accountNumber` | *string* | :heavy_check_mark: | The account number. | | -| `routingInfo` | [shared.RoutingInfo](../../../sdk/models/shared/routinginfo.md) | :heavy_minus_sign: | Routing information for the bank. This does not include account number. | | -| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_check_mark: | The latest balance for the bank account. | | -| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `accountInfo` | [shared.AccountInfo](../../../sdk/models/shared/accountinfo.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# SourceAccountV2Prototype + +## Example Usage + +```typescript +import { SourceAccountV2Prototype } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountV2Prototype = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique ID for the bank account. | +| `accountName` | *string* | :heavy_check_mark: | The bank account name. | +| `accountType` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_check_mark: | The type of bank account e.g. Credit. | +| `accountNumber` | *string* | :heavy_check_mark: | The account number. | +| `routingInfo` | [shared.RoutingInfo](../../../sdk/models/shared/routinginfo.md) | :heavy_minus_sign: | N/A | +| `sortCode` | *string* | :heavy_minus_sign: | The sort code. | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | +| `balance` | *Decimal | number* | :heavy_check_mark: | The latest balance for the bank account. | +| `modifiedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | +| `accountInfo` | [shared.AccountInfo](../../../sdk/models/shared/accountinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhook.md b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhook.md index 6dfa7bb6c..62893c4d1 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhook.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhook.md @@ -1,53 +1,22 @@ -# SourceAccountWebhook - -## Example Usage - -```typescript -import { SourceAccountWebhook } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountWebhook = { - id: "ba29118f-5406-4e59-b05c-ba307ca38d01", - eventType: "bankFeeds.sourceAccount.connected", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccount: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - type: "bankcode", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** bankFeeds.sourceAccount.connected
**Example 2:** bankFeeds.sourceAccount.disconnected | -| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +# SourceAccountWebhook + +## Example Usage + +```typescript +import { SourceAccountWebhook } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountWebhook = { + id: "ba29118f-5406-4e59-b05c-ba307ca38d01", + eventType: "bankFeeds.sourceAccount.connected", + generatedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** bankFeeds.sourceAccount.connected
**Example 2:** bankFeeds.sourceAccount.disconnected | +| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `payload` | [shared.SourceAccountWebhookPayload](../../../sdk/models/shared/sourceaccountwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayload.md b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayload.md index 7d15c55e5..d0c9a229f 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayload.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayload.md @@ -1,48 +1,18 @@ -# SourceAccountWebhookPayload - -## Example Usage - -```typescript -import { SourceAccountWebhookPayload } from "@codat/bank-feeds/sdk/models/shared"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -let value: SourceAccountWebhookPayload = { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccount: { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - type: "bankcode", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `sourceAccount` | *shared.SourceAccountWebhookPayloadSourceAccount* | :heavy_minus_sign: | N/A | | \ No newline at end of file +# SourceAccountWebhookPayload + +## Example Usage + +```typescript +import { SourceAccountWebhookPayload } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceAccountWebhookPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | +| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | +| `connectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | +| `sourceAccount` | *SourceAccountV2 | SourceAccount* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md index a89d11396..1ee54f323 100644 --- a/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md +++ b/bank-feeds/docs/sdk/models/shared/sourceaccountwebhookpayloadsourceaccount.md @@ -1,46 +1,14 @@ -# SourceAccountWebhookPayloadSourceAccount - - -## Supported Types - -### `shared.SourceAccountV2` - -```typescript -const value: shared.SourceAccountV2 = { - id: "acc-001", - accountName: "account-081", - accountType: "checking", - accountNumber: "12345670", - routingInfo: { - bankCode: "21001088", - }, - currency: "GBP", - balance: new Decimal("99.99"), - accountInfo: { - description: "account description 1", - nickname: "account 123", - accountOpenDate: "2023-05-06", - availableBalance: new Decimal("10"), - }, - modifiedDate: "2024-08-02T00:00:00.000Z", - status: "pending", - feedStartDate: "2024-05-01", -}; -``` - -### `shared.SourceAccount` - -```typescript -const value: shared.SourceAccount = { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", -}; -``` - +# + +## Example Usage + +```typescript +import { } from "@codat/bank-feeds/sdk/models/shared"; + +let value: = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/sourcetype.md b/bank-feeds/docs/sdk/models/shared/sourcetype.md index 2b2a5e0da..1493136be 100644 --- a/bank-feeds/docs/sdk/models/shared/sourcetype.md +++ b/bank-feeds/docs/sdk/models/shared/sourcetype.md @@ -1,17 +1,17 @@ -# SourceType - -The type of platform of the connection. - -## Example Usage - -```typescript -import { SourceType } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SourceType = "Accounting"; -``` - -## Values - -```typescript -"Accounting" | "Banking" | "BankFeed" | "Commerce" | "Expense" | "Other" | "Unknown" +# SourceType + +The type of platform of the connection. + +## Example Usage + +```typescript +import { SourceType } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SourceType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/startscheduledsyncresult.md b/bank-feeds/docs/sdk/models/shared/startscheduledsyncresult.md index d3d6ae40d..f1b36118e 100644 --- a/bank-feeds/docs/sdk/models/shared/startscheduledsyncresult.md +++ b/bank-feeds/docs/sdk/models/shared/startscheduledsyncresult.md @@ -1,19 +1,19 @@ -# StartScheduledSyncResult - -Represents the result of an ad-hoc sync request. - -## Example Usage - -```typescript -import { StartScheduledSyncResult } from "@codat/bank-feeds/sdk/models/shared"; - -let value: StartScheduledSyncResult = { - syncId: "d1441ebb-900c-458f-906f-e691e76f9408", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +# StartScheduledSyncResult + +Represents the result of an ad-hoc sync request. + +## Example Usage + +```typescript +import { StartScheduledSyncResult } from "@codat/bank-feeds/sdk/models/shared"; + +let value: StartScheduledSyncResult = { + syncId: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | | `syncId` | *string* | :heavy_check_mark: | The unique identifier for the created sync. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/status.md b/bank-feeds/docs/sdk/models/shared/status.md index 38d0d662b..772caa7c5 100644 --- a/bank-feeds/docs/sdk/models/shared/status.md +++ b/bank-feeds/docs/sdk/models/shared/status.md @@ -1,17 +1,15 @@ -# Status - -Status of the source account. - -## Example Usage - -```typescript -import { Status } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Status = "disconnected"; -``` - -## Values - -```typescript -"pending" | "connected" | "connecting" | "disconnected" | "unknown" +# Status + +## Example Usage + +```typescript +import { Status } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Status = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/supplementaldata.md b/bank-feeds/docs/sdk/models/shared/supplementaldata.md index ba5bab80a..a2a26fbc3 100644 --- a/bank-feeds/docs/sdk/models/shared/supplementaldata.md +++ b/bank-feeds/docs/sdk/models/shared/supplementaldata.md @@ -1,19 +1,19 @@ -# SupplementalData - -Supplemental data is additional data you can include in our standard data types. - -It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - -## Example Usage - -```typescript -import { SupplementalData } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SupplementalData = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +# SupplementalData + +Supplemental data is additional data you can include in our standard data types. + +It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + +## Example Usage + +```typescript +import { SupplementalData } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SupplementalData = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | | `content` | Record> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/syncstatusresult.md b/bank-feeds/docs/sdk/models/shared/syncstatusresult.md index cc1737090..6781597a3 100644 --- a/bank-feeds/docs/sdk/models/shared/syncstatusresult.md +++ b/bank-feeds/docs/sdk/models/shared/syncstatusresult.md @@ -1,41 +1,41 @@ -# SyncStatusResult - -Represents the status of a managed bank feed sync. - -## Example Usage - -```typescript -import { SyncStatusResult } from "@codat/bank-feeds/sdk/models/shared"; - -let value: SyncStatusResult = { - syncId: "eb8e7224-2645-4714-b413-07c308acfb9f", - clientId: "39efd2f6-b67a-45bb-84df-f7fd216be7fa", - companyId: "1963d437-a223-45d2-9f8a-26b5c4bd2201", - companyName: "Lind, Beatty and Hyatt", - dataConnectionId: "481105a8-8047-4603-aa15-990b05cc4a5d", - sourceAccountId: "", - periodStartUtc: new Date("2026-09-29T17:12:41.460Z"), - periodEndUtc: new Date("2025-11-01T15:58:21.081Z"), - executionStartUtc: new Date("2026-06-07T03:44:35.052Z"), - status: "SuccessDataPushed", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `syncId` | *string* | :heavy_check_mark: | The unique identifier for the sync. | | -| `clientId` | *string* | :heavy_check_mark: | The ID of the client associated with the company that owns the source bank account. | | -| `companyId` | *string* | :heavy_check_mark: | The ID of the company that owns the source bank account. | | -| `companyName` | *string* | :heavy_check_mark: | The name of the company that owns the source bank account. | | -| `dataConnectionId` | *string* | :heavy_check_mark: | The ID of the target accounting data connection. | | -| `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account from which transactions are fetched. | | -| `periodStartUtc` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The start of the sync period. | | -| `periodEndUtc` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The end of the sync period. | | -| `executionStartUtc` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The UTC timestamp when the sync started executing. | | -| `status` | *string* | :heavy_check_mark: | The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. | SuccessDataPushed | -| `executionEndUtc` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). | | -| `errorMessage` | *string* | :heavy_minus_sign: | Error message if the sync failed. | | -| `errorCode` | *string* | :heavy_minus_sign: | Error code if the sync failed. | | +# SyncStatusResult + +Represents the status of a managed bank feed sync. + +## Example Usage + +```typescript +import { SyncStatusResult } from "@codat/bank-feeds/sdk/models/shared"; + +let value: SyncStatusResult = { + syncId: "string", + clientId: "string", + companyId: "string", + companyName: "string", + dataConnectionId: "string", + sourceAccountId: "string", + periodStartUtc: "string", + periodEndUtc: "string", + executionStartUtc: "string", + status: "SuccessDataPushed", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `syncId` | *string* | :heavy_check_mark: | The unique identifier for the sync. | | +| `clientId` | *string* | :heavy_check_mark: | The ID of the client associated with the company that owns the source bank account. | | +| `companyId` | *string* | :heavy_check_mark: | The ID of the company that owns the source bank account. | | +| `companyName` | *string* | :heavy_check_mark: | The name of the company that owns the source bank account. | | +| `dataConnectionId` | *string* | :heavy_check_mark: | The ID of the target accounting data connection. | | +| `sourceAccountId` | *string* | :heavy_check_mark: | The ID of the source bank account from which transactions are fetched. | | +| `periodStartUtc` | *Date* | :heavy_check_mark: | The start of the sync period. | | +| `periodEndUtc` | *Date* | :heavy_check_mark: | The end of the sync period. | | +| `executionStartUtc` | *Date* | :heavy_check_mark: | The UTC timestamp when the sync started executing. | | +| `status` | *string* | :heavy_check_mark: | The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. | SuccessDataPushed | +| `executionEndUtc` | *Date* | :heavy_minus_sign: | The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). | | +| `errorMessage` | *string* | :heavy_minus_sign: | Error message if the sync failed. | | +| `errorCode` | *string* | :heavy_minus_sign: | Error code if the sync failed. | | | `pushOperationKeys` | *string*[] | :heavy_minus_sign: | List of write operation keys associated with the sync, if the sync resulted in write attempts. | | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/targetaccountoption.md b/bank-feeds/docs/sdk/models/shared/targetaccountoption.md index 9c567a39c..6e8e8a78d 100644 --- a/bank-feeds/docs/sdk/models/shared/targetaccountoption.md +++ b/bank-feeds/docs/sdk/models/shared/targetaccountoption.md @@ -1,19 +1,19 @@ -# TargetAccountOption - -## Example Usage - -```typescript -import { TargetAccountOption } from "@codat/bank-feeds/sdk/models/shared"; - -let value: TargetAccountOption = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Id of the target account. | -| `name` | *string* | :heavy_minus_sign: | Name of the target account. | -| `balance` | *Decimal* | :heavy_minus_sign: | The balance of the account. | -| `sortCode` | *string* | :heavy_minus_sign: | The sort code of the account. | +# TargetAccountOption + +## Example Usage + +```typescript +import { TargetAccountOption } from "@codat/bank-feeds/sdk/models/shared"; + +let value: TargetAccountOption = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Id of the target account. | +| `name` | *string* | :heavy_minus_sign: | Name of the target account. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | The balance of the account. | +| `sortCode` | *string* | :heavy_minus_sign: | The sort code of the account. | | `accountNumber` | *string* | :heavy_minus_sign: | The account number of the account. | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/type.md b/bank-feeds/docs/sdk/models/shared/type.md index a54da2e05..84330b561 100644 --- a/bank-feeds/docs/sdk/models/shared/type.md +++ b/bank-feeds/docs/sdk/models/shared/type.md @@ -1,17 +1,15 @@ -# Type - -The type of routing number. - -## Example Usage - -```typescript -import { Type } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Type = "aba"; -``` - -## Values - -```typescript -"rtn" | "aba" | "swift" | "bsb" | "iban" | "nz2" | "trno" | "sortcode" | "blz" | "ifsc" | "bankcode" | "apca" | "clabe" +# Type + +## Example Usage + +```typescript +import { Type } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Type = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/validation.md b/bank-feeds/docs/sdk/models/shared/validation.md index 947c1d2e7..644dfcd38 100644 --- a/bank-feeds/docs/sdk/models/shared/validation.md +++ b/bank-feeds/docs/sdk/models/shared/validation.md @@ -1,18 +1,18 @@ -# Validation - -A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { Validation } from "@codat/bank-feeds/sdk/models/shared"; - -let value: Validation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | +# Validation + +A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { Validation } from "@codat/bank-feeds/sdk/models/shared"; + +let value: Validation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/bank-feeds/docs/sdk/models/shared/validationitem.md b/bank-feeds/docs/sdk/models/shared/validationitem.md index 37bf8eff4..4705b26d3 100644 --- a/bank-feeds/docs/sdk/models/shared/validationitem.md +++ b/bank-feeds/docs/sdk/models/shared/validationitem.md @@ -1,17 +1,17 @@ -# ValidationItem - -## Example Usage - -```typescript -import { ValidationItem } from "@codat/bank-feeds/sdk/models/shared"; - -let value: ValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ValidationItem + +## Example Usage + +```typescript +import { ValidationItem } from "@codat/bank-feeds/sdk/models/shared"; + +let value: ValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/accountmapping/README.md b/bank-feeds/docs/sdks/accountmapping/README.md index e7323ddf2..46b6cb158 100644 --- a/bank-feeds/docs/sdks/accountmapping/README.md +++ b/bank-feeds/docs/sdks/accountmapping/README.md @@ -1,266 +1,266 @@ -# AccountMapping - -## Overview - -Extra functionality for building an account management UI. - -### Available Operations - -* [get](#get) - List bank feed accounts -* [create](#create) - Create bank feed account mapping - -## get - -The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. - -A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - -> **For custom builds only** -> -> Only use this endpoint if you are building your own account management UI. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.accountMapping.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { accountMappingGet } from "@codat/bank-feeds/funcs/accountMappingGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountMappingGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountMappingGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetBankAccountMappingRequest](../../sdk/models/operations/getbankaccountmappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankFeedMapping[]](../../models/.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). - -A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - -To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. - -> **For custom builds only** -> -> Only use this endpoint if you are building your own account management UI. - -#### Account mapping variability - -The method of mapping the source account to the target account varies depending on the accounting software your company uses. - -#### Mapping options: - -1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. -2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. -3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - -### Integration-specific behavior - -| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | -| --------------------- | ----------- | ---------------- | --------------------------- | -| Xero | ✅ | ✅ | | -| FreeAgent | ✅ | ✅ | | -| Oracle NetSuite | ✅ | ✅ | | -| Exact Online (NL) | ✅ | ✅ | | -| QuickBooks Online | | | ✅ | -| Sage | | | ✅ | - -### Example Usage: Example - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.accountMapping.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankFeedAccountMapping: { - sourceAccountId: "acc-002", - targetAccountId: "account-081", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { accountMappingCreate } from "@codat/bank-feeds/funcs/accountMappingCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountMappingCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankFeedAccountMapping: { - sourceAccountId: "acc-002", - targetAccountId: "account-081", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountMappingCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.accountMapping.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankFeedAccountMapping: { - sourceAccountId: "acc-002", - targetAccountId: "account-081", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { accountMappingCreate } from "@codat/bank-feeds/funcs/accountMappingCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountMappingCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankFeedAccountMapping: { - sourceAccountId: "acc-002", - targetAccountId: "account-081", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountMappingCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBankAccountMappingRequest](../../sdk/models/operations/createbankaccountmappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankFeedAccountMappingResponse](../../sdk/models/shared/bankfeedaccountmappingresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# AccountMapping + +## Overview + +Extra functionality for building an account management UI. + +### Available Operations + +* [get](#get) - List bank feed accounts +* [create](#create) - Create bank feed account mapping + +## get + +The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. + +A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). + +> **For custom builds only** +> +> Only use this endpoint if you are building your own account management UI. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.accountMapping.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { accountMappingGet } from "@codat/bank-feeds/funcs/accountMappingGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountMappingGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountMappingGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBankAccountMappingRequest](../../sdk/models/operations/getbankaccountmappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankFeedMapping[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). + +A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). + +To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. + +> **For custom builds only** +> +> Only use this endpoint if you are building your own account management UI. + +#### Account mapping variability + +The method of mapping the source account to the target account varies depending on the accounting software your company uses. + +#### Mapping options: + +1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. +2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. +3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + +### Integration-specific behavior + +| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | +| --------------------- | ----------- | ---------------- | --------------------------- | +| Xero | ✅ | ✅ | | +| FreeAgent | ✅ | ✅ | | +| Oracle NetSuite | ✅ | ✅ | | +| Exact Online (NL) | ✅ | ✅ | | +| QuickBooks Online | | | ✅ | +| Sage | | | ✅ | + +### Example Usage: Example + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.accountMapping.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankFeedAccountMapping: { + sourceAccountId: "acc-002", + targetAccountId: "account-081", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { accountMappingCreate } from "@codat/bank-feeds/funcs/accountMappingCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountMappingCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankFeedAccountMapping: { + sourceAccountId: "acc-002", + targetAccountId: "account-081", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountMappingCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.accountMapping.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankFeedAccountMapping: { + sourceAccountId: "acc-002", + targetAccountId: "account-081", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { accountMappingCreate } from "@codat/bank-feeds/funcs/accountMappingCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountMappingCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankFeedAccountMapping: { + sourceAccountId: "acc-002", + targetAccountId: "account-081", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountMappingCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountMappingRequest](../../sdk/models/operations/createbankaccountmappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankFeedAccountMappingResponse](../../sdk/models/shared/bankfeedaccountmappingresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/bankaccounts/README.md b/bank-feeds/docs/sdks/bankaccounts/README.md index e699973dc..0ff213b04 100644 --- a/bank-feeds/docs/sdks/bankaccounts/README.md +++ b/bank-feeds/docs/sdks/bankaccounts/README.md @@ -1,1285 +1,1285 @@ -# BankAccounts - -## Overview - -Access bank accounts in an SMBs accounting software. - -### Available Operations - -* [list](#list) - List bank accounts -* [getCreateModel](#getcreatemodel) - Get create/update bank account model -* [create](#create) - Create bank account - -## list - -The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - -[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). - - -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Oracle NetSuite - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 50 (UK) - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Zoho Books - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListBankAccountsRequest](../../sdk/models/operations/listbankaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankAccounts](../../sdk/models/shared/bankaccounts.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getCreateModel - -The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. - -[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -**Integration-specific behavior** - -See the *response examples* for integration-specific indicative models. - - -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sandbox - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateBankAccountsModelRequest](../../sdk/models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - -[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - currency: "GBP", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { bankAccountsCreate } from "@codat/bank-feeds/funcs/bankAccountsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccountPrototype: { - currency: "GBP", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankAccountCreateResponse](../../sdk/models/shared/bankaccountcreateresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# BankAccounts + +## Overview + +Access bank accounts in an SMBs accounting software. + +### Available Operations + +* [list](#list) - List bank accounts +* [getCreateModel](#getcreatemodel) - Get create/update bank account model +* [create](#create) - Create bank account + +## list + +The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). + + +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Oracle NetSuite + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 50 (UK) + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Zoho Books + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsList } from "@codat/bank-feeds/funcs/bankAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBankAccountsRequest](../../sdk/models/operations/listbankaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankAccounts](../../sdk/models/shared/bankaccounts.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCreateModel + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behavior** + +See the *response examples* for integration-specific indicative models. + + +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sandbox + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsGetCreateModel } from "@codat/bank-feeds/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankAccountsModelRequest](../../sdk/models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { bankAccountsCreate } from "@codat/bank-feeds/funcs/bankAccountsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + currency: "GBP", + status: "Active", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankAccountCreateResponse](../../sdk/models/shared/bankaccountcreateresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/companies/README.md b/bank-feeds/docs/sdks/companies/README.md index fcbd7fcd2..414fb90a1 100644 --- a/bank-feeds/docs/sdks/companies/README.md +++ b/bank-feeds/docs/sdks/companies/README.md @@ -1,1128 +1,1128 @@ -# Companies - -## Overview - -Create and manage your SMB users' companies. - -### Available Operations - -* [create](#create) - Create company -* [list](#list) - List companies -* [get](#get) - Get company -* [delete](#delete) - Delete a company -* [replace](#replace) - Replace company -* [update](#update) - Update company -* [getAccessToken](#getaccesstoken) - Get company access token - -## create - -Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - -### Example Usage: Malformed query - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatBankFeeds, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a description - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.create({ - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatBankFeeds, { - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a tag - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatBankFeeds, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With no description - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.create({ - name: "Technicalium", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatBankFeeds, { - name: "Technicalium", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## list - -The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -## Filter by tags - -The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - -- equals (`=`) -- not equals (`!=`) -- contains (`~`) - -For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: -- Foreign key: `uid = {yourCustomerId}` -- Region: `region != uk` -- Owning team and region: `region = uk && owningTeam = invoice-finance` - -### Example Usage: List of Companies - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesList } from "@codat/bank-feeds/funcs/companiesList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatBankFeeds, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` -### Example Usage: One company - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesList } from "@codat/bank-feeds/funcs/companiesList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatBankFeeds, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get company* endpoint returns a single company for a given `companyId`. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage: Parent multi-entity company - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Simple company - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Subsidiary multi-entity company - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatBankFeeds.companies.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesDelete } from "@codat/bank-feeds/funcs/companiesDelete.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesDelete(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## replace - -Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update description - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -Use the *Update company* endpoint to update the name, description, or tags of the company. - -The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - -A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update tags - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getAccessToken - -Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - -The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companies.getAccessToken({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companiesGetAccessToken } from "@codat/bank-feeds/funcs/companiesGetAccessToken.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGetAccessToken(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGetAccessToken failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyAccessTokenRequest](../../sdk/models/operations/getcompanyaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyAccessToken](../../sdk/models/shared/companyaccesstoken.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Companies + +## Overview + +Create and manage your SMB users' companies. + +### Available Operations + +* [create](#create) - Create company +* [list](#list) - List companies +* [get](#get) - Get company +* [delete](#delete) - Delete a company +* [replace](#replace) - Replace company +* [update](#update) - Update company +* [getAccessToken](#getaccesstoken) - Get company access token + +## create + +Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + +### Example Usage: Malformed query + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatBankFeeds, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a description + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.create({ + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatBankFeeds, { + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a tag + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatBankFeeds, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With no description + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.create({ + name: "Technicalium", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesCreate } from "@codat/bank-feeds/funcs/companiesCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatBankFeeds, { + name: "Technicalium", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + +### Example Usage: List of Companies + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesList } from "@codat/bank-feeds/funcs/companiesList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatBankFeeds, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` +### Example Usage: One company + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesList } from "@codat/bank-feeds/funcs/companiesList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatBankFeeds, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get company* endpoint returns a single company for a given `companyId`. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage: Parent multi-entity company + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Simple company + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subsidiary multi-entity company + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesGet } from "@codat/bank-feeds/funcs/companiesGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatBankFeeds.companies.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesDelete } from "@codat/bank-feeds/funcs/companiesDelete.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesDelete(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## replace + +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update description + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesReplace } from "@codat/bank-feeds/funcs/companiesReplace.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update tags + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesUpdate } from "@codat/bank-feeds/funcs/companiesUpdate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getAccessToken + +Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. + +The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companies.getAccessToken({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companiesGetAccessToken } from "@codat/bank-feeds/funcs/companiesGetAccessToken.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGetAccessToken(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGetAccessToken failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyAccessTokenRequest](../../sdk/models/operations/getcompanyaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyAccessToken](../../sdk/models/shared/companyaccesstoken.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/companyinformation/README.md b/bank-feeds/docs/sdks/companyinformation/README.md index 33bcbdacd..25c4150fb 100644 --- a/bank-feeds/docs/sdks/companyinformation/README.md +++ b/bank-feeds/docs/sdks/companyinformation/README.md @@ -1,96 +1,96 @@ -# CompanyInformation - -## Overview - -Get detailed information about a company from the underlying accounting software. - -### Available Operations - -* [get](#get) - Get company information - -## get - -Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - -### Supported Integrations -| Integration | Supported | -|-----------------------|-----------| -| Oracle NetSuite | Yes | -| Xero | Yes | -| Exact | No | -| FreeAgent | No | -| Sage | No | -| QuickBooks Online | No | - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.companyInformation.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { companyInformationGet } from "@codat/bank-feeds/funcs/companyInformationGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companyInformationGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companyInformationGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyInformationRequest](../../sdk/models/operations/getcompanyinformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# CompanyInformation + +## Overview + +Get detailed information about a company from the underlying accounting software. + +### Available Operations + +* [get](#get) - Get company information + +## get + +Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| Oracle NetSuite | Yes | +| Xero | Yes | +| Exact | No | +| FreeAgent | No | +| Sage | No | +| QuickBooks Online | No | + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.companyInformation.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { companyInformationGet } from "@codat/bank-feeds/funcs/companyInformationGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companyInformationGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companyInformationGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyInformationRequest](../../sdk/models/operations/getcompanyinformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/connections/README.md b/bank-feeds/docs/sdks/connections/README.md index 89dd065e9..701aaac57 100644 --- a/bank-feeds/docs/sdks/connections/README.md +++ b/bank-feeds/docs/sdks/connections/README.md @@ -1,468 +1,468 @@ -# Connections - -## Overview - -Create new and manage existing data connections for a company. - -### Available Operations - -* [list](#list) - List connections -* [create](#create) - Create connection -* [get](#get) - Get connection -* [delete](#delete) - Delete connection -* [unlink](#unlink) - Unlink connection - -## list - -List the connections for a company. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.connections.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsList } from "@codat/bank-feeds/funcs/connectionsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Creates a connection for the company by providing a valid `platformKey`. - -Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - -### Example Usage: Connection - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsCreate } from "@codat/bank-feeds/funcs/connectionsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsCreate } from "@codat/bank-feeds/funcs/connectionsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.connections.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsGet } from "@codat/bank-feeds/funcs/connectionsGet.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsGet(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -Revoke and remove a connection from a company. -This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatBankFeeds.connections.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsDelete } from "@codat/bank-feeds/funcs/connectionsDelete.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsDelete(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("connectionsDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## unlink - -This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.connections.unlink({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { connectionsUnlink } from "@codat/bank-feeds/funcs/connectionsUnlink.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsUnlink(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsUnlink failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Connections + +## Overview + +Create new and manage existing data connections for a company. + +### Available Operations + +* [list](#list) - List connections +* [create](#create) - Create connection +* [get](#get) - Get connection +* [delete](#delete) - Delete connection +* [unlink](#unlink) - Unlink connection + +## list + +List the connections for a company. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.connections.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsList } from "@codat/bank-feeds/funcs/connectionsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Creates a connection for the company by providing a valid `platformKey`. + +Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + +### Example Usage: Connection + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsCreate } from "@codat/bank-feeds/funcs/connectionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsCreate } from "@codat/bank-feeds/funcs/connectionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.connections.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsGet } from "@codat/bank-feeds/funcs/connectionsGet.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsGet(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Revoke and remove a connection from a company. +This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatBankFeeds.connections.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsDelete } from "@codat/bank-feeds/funcs/connectionsDelete.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsDelete(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("connectionsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## unlink + +This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.connections.unlink({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { connectionsUnlink } from "@codat/bank-feeds/funcs/connectionsUnlink.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsUnlink(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsUnlink failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/managedbankfeeds/README.md b/bank-feeds/docs/sdks/managedbankfeeds/README.md index 4aebf1131..0774d6847 100644 --- a/bank-feeds/docs/sdks/managedbankfeeds/README.md +++ b/bank-feeds/docs/sdks/managedbankfeeds/README.md @@ -1,258 +1,256 @@ -# ManagedBankFeeds - -## Overview - -Manage bank feed syncs for source accounts. - -### Available Operations - -* [getSync](#getsync) - Get sync -* [getLatestSync](#getlatestsync) - Get latest sync -* [runAdHocSync](#runadhocsync) - Run ad-hoc sync - -## getSync - -The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given 'syncId'. - -A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.managedBankFeeds.getSync({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - syncId: "823d304f-a204-4760-9b5d-b8a89bf29bed", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { managedBankFeedsGetSync } from "@codat/bank-feeds/funcs/managedBankFeedsGetSync.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await managedBankFeedsGetSync(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - syncId: "823d304f-a204-4760-9b5d-b8a89bf29bed", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("managedBankFeedsGetSync failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetManagedBankFeedSyncRequest](../../sdk/models/operations/getmanagedbankfeedsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.SyncStatusResult](../../sdk/models/shared/syncstatusresult.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getLatestSync - -The _Get latest sync_ endpoint returns the status for a given source account's [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). - -A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.managedBankFeeds.getLatestSync({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { managedBankFeedsGetLatestSync } from "@codat/bank-feeds/funcs/managedBankFeedsGetLatestSync.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await managedBankFeedsGetLatestSync(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("managedBankFeedsGetLatestSync failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetLatestManagedBankFeedSyncRequest](../../sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.SyncStatusResult](../../sdk/models/shared/syncstatusresult.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## runAdHocSync - -The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. - -A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - -Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.managedBankFeeds.runAdHocSync({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { managedBankFeedsRunAdHocSync } from "@codat/bank-feeds/funcs/managedBankFeedsRunAdHocSync.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await managedBankFeedsRunAdHocSync(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - sourceAccountId: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("managedBankFeedsRunAdHocSync failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RunManagedBankFeedAdHocSyncRequest](../../sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.StartScheduledSyncResult](../../sdk/models/shared/startscheduledsyncresult.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# ManagedBankFeeds + +## Overview + +Manage bank feed syncs for source accounts. + +### Available Operations + +* [getSync](#getsync) - Get sync +* [getLatestSync](#getlatestsync) - Get latest sync +* [runAdHocSync](#runadhocsync) - Run ad-hoc sync + +## getSync + +The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given 'syncId'. + +A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.managedBankFeeds.getSync({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { managedBankFeedsGetSync } from "@codat/bank-feeds/funcs/managedBankFeedsGetSync.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await managedBankFeedsGetSync(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("managedBankFeedsGetSync failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetManagedBankFeedSyncRequest](../../sdk/models/operations/getmanagedbankfeedsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.SyncStatusResult](../../sdk/models/shared/syncstatusresult.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getLatestSync + +The _Get latest sync_ endpoint returns the status for a given source account's [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). + +A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.managedBankFeeds.getLatestSync({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { managedBankFeedsGetLatestSync } from "@codat/bank-feeds/funcs/managedBankFeedsGetLatestSync.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await managedBankFeedsGetLatestSync(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("managedBankFeedsGetLatestSync failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLatestManagedBankFeedSyncRequest](../../sdk/models/operations/getlatestmanagedbankfeedsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.SyncStatusResult](../../sdk/models/shared/syncstatusresult.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## runAdHocSync + +The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. + +A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. + +Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.managedBankFeeds.runAdHocSync({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { managedBankFeedsRunAdHocSync } from "@codat/bank-feeds/funcs/managedBankFeedsRunAdHocSync.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await managedBankFeedsRunAdHocSync(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + sourceAccountId: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("managedBankFeedsRunAdHocSync failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RunManagedBankFeedAdHocSyncRequest](../../sdk/models/operations/runmanagedbankfeedadhocsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.StartScheduledSyncResult](../../sdk/models/shared/startscheduledsyncresult.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/sourceaccounts/README.md b/bank-feeds/docs/sdks/sourceaccounts/README.md index 42e5aeb08..10701ad29 100644 --- a/bank-feeds/docs/sdks/sourceaccounts/README.md +++ b/bank-feeds/docs/sdks/sourceaccounts/README.md @@ -1,856 +1,796 @@ -# SourceAccounts - -## Overview - -Provide and manage lists of source bank accounts. - -### Available Operations - -* [createBatch](#createbatch) - Create source accounts -* [create](#create) - Create single source account -* [list](#list) - List source accounts -* [update](#update) - Update source account -* [delete](#delete) - Delete source account -* [generateCredentials](#generatecredentials) - Generate source account credentials -* [deleteCredentials](#deletecredentials) - Delete all source account credentials -* [generateOtp](#generateotp) - Generate one-time password - -## createBatch - -The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - -> ### Versioning -> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.createBatch({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: [ - { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsCreateBatch } from "@codat/bank-feeds/funcs/sourceAccountsCreateBatch.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsCreateBatch(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: [ - { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsCreateBatch failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBatchSourceAccountRequest](../../sdk/models/operations/createbatchsourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.CreateBatchSourceAccountResponse](../../sdk/models/operations/createbatchsourceaccountresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - -> ### Versioning -> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - -### Example Usage: Malformed query - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Version 1 - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Version 2 - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - id: "", - currency: "GBP", - modifiedDate: "2022-10-23T00:00:00Z", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateSourceAccountRequest](../../sdk/models/operations/createsourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.CreateSourceAccountResponseBody](../../sdk/models/operations/createsourceaccountresponsebody.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## list - -The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company's connection. - -[Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank's bank account within Codat's domain from which transactions are synced into the accounting platform. - -> ### Versioning -> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsList } from "@codat/bank-feeds/funcs/sourceAccountsList.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsList(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSourceAccountsRequest](../../sdk/models/operations/listsourceaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.ListSourceAccountsResponseBody](../../sdk/models/operations/listsourceaccountsresponsebody.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. - -### Tips and pitfalls - -* This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. - * The `status` field can only be updated to 'disconnected'. - * The `balance` field can only be updated on accounts that are **not** 'connected'. -* Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - sourceAccount: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsUpdate } from "@codat/bank-feeds/funcs/sourceAccountsUpdate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsUpdate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - sourceAccount: { - id: "acc-002", - accountName: "account-081", - accountType: "Credit", - accountNumber: "12345670", - sortCode: "123456", - currency: "GBP", - balance: new Decimal("99.99"), - modifiedDate: "2023-01-09T14:14:14.1057478Z", - status: "pending", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateSourceAccountRequest](../../sdk/models/operations/updatesourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.SourceAccount](../../sdk/models/shared/sourceaccount.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -The _Delete source account_ endpoint enables you to remove a source account. - -Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. - - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatBankFeeds.sourceAccounts.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsDelete } from "@codat/bank-feeds/funcs/sourceAccountsDelete.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsDelete(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("sourceAccountsDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteSourceAccountRequest](../../sdk/models/operations/deletesourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generateCredentials - -The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. - -The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. - -> **For QuickBooks Online only** -> -> Only call this endpoint when onboarding SMBs that use QuickBooks Online. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { openAsBlob } from "node:fs"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.generateCredentials({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: await openAsBlob("example.file"), - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsGenerateCredentials } from "@codat/bank-feeds/funcs/sourceAccountsGenerateCredentials.js"; -import { openAsBlob } from "node:fs"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsGenerateCredentials(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: await openAsBlob("example.file"), - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsGenerateCredentials failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GenerateCredentialsRequest](../../sdk/models/operations/generatecredentialsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.BankAccountCredentials](../../sdk/models/shared/bankaccountcredentials.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## deleteCredentials - -The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. - -In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatBankFeeds.sourceAccounts.deleteCredentials({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsDeleteCredentials } from "@codat/bank-feeds/funcs/sourceAccountsDeleteCredentials.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsDeleteCredentials(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("sourceAccountsDeleteCredentials failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteBankFeedCredentialsRequest](../../sdk/models/operations/deletebankfeedcredentialsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generateOtp - -The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. - -> **For Sage only** -> -> Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. - - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.sourceAccounts.generateOtp({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { sourceAccountsGenerateOtp } from "@codat/bank-feeds/funcs/sourceAccountsGenerateOtp.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await sourceAccountsGenerateOtp(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("sourceAccountsGenerateOtp failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GenerateOtpRequest](../../sdk/models/operations/generateotprequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.GenerateOtpResponse](../../sdk/models/shared/generateotpresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# SourceAccounts + +## Overview + +Provide and manage lists of source bank accounts. + +### Available Operations + +* [createBatch](#createbatch) - Create source accounts +* [create](#create) - Create single source account +* [list](#list) - List source accounts +* [update](#update) - Update source account +* [delete](#delete) - Delete source account +* [generateCredentials](#generatecredentials) - Generate source account credentials +* [deleteCredentials](#deletecredentials) - Delete all source account credentials +* [generateOtp](#generateotp) - Generate one-time password + +## createBatch + +The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + +> ### Versioning +> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.createBatch({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsCreateBatch } from "@codat/bank-feeds/funcs/sourceAccountsCreateBatch.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsCreateBatch(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsCreateBatch failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBatchSourceAccountRequest](../../sdk/models/operations/createbatchsourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.CreateBatchSourceAccountResponse](../../sdk/models/operations/createbatchsourceaccountresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + +> ### Versioning +> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + +### Example Usage: Malformed query + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Version 1 + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Version 2 + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsCreate } from "@codat/bank-feeds/funcs/sourceAccountsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateSourceAccountRequest](../../sdk/models/operations/createsourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.CreateSourceAccountResponseBody](../../sdk/models/operations/createsourceaccountresponsebody.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company's connection. + +[Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank's bank account within Codat's domain from which transactions are synced into the accounting platform. + +> ### Versioning +> If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsList } from "@codat/bank-feeds/funcs/sourceAccountsList.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsList(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSourceAccountsRequest](../../sdk/models/operations/listsourceaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListSourceAccountsResponseBody](../../sdk/models/operations/listsourceaccountsresponsebody.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. + +### Tips and pitfalls + +* This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. + * The `status` field can only be updated to 'disconnected'. + * The `balance` field can only be updated on accounts that are **not** 'connected'. +* Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + sourceAccount: { + id: "acc-002", + accountName: "account-081", + accountType: "Credit", + accountNumber: "12345670", + sortCode: "123456", + currency: "GBP", + balance: 99.99, + modifiedDate: "2023-01-09T14:14:14.1057478Z", + status: "pending", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsUpdate } from "@codat/bank-feeds/funcs/sourceAccountsUpdate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsUpdate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + sourceAccount: { + id: "acc-002", + accountName: "account-081", + accountType: "Credit", + accountNumber: "12345670", + sortCode: "123456", + currency: "GBP", + balance: 99.99, + modifiedDate: "2023-01-09T14:14:14.1057478Z", + status: "pending", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateSourceAccountRequest](../../sdk/models/operations/updatesourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.SourceAccount](../../sdk/models/shared/sourceaccount.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The _Delete source account_ endpoint enables you to remove a source account. + +Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. + + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatBankFeeds.sourceAccounts.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsDelete } from "@codat/bank-feeds/funcs/sourceAccountsDelete.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsDelete(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("sourceAccountsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteSourceAccountRequest](../../sdk/models/operations/deletesourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## generateCredentials + +The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. + +The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. + +> **For QuickBooks Online only** +> +> Only call this endpoint when onboarding SMBs that use QuickBooks Online. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.generateCredentials({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsGenerateCredentials } from "@codat/bank-feeds/funcs/sourceAccountsGenerateCredentials.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsGenerateCredentials(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsGenerateCredentials failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GenerateCredentialsRequest](../../sdk/models/operations/generatecredentialsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.BankAccountCredentials](../../sdk/models/shared/bankaccountcredentials.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deleteCredentials + +The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. + +In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatBankFeeds.sourceAccounts.deleteCredentials({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsDeleteCredentials } from "@codat/bank-feeds/funcs/sourceAccountsDeleteCredentials.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsDeleteCredentials(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("sourceAccountsDeleteCredentials failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteBankFeedCredentialsRequest](../../sdk/models/operations/deletebankfeedcredentialsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## generateOtp + +The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. + +> **For Sage only** +> +> Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. + + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.sourceAccounts.generateOtp({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { sourceAccountsGenerateOtp } from "@codat/bank-feeds/funcs/sourceAccountsGenerateOtp.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await sourceAccountsGenerateOtp(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("sourceAccountsGenerateOtp failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GenerateOtpRequest](../../sdk/models/operations/generateotprequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.GenerateOtpResponse](../../sdk/models/shared/generateotpresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/transactions/README.md b/bank-feeds/docs/sdks/transactions/README.md index 017e12b02..abc8de9e6 100644 --- a/bank-feeds/docs/sdks/transactions/README.md +++ b/bank-feeds/docs/sdks/transactions/README.md @@ -1,831 +1,821 @@ -# Transactions - -## Overview - -Create new bank account transactions for a company's connections, and see previous operations. - -### Available Operations - -* [create](#create) - Create bank transactions -* [getCreateModel](#getcreatemodel) - Get create bank transactions model -* [getCreateOperation](#getcreateoperation) - Get create operation -* [listCreateOperations](#listcreateoperations) - List create operations - -## create - -The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company's connection. - -[Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB's bank account. - -**Integration-specific behavior** - -The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. -Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. - -### Example Usage: FreeAgent - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - amount: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - amount: new Decimal("-100"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - amount: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - amount: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - amount: new Decimal("-100"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - amount: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - transactions: [], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - transactions: [], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Bank Feeds - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - counterparty: "Bank of Example", - reference: "Ref-12345", - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - counterparty: "Amazon", - reference: "Ref-12346", - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - counterparty: "Office Mart", - reference: "Ref-12347", - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - counterparty: "Bank of Example", - reference: "Ref-12345", - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - counterparty: "Amazon", - reference: "Ref-12346", - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - counterparty: "Office Mart", - reference: "Ref-12347", - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - counterparty: "Bank of Example", - reference: "Ref-12345", - reconciled: true, - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - counterparty: "Amazon", - reference: "Ref-12346", - reconciled: false, - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - counterparty: "Office Mart", - reference: "Ref-12347", - reconciled: false, - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; -import { Decimal } from "@codat/bank-feeds/sdk/types"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsCreate(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - createBankTransactions: { - accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", - transactions: [ - { - id: "716422529", - date: "2023-08-22T10:21:00", - description: "Repayment of Credit Card", - counterparty: "Bank of Example", - reference: "Ref-12345", - reconciled: true, - amount: new Decimal("100"), - balance: new Decimal("100"), - transactionType: "Credit", - }, - { - id: "716422530", - date: "2023-08-22T10:22:00", - description: "Amazon Purchase", - counterparty: "Amazon", - reference: "Ref-12346", - reconciled: false, - amount: new Decimal("-100"), - balance: new Decimal("0"), - transactionType: "Debit", - }, - { - id: "716422531", - date: "2023-08-22T10:23:00", - description: "Office Supplies", - counterparty: "Office Mart", - reference: "Ref-12347", - reconciled: false, - amount: new Decimal("-60"), - balance: new Decimal("-60"), - transactionType: "Debit", - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBankTransactionsRequest](../../sdk/models/operations/createbanktransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateBankTransactionsResponse](../../sdk/models/shared/createbanktransactionsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getCreateModel - -The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. - -[Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. - -**Integration-specific behavior** - -See the *response examples* for integration-specific indicative models. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsGetCreateModel } from "@codat/bank-feeds/funcs/transactionsGetCreateModel.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsGetCreateModel(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsGetCreateModel failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateBankTransactionsModelRequest](../../sdk/models/operations/getcreatebanktransactionsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getCreateOperation - -The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - -Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - -For bank feeds, your push operations will only relate to the `bankTransactions` data type. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.getCreateOperation({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "23a26d56-6e3d-4414-865c-4fa7ebbb43e3", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsGetCreateOperation } from "@codat/bank-feeds/funcs/transactionsGetCreateOperation.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsGetCreateOperation(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "23a26d56-6e3d-4414-865c-4fa7ebbb43e3", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsGetCreateOperation failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateOperationRequest](../../sdk/models/operations/getcreateoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listCreateOperations - -The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. - -Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - -For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. - -### Example Usage - - -```typescript -import { CodatBankFeeds } from "@codat/bank-feeds"; - -const codatBankFeeds = new CodatBankFeeds({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatBankFeeds.transactions.listCreateOperations({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; -import { transactionsListCreateOperations } from "@codat/bank-feeds/funcs/transactionsListCreateOperations.js"; - -// Use `CodatBankFeedsCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatBankFeeds = new CodatBankFeedsCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionsListCreateOperations(codatBankFeeds, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionsListCreateOperations failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCreateOperationsRequest](../../sdk/models/operations/listcreateoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Transactions + +## Overview + +Create new bank account transactions for a company's connections, and see previous operations. + +### Available Operations + +* [create](#create) - Create bank transactions +* [getCreateModel](#getcreatemodel) - Get create bank transactions model +* [getCreateOperation](#getcreateoperation) - Get create operation +* [listCreateOperations](#listcreateoperations) - List create operations + +## create + +The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company's connection. + +[Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB's bank account. + +**Integration-specific behavior** + +The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. +Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. + +### Example Usage: FreeAgent + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + amount: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + amount: -100, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + amount: -60, + transactionType: "Debit", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + amount: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + amount: -100, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + amount: -60, + transactionType: "Debit", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + transactions: [], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + transactions: [], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Bank Feeds + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + counterparty: "Bank of Example", + reference: "Ref-12345", + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + counterparty: "Amazon", + reference: "Ref-12346", + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + counterparty: "Office Mart", + reference: "Ref-12347", + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + counterparty: "Bank of Example", + reference: "Ref-12345", + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + counterparty: "Amazon", + reference: "Ref-12346", + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + counterparty: "Office Mart", + reference: "Ref-12347", + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + counterparty: "Bank of Example", + reference: "Ref-12345", + reconciled: true, + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + counterparty: "Amazon", + reference: "Ref-12346", + reconciled: false, + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + counterparty: "Office Mart", + reference: "Ref-12347", + reconciled: false, + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsCreate } from "@codat/bank-feeds/funcs/transactionsCreate.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsCreate(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + createBankTransactions: { + accountId: "49cd5a42-b311-4750-9361-52e2ed1d4653", + transactions: [ + { + id: "716422529", + date: "2023-08-22T10:21:00", + description: "Repayment of Credit Card", + counterparty: "Bank of Example", + reference: "Ref-12345", + reconciled: true, + amount: 100, + balance: 100, + transactionType: "Credit", + }, + { + id: "716422530", + date: "2023-08-22T10:22:00", + description: "Amazon Purchase", + counterparty: "Amazon", + reference: "Ref-12346", + reconciled: false, + amount: -100, + balance: 0, + transactionType: "Debit", + }, + { + id: "716422531", + date: "2023-08-22T10:23:00", + description: "Office Supplies", + counterparty: "Office Mart", + reference: "Ref-12347", + reconciled: false, + amount: -60, + balance: -60, + transactionType: "Debit", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankTransactionsRequest](../../sdk/models/operations/createbanktransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateBankTransactionsResponse](../../sdk/models/shared/createbanktransactionsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCreateModel + +The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + +[Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + +**Integration-specific behavior** + +See the *response examples* for integration-specific indicative models. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsGetCreateModel } from "@codat/bank-feeds/funcs/transactionsGetCreateModel.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsGetCreateModel(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsGetCreateModel failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankTransactionsModelRequest](../../sdk/models/operations/getcreatebanktransactionsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCreateOperation + +The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + +For bank feeds, your push operations will only relate to the `bankTransactions` data type. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.getCreateOperation({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsGetCreateOperation } from "@codat/bank-feeds/funcs/transactionsGetCreateOperation.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsGetCreateOperation(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsGetCreateOperation failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateOperationRequest](../../sdk/models/operations/getcreateoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listCreateOperations + +The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + +For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. + +### Example Usage + + +```typescript +import { CodatBankFeeds } from "@codat/bank-feeds"; + +const codatBankFeeds = new CodatBankFeeds({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatBankFeeds.transactions.listCreateOperations({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatBankFeedsCore } from "@codat/bank-feeds/core.js"; +import { transactionsListCreateOperations } from "@codat/bank-feeds/funcs/transactionsListCreateOperations.js"; + +// Use `CodatBankFeedsCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatBankFeeds = new CodatBankFeedsCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionsListCreateOperations(codatBankFeeds, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionsListCreateOperations failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCreateOperationsRequest](../../sdk/models/operations/listcreateoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/bank-feeds/files.gen b/bank-feeds/files.gen deleted file mode 100755 index bf12e3332..000000000 --- a/bank-feeds/files.gen +++ /dev/null @@ -1,174 +0,0 @@ -src/sdk/companies.ts -src/sdk/connections.ts -src/sdk/accountmapping.ts -src/sdk/sourceaccounts.ts -src/sdk/transactions.ts -src/sdk/sdk.ts -.eslintrc.yml -jest.config.js -package-lock.json -package.json -src/index.ts -src/internal/utils/contenttype.ts -src/internal/utils/headers.ts -src/internal/utils/index.ts -src/internal/utils/pathparams.ts -src/internal/utils/queryparams.ts -src/internal/utils/requestbody.ts -src/internal/utils/retries.ts -src/internal/utils/security.ts -src/internal/utils/utils.ts -src/sdk/index.ts -src/sdk/models/errors/sdkerror.ts -src/sdk/types/index.ts -src/sdk/types/rfcdate.ts -tsconfig.json -src/sdk/models/operations/createcompany.ts -src/sdk/models/operations/deletecompany.ts -src/sdk/models/operations/getcompany.ts -src/sdk/models/operations/listcompanies.ts -src/sdk/models/operations/updatecompany.ts -src/sdk/models/operations/createconnection.ts -src/sdk/models/operations/deleteconnection.ts -src/sdk/models/operations/getconnection.ts -src/sdk/models/operations/listconnections.ts -src/sdk/models/operations/unlinkconnection.ts -src/sdk/models/operations/createbankaccountmapping.ts -src/sdk/models/operations/getbankaccountmapping.ts -src/sdk/models/operations/createsourceaccount.ts -src/sdk/models/operations/deletesourceaccount.ts -src/sdk/models/operations/deletebankfeedcredentials.ts -src/sdk/models/operations/generatecredentials.ts -src/sdk/models/operations/listsourceaccounts.ts -src/sdk/models/operations/updatesourceaccount.ts -src/sdk/models/operations/createbanktransactions.ts -src/sdk/models/operations/getcreateoperation.ts -src/sdk/models/operations/listcreateoperations.ts -src/sdk/models/shared/zero.ts -src/sdk/models/shared/errormessage.ts -src/sdk/models/shared/company.ts -src/sdk/models/shared/connection.ts -src/sdk/models/shared/dataconnectionstatus.ts -src/sdk/models/shared/dataconnectionerror.ts -src/sdk/models/shared/companyrequestbody.ts -src/sdk/models/shared/companies.ts -src/sdk/models/shared/links.ts -src/sdk/models/shared/halref.ts -src/sdk/models/shared/connections.ts -src/sdk/models/shared/bankfeedaccountmappingresponse.ts -src/sdk/models/shared/bankfeedmapping.ts -src/sdk/models/shared/targetaccountoption.ts -src/sdk/models/shared/sourceaccount.ts -src/sdk/models/shared/bankaccountcredentials.ts -src/sdk/models/shared/createbanktransactionsresponse.ts -src/sdk/models/shared/validation.ts -src/sdk/models/shared/validationitem.ts -src/sdk/models/shared/pushoperationstatus.ts -src/sdk/models/shared/datatype.ts -src/sdk/models/shared/createbanktransactions.ts -src/sdk/models/shared/banktransactions.ts -src/sdk/models/shared/pushoperationchange.ts -src/sdk/models/shared/pushchangetype.ts -src/sdk/models/shared/pushoperationref.ts -src/sdk/models/shared/pushoperation.ts -src/sdk/models/shared/pushoperations.ts -src/sdk/models/shared/security.ts -src/sdk/models/shared/clientratelimitreachedwebhook.ts -src/sdk/models/shared/clientratelimitreachedwebhookdata.ts -src/sdk/models/shared/clientratelimitresetwebhook.ts -src/sdk/models/shared/clientratelimitresetwebhookdata.ts -src/sdk/models/webhooks/clientratelimitreached.ts -src/sdk/models/webhooks/clientratelimitreset.ts -src/sdk/models/errors/index.ts -src/sdk/models/operations/index.ts -src/sdk/models/shared/index.ts -src/sdk/models/webhooks/index.ts -docs/sdk/models/operations/createcompanyresponse.md -docs/sdk/models/operations/deletecompanyrequest.md -docs/sdk/models/operations/deletecompanyresponse.md -docs/sdk/models/operations/getcompanyrequest.md -docs/sdk/models/operations/getcompanyresponse.md -docs/sdk/models/operations/listcompaniesrequest.md -docs/sdk/models/operations/listcompaniesresponse.md -docs/sdk/models/operations/updatecompanyrequest.md -docs/sdk/models/operations/updatecompanyresponse.md -docs/sdk/models/operations/createconnectionrequestbody.md -docs/sdk/models/operations/createconnectionrequest.md -docs/sdk/models/operations/createconnectionresponse.md -docs/sdk/models/operations/deleteconnectionrequest.md -docs/sdk/models/operations/deleteconnectionresponse.md -docs/sdk/models/operations/getconnectionrequest.md -docs/sdk/models/operations/getconnectionresponse.md -docs/sdk/models/operations/listconnectionsrequest.md -docs/sdk/models/operations/listconnectionsresponse.md -docs/sdk/models/operations/unlinkconnectionupdateconnection.md -docs/sdk/models/operations/unlinkconnectionrequest.md -docs/sdk/models/operations/unlinkconnectionresponse.md -docs/sdk/models/operations/createbankaccountmappingrequest.md -docs/sdk/models/operations/createbankaccountmappingresponse.md -docs/sdk/models/operations/getbankaccountmappingrequest.md -docs/sdk/models/operations/getbankaccountmappingresponse.md -docs/sdk/models/operations/createsourceaccountrequest.md -docs/sdk/models/operations/createsourceaccountresponse.md -docs/sdk/models/operations/deletesourceaccountrequest.md -docs/sdk/models/operations/deletesourceaccountresponse.md -docs/sdk/models/operations/deletebankfeedcredentialsrequest.md -docs/sdk/models/operations/deletebankfeedcredentialsresponse.md -docs/sdk/models/operations/generatecredentialsrequest.md -docs/sdk/models/operations/generatecredentialsresponse.md -docs/sdk/models/operations/listsourceaccountsrequest.md -docs/sdk/models/operations/listsourceaccountsresponse.md -docs/sdk/models/operations/updatesourceaccountrequest.md -docs/sdk/models/operations/updatesourceaccountresponse.md -docs/sdk/models/operations/createbanktransactionsrequest.md -docs/sdk/models/operations/createbanktransactionsresponse.md -docs/sdk/models/operations/getcreateoperationrequest.md -docs/sdk/models/operations/getcreateoperationresponse.md -docs/sdk/models/operations/listcreateoperationsrequest.md -docs/sdk/models/operations/listcreateoperationsresponse.md -docs/sdk/models/shared/zero.md -docs/sdk/models/shared/errormessage.md -docs/sdk/models/shared/company.md -docs/sdk/models/shared/sourcetype.md -docs/sdk/models/shared/connection.md -docs/sdk/models/shared/dataconnectionstatus.md -docs/sdk/models/shared/dataconnectionerror.md -docs/sdk/models/shared/companyrequestbody.md -docs/sdk/models/shared/companies.md -docs/sdk/models/shared/links.md -docs/sdk/models/shared/halref.md -docs/sdk/models/shared/connections.md -docs/sdk/models/shared/bankfeedaccountmappingresponse.md -docs/sdk/models/shared/bankfeedmapping.md -docs/sdk/models/shared/targetaccountoption.md -docs/sdk/models/shared/sourceaccount.md -docs/sdk/models/shared/bankaccountcredentials.md -docs/sdk/models/shared/createbanktransactionsresponse.md -docs/sdk/models/shared/validation.md -docs/sdk/models/shared/validationitem.md -docs/sdk/models/shared/pushoperationstatus.md -docs/sdk/models/shared/datatype.md -docs/sdk/models/shared/createbanktransactions.md -docs/sdk/models/shared/banktransactiontype.md -docs/sdk/models/shared/banktransactions.md -docs/sdk/models/shared/pushoperationchange.md -docs/sdk/models/shared/pushchangetype.md -docs/sdk/models/shared/pushoperationref.md -docs/sdk/models/shared/pushoperation.md -docs/sdk/models/shared/pushoperations.md -docs/sdk/models/shared/security.md -docs/sdk/models/shared/clientratelimitreachedwebhook.md -docs/sdk/models/shared/clientratelimitreachedwebhookdata.md -docs/sdk/models/shared/clientratelimitresetwebhook.md -docs/sdk/models/shared/clientratelimitresetwebhookdata.md -docs/sdk/models/webhooks/clientratelimitreachedresponse.md -docs/sdk/models/webhooks/clientratelimitresetresponse.md -docs/sdks/codatbankfeeds/README.md -docs/internal/utils/retryconfig.md -docs/sdks/companies/README.md -docs/sdks/connections/README.md -docs/sdks/accountmapping/README.md -docs/sdks/sourceaccounts/README.md -docs/sdks/transactions/README.md -USAGE.md -.gitattributes \ No newline at end of file diff --git a/bank-feeds/jsr.json b/bank-feeds/jsr.json deleted file mode 100644 index 2a79e4d74..000000000 --- a/bank-feeds/jsr.json +++ /dev/null @@ -1,27 +0,0 @@ - - -{ - "name": "@codat/bank-feeds", - "version": "8.2.1", - "exports": { - ".": "./src/index.ts", - "./sdk/models/errors": "./src/sdk/models/errors/index.ts", - "./sdk/models/shared": "./src/sdk/models/shared/index.ts", - "./sdk/models/operations": "./src/sdk/models/operations/index.ts", - "./lib/config": "./src/lib/config.ts", - "./lib/http": "./src/lib/http.ts", - "./lib/retries": "./src/lib/retries.ts", - "./lib/sdks": "./src/lib/sdks.ts", - "./types": "./src/sdk/types/index.ts" - }, - "publish": { - "include": [ - "LICENSE", - "README.md", - "RUNTIMES.md", - "USAGE.md", - "jsr.json", - "src/**/*.ts" - ] - } -} diff --git a/bank-feeds/package.json b/bank-feeds/package.json index 4c485f34f..9052b1007 100644 --- a/bank-feeds/package.json +++ b/bank-feeds/package.json @@ -1,31 +1,59 @@ { "name": "@codat/bank-feeds", - "version": "8.2.1", + "version": "8.2.2", "author": "Codat", - "main": "./index.js", - "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/codatio/client-sdk-typescript.git", "directory": "bank-feeds" }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "peerDependencies": { - + "build": "tsc && tsc -p tsconfig.esm.json", + "prepare": "npm run build" }, "devDependencies": { - "@eslint/js": "^9.26.0", - "eslint": "^9.26.0", - "globals": "^15.14.0", - "typescript": "~5.8.3", - "typescript-eslint": "^8.26.0" + "typescript": "^4.0 || ^5.0" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./sdk/models/shared": { + "types": "./dist/sdk/models/shared/index.d.ts", + "default": "./dist/sdk/models/shared/index.js" + }, + "./sdk/models/operations": { + "types": "./dist/sdk/models/operations/index.d.ts", + "default": "./dist/sdk/models/operations/index.js" + }, + "./sdk/models/errors": { + "types": "./dist/sdk/models/errors/index.d.ts", + "default": "./dist/sdk/models/errors/index.js" + }, + "./sdk/types": { + "types": "./dist/sdk/types/index.d.ts", + "default": "./dist/sdk/types/index.js" + }, + "./core.js": { + "types": "./dist/core.d.ts", + "default": "./dist/core.js" + }, + "./lib/http": { + "types": "./dist/lib/sdkconfig.d.ts", + "default": "./dist/lib/sdkconfig.js" + }, + "./funcs/*.js": { + "types": "./dist/funcs/*.d.ts", + "default": "./dist/funcs/*.js" + }, + "./package.json": "./package.json" }, "dependencies": { - "decimal.js": "^10.4.3", - "zod": "^3.25.0 || ^4.0.0" + "decimal.js": "^10.4.3" } } diff --git a/bank-feeds/src/apis/AccountMapping.ts b/bank-feeds/src/apis/AccountMapping.ts new file mode 100644 index 000000000..4b1a9aa23 --- /dev/null +++ b/bank-feeds/src/apis/AccountMapping.ts @@ -0,0 +1,149 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BankFeedAccountMapping, + BankFeedAccountMappingResponse, + BankFeedMapping, + ErrorMessage, +} from '../sdk/models/index'; +import { + BankFeedAccountMappingFromJSON, + BankFeedAccountMappingToJSON, + BankFeedAccountMappingResponseFromJSON, + BankFeedAccountMappingResponseToJSON, + BankFeedMappingFromJSON, + BankFeedMappingToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateBankAccountMappingRequest { + companyId: string; + connectionId: string; + bankFeedAccountMapping?: BankFeedAccountMapping; +} + +export interface GetBankAccountMappingRequest { + companyId: string; + connectionId: string; +} + +/** + * + */ +export class AccountMapping extends runtime.BaseAPI { + + /** + * The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user\'s account in the underlying software). To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. > **For custom builds only** > > Only use this endpoint if you are building your own account management UI. #### Account mapping variability The method of mapping the source account to the target account varies depending on the accounting software your company uses. #### Mapping options: 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat\'s provided user interface for mapping. 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. ### Integration-specific behavior | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | | --------------------- | ----------- | ---------------- | --------------------------- | | Xero | ✅ | ✅ | | | FreeAgent | ✅ | ✅ | | | Oracle NetSuite | ✅ | ✅ | | | Exact Online (NL) | ✅ | ✅ | | | QuickBooks Online | | | ✅ | | Sage | | | ✅ | + * Create bank feed account mapping + */ + private async createBankAccountMappingRaw(requestParameters: CreateBankAccountMappingRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBankAccountMapping().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBankAccountMapping().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-bank-account-mapping', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BankFeedAccountMappingToJSON(requestParameters['bankFeedAccountMapping']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BankFeedAccountMappingResponseFromJSON(jsonValue)); + } + + /** + * The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user\'s account in the underlying software). To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. > **For custom builds only** > > Only use this endpoint if you are building your own account management UI. #### Account mapping variability The method of mapping the source account to the target account varies depending on the accounting software your company uses. #### Mapping options: 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat\'s provided user interface for mapping. 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. ### Integration-specific behavior | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | | --------------------- | ----------- | ---------------- | --------------------------- | | Xero | ✅ | ✅ | | | FreeAgent | ✅ | ✅ | | | Oracle NetSuite | ✅ | ✅ | | | Exact Online (NL) | ✅ | ✅ | | | QuickBooks Online | | | ✅ | | Sage | | | ✅ | + * Create bank feed account mapping + */ + async create(requestParameters: CreateBankAccountMappingRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBankAccountMappingRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user\'s account in the underlying software). > **For custom builds only** > > Only use this endpoint if you are building your own account management UI. + * List bank feed accounts + */ + private async getBankAccountMappingRaw(requestParameters: GetBankAccountMappingRequest, options?: runtime.RequestOptions): Promise>> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getBankAccountMapping().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getBankAccountMapping().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-bank-account-mapping', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(BankFeedMappingFromJSON)); + } + + /** + * The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user\'s account in the underlying software). > **For custom builds only** > > Only use this endpoint if you are building your own account management UI. + * List bank feed accounts + */ + async get(requestParameters: GetBankAccountMappingRequest, options?: runtime.RequestOptions): Promise> { + const response = await this.getBankAccountMappingRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/BankAccounts.ts b/bank-feeds/src/apis/BankAccounts.ts new file mode 100644 index 000000000..a45b142d7 --- /dev/null +++ b/bank-feeds/src/apis/BankAccounts.ts @@ -0,0 +1,236 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + BankAccountCreateResponse, + BankAccountPrototype, + ErrorMessage, + PushOption, +} from '../sdk/models/index'; +import { + BankAccountCreateResponseFromJSON, + BankAccountCreateResponseToJSON, + BankAccountPrototypeFromJSON, + BankAccountPrototypeToJSON, + BankAccountsFromJSON, + BankAccountsToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOptionFromJSON, + PushOptionToJSON, +} from '../sdk/models/index'; + +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + bankAccountPrototype?: BankAccountPrototype; +} + +export interface GetCreateBankAccountsModelRequest { + companyId: string; + connectionId: string; +} + +export interface ListBankAccountsRequest { + companyId: string; + connectionId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +/** + * + */ +export class BankAccounts extends runtime.BaseAPI { + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). + * Create bank account + */ + private async createBankAccountRaw(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBankAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBankAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-bank-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BankAccountPrototypeToJSON(requestParameters['bankAccountPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BankAccountCreateResponseFromJSON(jsonValue)); + } + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). + * Create bank account + */ + async create(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBankAccountRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create/update bank account model + */ + private async getCreateBankAccountsModelRaw(requestParameters: GetCreateBankAccountsModelRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateBankAccountsModel().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCreateBankAccountsModel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/options/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-create-bankAccounts-model', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOptionFromJSON(jsonValue)); + } + + /** + * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create/update bank account model + */ + async getCreateModel(requestParameters: GetCreateBankAccountsModelRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateBankAccountsModelRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). + * List bank accounts + */ + private async listBankAccountsRaw(requestParameters: ListBankAccountsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listBankAccounts().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listBankAccounts().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/data/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'list-bank-accounts', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BankAccountsFromJSON(jsonValue)); + } + + /** + * The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). + * List bank accounts + */ + async list(requestParameters: ListBankAccountsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listBankAccountsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/Companies.ts b/bank-feeds/src/apis/Companies.ts new file mode 100644 index 000000000..4c118dc8f --- /dev/null +++ b/bank-feeds/src/apis/Companies.ts @@ -0,0 +1,387 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { CompanyAccessToken } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + AccessToken, + Company, + CompanyRequestBody, + CompanyUpdateRequest, + ErrorMessage, +} from '../sdk/models/index'; +import { + AccessTokenFromJSON, + AccessTokenToJSON, + CompaniesFromJSON, + CompaniesToJSON, + CompanyFromJSON, + CompanyToJSON, + CompanyRequestBodyFromJSON, + CompanyRequestBodyToJSON, + CompanyUpdateRequestFromJSON, + CompanyUpdateRequestToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody; +} + +export interface DeleteCompanyRequest { + companyId: string; +} + +export interface GetCompanyRequest { + companyId: string; +} + +export interface GetCompanyAccessTokenRequest { + companyId: string; +} + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; +} + +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody; +} + +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest; +} + +/** + * + */ +export class Companies extends runtime.BaseAPI { + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + private async createCompanyRaw(requestParameters: CreateCompanyRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'POST', + operationId: 'create-company', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + async create(companyRequestBody?: CompanyRequestBody, options?: runtime.RequestOptions): Promise { + const response = await this.createCompanyRaw({ companyRequestBody: companyRequestBody }, options); + return await response.value(); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + private async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'DELETE', + operationId: 'delete-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + async delete(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise { + await this.deleteCompanyRaw(requestParameters, options); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + private async getCompanyRaw(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + async get(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. The token is required by Codat\'s embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + * Get company access token + */ + private async getCompanyAccessTokenRaw(requestParameters: GetCompanyAccessTokenRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyAccessToken().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/accessToken`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-access-token', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccessTokenFromJSON(jsonValue)); + } + + /** + * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. The token is required by Codat\'s embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + * Get company access token + */ + async getAccessToken(requestParameters: GetCompanyAccessTokenRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyAccessTokenRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + private async listCompaniesRaw(requestParameters: ListCompaniesRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'GET', + operationId: 'list-companies', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompaniesFromJSON(jsonValue)); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + async list(requestParameters: ListCompaniesRequest = {}, options?: runtime.RequestOptions): Promise { + const response = await this.listCompaniesRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + private async replaceCompanyRaw(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling replaceCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PUT', + operationId: 'replace-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + async replace(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.replaceCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + private async updateCompanyRaw(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PATCH', + operationId: 'update-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyUpdateRequestToJSON(requestParameters['companyUpdateRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + async update(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateCompanyRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/CompanyInformation.ts b/bank-feeds/src/apis/CompanyInformation.ts new file mode 100644 index 000000000..1ecb6a1a6 --- /dev/null +++ b/bank-feeds/src/apis/CompanyInformation.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + ErrorMessage, +} from '../sdk/models/index'; +import { + CompanyInformationFromJSON, + CompanyInformationToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyInformationRequest { + companyId: string; + connectionId: string; +} + +/** + * + */ +export class CompanyInformation extends runtime.BaseAPI { + + /** + * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | Oracle NetSuite | Yes | | Xero | Yes | | Exact | No | | FreeAgent | No | | Sage | No | | QuickBooks Online | No | + * Get company information + */ + private async getCompanyInformationRaw(requestParameters: GetCompanyInformationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyInformation().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCompanyInformation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeeds/info`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-company-information', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyInformationFromJSON(jsonValue)); + } + + /** + * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | Oracle NetSuite | Yes | | Xero | Yes | | Exact | No | | FreeAgent | No | | Sage | No | | QuickBooks Online | No | + * Get company information + */ + async get(requestParameters: GetCompanyInformationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyInformationRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/Connections.ts b/bank-feeds/src/apis/Connections.ts new file mode 100644 index 000000000..3f2a0ea31 --- /dev/null +++ b/bank-feeds/src/apis/Connections.ts @@ -0,0 +1,324 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Connection, + CreateConnectionRequestBody, + ErrorMessage, + UpdateConnection, +} from '../sdk/models/index'; +import { + ConnectionFromJSON, + ConnectionToJSON, + ConnectionsFromJSON, + ConnectionsToJSON, + CreateConnectionRequestBodyFromJSON, + CreateConnectionRequestBodyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + UpdateConnectionFromJSON, + UpdateConnectionToJSON, +} from '../sdk/models/index'; + +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody; +} + +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface GetConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UpdateConnection; +} + +/** + * + */ +export class Connections extends runtime.BaseAPI { + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + private async createConnectionRaw(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateConnectionRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + async create(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * Revoke and remove a connection from a company. This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + * Delete connection + */ + private async deleteConnectionRaw(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'DELETE', + operationId: 'delete-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Revoke and remove a connection from a company. This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + * Delete connection + */ + async delete(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise { + await this.deleteConnectionRaw(requestParameters, options); + } + + /** + * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + * Get connection + */ + private async getConnectionRaw(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + * Get connection + */ + async get(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * List the connections for a company. + * List connections + */ + private async listConnectionsRaw(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listConnections().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-connections', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionsFromJSON(jsonValue)); + } + + /** + * List the connections for a company. + * List connections + */ + async list(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listConnectionsRaw(requestParameters, options); + return await response.value(); + } + + /** + * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + * Unlink connection + */ + private async unlinkConnectionRaw(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling unlinkConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling unlinkConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'PATCH', + operationId: 'unlink-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateConnectionToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + * Unlink connection + */ + async unlink(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.unlinkConnectionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/ManagedBankFeeds.ts b/bank-feeds/src/apis/ManagedBankFeeds.ts new file mode 100644 index 000000000..05251cd44 --- /dev/null +++ b/bank-feeds/src/apis/ManagedBankFeeds.ts @@ -0,0 +1,234 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + StartScheduledSyncResult, + SyncStatusResult, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + StartScheduledSyncResultFromJSON, + StartScheduledSyncResultToJSON, + SyncStatusResultFromJSON, + SyncStatusResultToJSON, +} from '../sdk/models/index'; + +export interface GetLatestManagedBankFeedSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; +} + +export interface GetManagedBankFeedSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; + syncId: string; +} + +export interface RunManagedBankFeedAdHocSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; +} + +/** + * + */ +export class ManagedBankFeeds extends runtime.BaseAPI { + + /** + * The _Get latest sync_ endpoint returns the status for a given source account\'s [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. + * Get latest sync + */ + private async getLatestManagedBankFeedSyncRaw(requestParameters: GetLatestManagedBankFeedSyncRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getLatestManagedBankFeedSync().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getLatestManagedBankFeedSync().' + ); + } + + if (requestParameters['sourceAccountId'] == null) { + throw new runtime.RequiredError( + 'sourceAccountId', + 'Required parameter "sourceAccountId" was null or undefined when calling getLatestManagedBankFeedSync().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs/latest`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"sourceAccountId"}}`, encodeURIComponent(String(requestParameters['sourceAccountId']))), + method: 'GET', + operationId: 'get-latest-managed-bank-feed-sync', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SyncStatusResultFromJSON(jsonValue)); + } + + /** + * The _Get latest sync_ endpoint returns the status for a given source account\'s [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. + * Get latest sync + */ + async getLatestSync(requestParameters: GetLatestManagedBankFeedSyncRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getLatestManagedBankFeedSyncRaw(requestParameters, options); + switch (response.raw.status) { + case 200: + return await response.value(); + case 204: + return null; + default: + return await response.value(); + } + } + + /** + * The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given \'syncId\'. A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. + * Get sync + */ + private async getManagedBankFeedSyncRaw(requestParameters: GetManagedBankFeedSyncRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getManagedBankFeedSync().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getManagedBankFeedSync().' + ); + } + + if (requestParameters['sourceAccountId'] == null) { + throw new runtime.RequiredError( + 'sourceAccountId', + 'Required parameter "sourceAccountId" was null or undefined when calling getManagedBankFeedSync().' + ); + } + + if (requestParameters['syncId'] == null) { + throw new runtime.RequiredError( + 'syncId', + 'Required parameter "syncId" was null or undefined when calling getManagedBankFeedSync().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs/{syncId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"sourceAccountId"}}`, encodeURIComponent(String(requestParameters['sourceAccountId']))).replace(`{${"syncId"}}`, encodeURIComponent(String(requestParameters['syncId']))), + method: 'GET', + operationId: 'get-managed-bank-feed-sync', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SyncStatusResultFromJSON(jsonValue)); + } + + /** + * The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given \'syncId\'. A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. + * Get sync + */ + async getSync(requestParameters: GetManagedBankFeedSyncRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getManagedBankFeedSyncRaw(requestParameters, options); + return await response.value(); + } + + /** + * The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. + * Run ad-hoc sync + */ + private async runManagedBankFeedAdHocSyncRaw(requestParameters: RunManagedBankFeedAdHocSyncRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling runManagedBankFeedAdHocSync().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling runManagedBankFeedAdHocSync().' + ); + } + + if (requestParameters['sourceAccountId'] == null) { + throw new runtime.RequiredError( + 'sourceAccountId', + 'Required parameter "sourceAccountId" was null or undefined when calling runManagedBankFeedAdHocSync().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"sourceAccountId"}}`, encodeURIComponent(String(requestParameters['sourceAccountId']))), + method: 'POST', + operationId: 'run-managed-bank-feed-ad-hoc-sync', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => StartScheduledSyncResultFromJSON(jsonValue)); + } + + /** + * The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company\'s accounting software. Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. + * Run ad-hoc sync + */ + async runAdHocSync(requestParameters: RunManagedBankFeedAdHocSyncRequest, options?: runtime.RequestOptions): Promise { + const response = await this.runManagedBankFeedAdHocSyncRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/SourceAccounts.ts b/bank-feeds/src/apis/SourceAccounts.ts new file mode 100644 index 000000000..99a421a37 --- /dev/null +++ b/bank-feeds/src/apis/SourceAccounts.ts @@ -0,0 +1,526 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type * as operations from '../sdk/models/_speakeasy_operations'; +import type { + BankAccountCredentials, + CreateBatchSourceAccount201ResponseInner, + CreateBatchSourceAccount207ResponseInner, + CreateBatchSourceAccountRequestBody, + CreateSourceAccount200Response, + CreateSourceAccountRequestBody, + ErrorMessage, + GenerateOtpResponse, + ListSourceAccounts200Response, + SourceAccount, + SourceAccountPrototype, + SourceAccountV2Prototype, +} from '../sdk/models/index'; +import { + BankAccountCredentialsFromJSON, + BankAccountCredentialsToJSON, + CreateBatchSourceAccount201ResponseInnerFromJSON, + CreateBatchSourceAccount201ResponseInnerToJSON, + CreateBatchSourceAccount207ResponseInnerFromJSON, + CreateBatchSourceAccount207ResponseInnerToJSON, + CreateBatchSourceAccountRequestBodyFromJSON, + CreateBatchSourceAccountRequestBodyToJSON, + CreateSourceAccount200ResponseFromJSON, + CreateSourceAccount200ResponseToJSON, + CreateSourceAccountRequestBodyFromJSON, + CreateSourceAccountRequestBodyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + GenerateOtpResponseFromJSON, + GenerateOtpResponseToJSON, + ListSourceAccounts200ResponseFromJSON, + ListSourceAccounts200ResponseToJSON, + SourceAccountFromJSON, + SourceAccountToJSON, + SourceAccountPrototypeFromJSON, + SourceAccountPrototypeToJSON, + SourceAccountV2PrototypeFromJSON, + SourceAccountV2PrototypeToJSON, +} from '../sdk/models/index'; + +export interface CreateBatchSourceAccountRequest { + companyId: string; + connectionId: string; + requestBody?: Array | Array | null; +} + +export interface CreateSourceAccountRequest { + companyId: string; + connectionId: string; + requestBody?: CreateSourceAccountRequestBody; +} + +export interface DeleteBankFeedCredentialsRequest { + companyId: string; + connectionId: string; +} + +export interface DeleteSourceAccountRequest { + companyId: string; + connectionId: string; + accountId: string; +} + +export interface GenerateCredentialsRequest { + companyId: string; + connectionId: string; + requestBody?: ReadableStream | Blob | ArrayBuffer | Uint8Array; +} + +export interface GenerateOtpRequest { + companyId: string; + connectionId: string; +} + +export interface ListSourceAccountsRequest { + companyId: string; + connectionId: string; +} + +export interface UpdateSourceAccountRequest { + companyId: string; + connectionId: string; + accountId: string; + sourceAccount?: SourceAccount; +} + +/** + * + */ +export class SourceAccounts extends runtime.BaseAPI { + + /** + * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB\'s bank accounts within Codat\'s domain. The company can then map the source account to an existing or new target account in their accounting software. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * Create source accounts + */ + private async createBatchSourceAccountRaw(requestParameters: CreateBatchSourceAccountRequest, options?: runtime.RequestOptions): Promise>> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBatchSourceAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBatchSourceAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/batch`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-batch-source-account', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'] as any, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CreateBatchSourceAccount201ResponseInnerFromJSON)); + } + + /** + * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB\'s bank accounts within Codat\'s domain. The company can then map the source account to an existing or new target account in their accounting software. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * Create source accounts + */ + async createBatch(requestParameters: CreateBatchSourceAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBatchSourceAccountRaw(requestParameters, options); + return await response.value(); + } + + /** + * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat\'s domain. The company can then map the source account to an existing or new target account in their accounting software. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * Create single source account + */ + private async createSourceAccountRaw(requestParameters: CreateSourceAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createSourceAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createSourceAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-source-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateSourceAccountRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateSourceAccount200ResponseFromJSON(jsonValue)); + } + + /** + * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat\'s domain. The company can then map the source account to an existing or new target account in their accounting software. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * Create single source account + */ + async create(requestParameters: CreateSourceAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createSourceAccountRaw(requestParameters, options); + return await response.value(); + } + + /** + * The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. + * Delete all source account credentials + */ + private async deleteBankFeedCredentialsRaw(requestParameters: DeleteBankFeedCredentialsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteBankFeedCredentials().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteBankFeedCredentials().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/credentials`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'DELETE', + operationId: 'delete-bank-feed-credentials', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. + * Delete all source account credentials + */ + async deleteCredentials(requestParameters: DeleteBankFeedCredentialsRequest, options?: runtime.RequestOptions): Promise { + await this.deleteBankFeedCredentialsRaw(requestParameters, options); + } + + /** + * The _Delete source account_ endpoint enables you to remove a source account. Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. + * Delete source account + */ + private async deleteSourceAccountRaw(requestParameters: DeleteSourceAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteSourceAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteSourceAccount().' + ); + } + + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling deleteSourceAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/{accountId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))), + method: 'DELETE', + operationId: 'delete-source-account', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The _Delete source account_ endpoint enables you to remove a source account. Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. + * Delete source account + */ + async delete(requestParameters: DeleteSourceAccountRequest, options?: runtime.RequestOptions): Promise { + await this.deleteSourceAccountRaw(requestParameters, options); + } + + /** + * The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. > **For QuickBooks Online only** > > Only call this endpoint when onboarding SMBs that use QuickBooks Online. + * Generate source account credentials + */ + private async generateCredentialsRaw(requestParameters: GenerateCredentialsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling generateCredentials().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling generateCredentials().' + ); + } + + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling generateCredentials().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/credentials`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'generate-credentials', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'] as any, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BankAccountCredentialsFromJSON(jsonValue)); + } + + /** + * The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. > **For QuickBooks Online only** > > Only call this endpoint when onboarding SMBs that use QuickBooks Online. + * Generate source account credentials + */ + async generateCredentials(requestParameters: GenerateCredentialsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.generateCredentialsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. > **For Sage only** > > Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. + * Generate one-time password + */ + private async generateOtpRaw(requestParameters: GenerateOtpRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling generateOtp().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling generateOtp().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/bankFeeds/otp`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'generate-otp', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => GenerateOtpResponseFromJSON(jsonValue)); + } + + /** + * The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. > **For Sage only** > > Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. + * Generate one-time password + */ + async generateOtp(requestParameters: GenerateOtpRequest, options?: runtime.RequestOptions): Promise { + const response = await this.generateOtpRaw(requestParameters, options); + return await response.value(); + } + + /** + * The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company\'s connection. [Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank\'s bank account within Codat\'s domain from which transactions are synced into the accounting platform. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * List source accounts + */ + private async listSourceAccountsRaw(requestParameters: ListSourceAccountsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listSourceAccounts().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listSourceAccounts().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'list-source-accounts', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListSourceAccounts200ResponseFromJSON(jsonValue)); + } + + /** + * The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company\'s connection. [Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank\'s bank account within Codat\'s domain from which transactions are synced into the accounting platform. > ### Versioning > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * List source accounts + */ + async list(requestParameters: ListSourceAccountsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listSourceAccountsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. ### Tips and pitfalls * This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. * The `status` field can only be updated to \'disconnected\'. * The `balance` field can only be updated on accounts that are **not** \'connected\'. * Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. + * Update source account + */ + private async updateSourceAccountRaw(requestParameters: UpdateSourceAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateSourceAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateSourceAccount().' + ); + } + + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling updateSourceAccount().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/{accountId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))), + method: 'PATCH', + operationId: 'update-source-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SourceAccountToJSON(requestParameters['sourceAccount']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SourceAccountFromJSON(jsonValue)); + } + + /** + * The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. ### Tips and pitfalls * This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. * The `status` field can only be updated to \'disconnected\'. * The `balance` field can only be updated on accounts that are **not** \'connected\'. * Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. + * Update source account + */ + async update(requestParameters: UpdateSourceAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateSourceAccountRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/Transactions.ts b/bank-feeds/src/apis/Transactions.ts new file mode 100644 index 000000000..cc692c841 --- /dev/null +++ b/bank-feeds/src/apis/Transactions.ts @@ -0,0 +1,308 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CreateBankTransactions, + CreateBankTransactionsResponse, + ErrorMessage, + PushOperation, + PushOperations, + PushOption, +} from '../sdk/models/index'; +import { + CreateBankTransactionsFromJSON, + CreateBankTransactionsToJSON, + CreateBankTransactionsResponseFromJSON, + CreateBankTransactionsResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOperationFromJSON, + PushOperationToJSON, + PushOperationsFromJSON, + PushOperationsToJSON, + PushOptionFromJSON, + PushOptionToJSON, +} from '../sdk/models/index'; + +export interface CreateBankTransactionsRequest { + companyId: string; + connectionId: string; + accountId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + createBankTransactions?: CreateBankTransactions; +} + +export interface GetCreateBankTransactionsModelRequest { + companyId: string; + connectionId: string; + accountId: string; +} + +export interface GetCreateOperationRequest { + companyId: string; + pushOperationKey: string; +} + +export interface ListCreateOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +/** + * + */ +export class Transactions extends runtime.BaseAPI { + + /** + * The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company\'s connection. [Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB\'s bank account. **Integration-specific behavior** The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. + * Create bank transactions + */ + private async createBankTransactionsRaw(requestParameters: CreateBankTransactionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBankTransactions().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBankTransactions().' + ); + } + + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling createBankTransactions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))), + method: 'POST', + operationId: 'create-bank-transactions', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateBankTransactionsToJSON(requestParameters['createBankTransactions']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateBankTransactionsResponseFromJSON(jsonValue)); + } + + /** + * The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company\'s connection. [Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB\'s bank account. **Integration-specific behavior** The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. + * Create bank transactions + */ + async create(requestParameters: CreateBankTransactionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBankTransactionsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB\'s bank account. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create bank transactions model + */ + private async getCreateBankTransactionsModelRaw(requestParameters: GetCreateBankTransactionsModelRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateBankTransactionsModel().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCreateBankTransactionsModel().' + ); + } + + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getCreateBankTransactionsModel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))), + method: 'GET', + operationId: 'get-create-bank-transactions-model', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOptionFromJSON(jsonValue)); + } + + /** + * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB\'s bank account. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create bank transactions model + */ + async getCreateModel(requestParameters: GetCreateBankTransactionsModelRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateBankTransactionsModelRaw(requestParameters, options); + return await response.value(); + } + + /** + * The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. For bank feeds, your push operations will only relate to the `bankTransactions` data type. + * Get create operation + */ + private async getCreateOperationRaw(requestParameters: GetCreateOperationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateOperation().' + ); + } + + if (requestParameters['pushOperationKey'] == null) { + throw new runtime.RequiredError( + 'pushOperationKey', + 'Required parameter "pushOperationKey" was null or undefined when calling getCreateOperation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push/{pushOperationKey}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"pushOperationKey"}}`, encodeURIComponent(String(requestParameters['pushOperationKey']))), + method: 'GET', + operationId: 'get-create-operation', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationFromJSON(jsonValue)); + } + + /** + * The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. For bank feeds, your push operations will only relate to the `bankTransactions` data type. + * Get create operation + */ + async getCreateOperation(requestParameters: GetCreateOperationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateOperationRaw(requestParameters, options); + return await response.value(); + } + + /** + * The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. + * List create operations + */ + private async listCreateOperationsRaw(requestParameters: ListCreateOperationsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listCreateOperations().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-create-operations', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationsFromJSON(jsonValue)); + } + + /** + * The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. + * List create operations + */ + async listCreateOperations(requestParameters: ListCreateOperationsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listCreateOperationsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/bank-feeds/src/apis/index.ts b/bank-feeds/src/apis/index.ts new file mode 100644 index 000000000..1c0e6ffc0 --- /dev/null +++ b/bank-feeds/src/apis/index.ts @@ -0,0 +1,10 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AccountMapping'; +export * from './BankAccounts'; +export * from './Companies'; +export * from './CompanyInformation'; +export * from './Connections'; +export * from './ManagedBankFeeds'; +export * from './SourceAccounts'; +export * from './Transactions'; diff --git a/bank-feeds/src/core.ts b/bank-feeds/src/core.ts index 1dae31b24..0dff3ec0c 100644 --- a/bank-feeds/src/core.ts +++ b/bank-feeds/src/core.ts @@ -1,13 +1,4 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { ClientSDK } from "./lib/sdks.js"; - -/** - * A minimal client to use when calling standalone SDK functions. Typically, an - * instance of this class would be instantiated once at the start of an - * application and passed around through some dependency injection mechanism to - * parts of an application that need to make SDK calls. - */ -export class CodatBankFeedsCore extends ClientSDK {} +export { CodatBankFeeds, CodatBankFeeds as CodatBankFeedsCore } from './sdk'; diff --git a/bank-feeds/src/funcs/_adapter.ts b/bank-feeds/src/funcs/_adapter.ts new file mode 100644 index 000000000..56e5acd53 --- /dev/null +++ b/bank-feeds/src/funcs/_adapter.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ + +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; + +export async function toResult(call: () => Promise): Promise> { + try { + return OK(await call()); + } catch (err) { + return ERR(err instanceof Error ? err : new Error(String(err))); + } +} diff --git a/bank-feeds/src/funcs/accountMappingCreate.ts b/bank-feeds/src/funcs/accountMappingCreate.ts index 87afa539d..81fa5dc3c 100644 --- a/bank-feeds/src/funcs/accountMappingCreate.ts +++ b/bank-feeds/src/funcs/accountMappingCreate.ts @@ -1,239 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bank feed account mapping - * - * @remarks - * The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). - * - * A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - * - * To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. - * - * > **For custom builds only** - * > - * > Only use this endpoint if you are building your own account management UI. - * - * #### Account mapping variability - * - * The method of mapping the source account to the target account varies depending on the accounting software your company uses. - * - * #### Mapping options: - * - * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - * - * ### Integration-specific behavior - * - * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - * | --------------------- | ----------- | ---------------- | --------------------------- | - * | Xero | ✅ | ✅ | | - * | FreeAgent | ✅ | ✅ | | - * | Oracle NetSuite | ✅ | ✅ | | - * | Exact Online (NL) | ✅ | ✅ | | - * | QuickBooks Online | | | ✅ | - * | Sage | | | ✅ | - */ -export function accountMappingCreate( - client: CodatBankFeedsCore, - request: operations.CreateBankAccountMappingRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BankFeedAccountMappingResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateBankAccountMappingRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BankFeedAccountMappingResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateBankAccountMappingRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.BankFeedAccountMapping, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bank-account-mapping", - oAuth2Scopes: null, +type Call = CodatBankFeeds["accountMapping"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BankFeedAccountMappingResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.BankFeedAccountMappingResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function accountMappingCreate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.accountMapping.create(request, options))); } diff --git a/bank-feeds/src/funcs/accountMappingGet.ts b/bank-feeds/src/funcs/accountMappingGet.ts index f773c9d0a..454c1d116 100644 --- a/bank-feeds/src/funcs/accountMappingGet.ts +++ b/bank-feeds/src/funcs/accountMappingGet.ts @@ -1,200 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List bank feed accounts - * - * @remarks - * The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. - * - * A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - * - * > **For custom builds only** - * > - * > Only use this endpoint if you are building your own account management UI. - */ -export function accountMappingGet( - client: CodatBankFeedsCore, - request: operations.GetBankAccountMappingRequest, - options?: RequestOptions, -): APIPromise< - Result< - Array, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetBankAccountMappingRequest, - options?: RequestOptions, -): Promise< - [ - Result< - Array, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetBankAccountMappingRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-bank-account-mapping", - oAuth2Scopes: null, +type Call = CodatBankFeeds["accountMapping"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - Array, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, z.array(shared.BankFeedMapping$inboundSchema)), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function accountMappingGet( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.accountMapping.get(request, options))); } diff --git a/bank-feeds/src/funcs/bankAccountsCreate.ts b/bank-feeds/src/funcs/bankAccountsCreate.ts index 05bbe2119..9cdddbd74 100644 --- a/bank-feeds/src/funcs/bankAccountsCreate.ts +++ b/bank-feeds/src/funcs/bankAccountsCreate.ts @@ -1,220 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). - */ -export function bankAccountsCreate( - client: CodatBankFeedsCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BankAccountCreateResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BankAccountCreateResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateBankAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.bankAccountPrototype, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", - )(pathParams); - - const query = encodeFormQuery({ - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bank-account", - oAuth2Scopes: null, +type Call = CodatBankFeeds["bankAccounts"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BankAccountCreateResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.BankAccountCreateResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsCreate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.create(request, options))); } diff --git a/bank-feeds/src/funcs/bankAccountsGetCreateModel.ts b/bank-feeds/src/funcs/bankAccountsGetCreateModel.ts index b5af064e9..87851c3e4 100644 --- a/bank-feeds/src/funcs/bankAccountsGetCreateModel.ts +++ b/bank-feeds/src/funcs/bankAccountsGetCreateModel.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get create/update bank account model - * - * @remarks - * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ -export function bankAccountsGetCreateModel( - client: CodatBankFeedsCore, - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCreateBankAccountsModelRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-bankAccounts-model", - oAuth2Scopes: null, +type Call = CodatBankFeeds["bankAccounts"]["getCreateModel"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOption$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsGetCreateModel( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.getCreateModel(request, options))); } diff --git a/bank-feeds/src/funcs/bankAccountsList.ts b/bank-feeds/src/funcs/bankAccountsList.ts index cd9b297a3..5743b727d 100644 --- a/bank-feeds/src/funcs/bankAccountsList.ts +++ b/bank-feeds/src/funcs/bankAccountsList.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List bank accounts - * - * @remarks - * The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). - */ -export function bankAccountsList( - client: CodatBankFeedsCore, - request: operations.ListBankAccountsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BankAccounts, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.ListBankAccountsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BankAccounts, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListBankAccountsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", - )(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-bank-accounts", - oAuth2Scopes: null, +type Call = CodatBankFeeds["bankAccounts"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BankAccounts, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.BankAccounts$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsList( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.list(request, options))); } diff --git a/bank-feeds/src/funcs/companiesCreate.ts b/bank-feeds/src/funcs/companiesCreate.ts index 7e7a1db6d..48b1d7b40 100644 --- a/bank-feeds/src/funcs/companiesCreate.ts +++ b/bank-feeds/src/funcs/companiesCreate.ts @@ -1,187 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ -export function companiesCreate( - client: CodatBankFeedsCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.CompanyRequestBody$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/companies")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-company", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "402", "403", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesCreate( + client: CodatBankFeedsCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.create(request, options))); } diff --git a/bank-feeds/src/funcs/companiesDelete.ts b/bank-feeds/src/funcs/companiesDelete.ts index 02b1e6e41..21b31e3a9 100644 --- a/bank-feeds/src/funcs/companiesDelete.ts +++ b/bank-feeds/src/funcs/companiesDelete.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesDelete( - client: CodatBankFeedsCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-company", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesDelete( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.delete(request, options))); } diff --git a/bank-feeds/src/funcs/companiesGet.ts b/bank-feeds/src/funcs/companiesGet.ts index 545071735..e18c59bc9 100644 --- a/bank-feeds/src/funcs/companiesGet.ts +++ b/bank-feeds/src/funcs/companiesGet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesGet( - client: CodatBankFeedsCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGet( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.get(request, options))); } diff --git a/bank-feeds/src/funcs/companiesGetAccessToken.ts b/bank-feeds/src/funcs/companiesGetAccessToken.ts index 1bcac1174..1c55c1397 100644 --- a/bank-feeds/src/funcs/companiesGetAccessToken.ts +++ b/bank-feeds/src/funcs/companiesGetAccessToken.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company access token - * - * @remarks - * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - * - * The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - */ -export function companiesGetAccessToken( - client: CodatBankFeedsCore, - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyAccessTokenRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/accessToken")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-access-token", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["getAccessToken"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyAccessToken$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGetAccessToken( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.getAccessToken(request, options))); } diff --git a/bank-feeds/src/funcs/companiesList.ts b/bank-feeds/src/funcs/companiesList.ts index 15527202b..6a418019a 100644 --- a/bank-feeds/src/funcs/companiesList.ts +++ b/bank-feeds/src/funcs/companiesList.ts @@ -1,220 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ -export function companiesList( - client: CodatBankFeedsCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Companies, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Companies, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCompaniesRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/companies")(); - - const query = encodeFormQuery({ - "orderBy": payload?.orderBy, - "page": payload?.page, - "pageSize": payload?.pageSize, - "query": payload?.query, - "tags": payload?.tags, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-companies", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Companies, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Companies$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesList( + client: CodatBankFeedsCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.list(request, options))); } diff --git a/bank-feeds/src/funcs/companiesReplace.ts b/bank-feeds/src/funcs/companiesReplace.ts index afd29ec3c..0727db6b8 100644 --- a/bank-feeds/src/funcs/companiesReplace.ts +++ b/bank-feeds/src/funcs/companiesReplace.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesReplace( - client: CodatBankFeedsCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ReplaceCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyRequestBody, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "replace-company", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["replace"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesReplace( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.replace(request, options))); } diff --git a/bank-feeds/src/funcs/companiesUpdate.ts b/bank-feeds/src/funcs/companiesUpdate.ts index 3cc4daa53..b7dabb352 100644 --- a/bank-feeds/src/funcs/companiesUpdate.ts +++ b/bank-feeds/src/funcs/companiesUpdate.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - */ -export function companiesUpdate( - client: CodatBankFeedsCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyUpdateRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-company", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companies"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesUpdate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.update(request, options))); } diff --git a/bank-feeds/src/funcs/companyInformationGet.ts b/bank-feeds/src/funcs/companyInformationGet.ts index 5b69982a2..deee044c7 100644 --- a/bank-feeds/src/funcs/companyInformationGet.ts +++ b/bank-feeds/src/funcs/companyInformationGet.ts @@ -1,217 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company information - * - * @remarks - * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | Oracle NetSuite | Yes | - * | Xero | Yes | - * | Exact | No | - * | FreeAgent | No | - * | Sage | No | - * | QuickBooks Online | No | - */ -export function companyInformationGet( - client: CodatBankFeedsCore, - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyInformationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeeds/info", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-information", - oAuth2Scopes: null, +type Call = CodatBankFeeds["companyInformation"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyInformation$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companyInformationGet( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companyInformation.get(request, options))); } diff --git a/bank-feeds/src/funcs/connectionsCreate.ts b/bank-feeds/src/funcs/connectionsCreate.ts index 873af2039..b14babc09 100644 --- a/bank-feeds/src/funcs/connectionsCreate.ts +++ b/bank-feeds/src/funcs/connectionsCreate.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ -export function connectionsCreate( - client: CodatBankFeedsCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-connection", - oAuth2Scopes: null, +type Call = CodatBankFeeds["connections"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsCreate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.create(request, options))); } diff --git a/bank-feeds/src/funcs/connectionsDelete.ts b/bank-feeds/src/funcs/connectionsDelete.ts index 96b51de66..e91f38215 100644 --- a/bank-feeds/src/funcs/connectionsDelete.ts +++ b/bank-feeds/src/funcs/connectionsDelete.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete connection - * - * @remarks - * Revoke and remove a connection from a company. - * This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - */ -export function connectionsDelete( - client: CodatBankFeedsCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-connection", - oAuth2Scopes: null, +type Call = CodatBankFeeds["connections"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(200, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsDelete( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.delete(request, options))); } diff --git a/bank-feeds/src/funcs/connectionsGet.ts b/bank-feeds/src/funcs/connectionsGet.ts index c943432c6..5a71eaf94 100644 --- a/bank-feeds/src/funcs/connectionsGet.ts +++ b/bank-feeds/src/funcs/connectionsGet.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get connection - * - * @remarks - * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - */ -export function connectionsGet( - client: CodatBankFeedsCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection", - oAuth2Scopes: null, +type Call = CodatBankFeeds["connections"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsGet( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.get(request, options))); } diff --git a/bank-feeds/src/funcs/connectionsList.ts b/bank-feeds/src/funcs/connectionsList.ts index 1a005b025..b979ebe9f 100644 --- a/bank-feeds/src/funcs/connectionsList.ts +++ b/bank-feeds/src/funcs/connectionsList.ts @@ -1,208 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List connections - * - * @remarks - * List the connections for a company. - */ -export function connectionsList( - client: CodatBankFeedsCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connections, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connections, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListConnectionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-connections", - oAuth2Scopes: null, +type Call = CodatBankFeeds["connections"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connections, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connections$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsList( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.list(request, options))); } diff --git a/bank-feeds/src/funcs/connectionsUnlink.ts b/bank-feeds/src/funcs/connectionsUnlink.ts index 6ec90b312..706db2ed9 100644 --- a/bank-feeds/src/funcs/connectionsUnlink.ts +++ b/bank-feeds/src/funcs/connectionsUnlink.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Unlink connection - * - * @remarks - * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - */ -export function connectionsUnlink( - client: CodatBankFeedsCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UnlinkConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "unlink-connection", - oAuth2Scopes: null, +type Call = CodatBankFeeds["connections"]["unlink"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsUnlink( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.unlink(request, options))); } diff --git a/bank-feeds/src/funcs/managedBankFeedsGetLatestSync.ts b/bank-feeds/src/funcs/managedBankFeedsGetLatestSync.ts index 431765f86..3891f8e37 100644 --- a/bank-feeds/src/funcs/managedBankFeedsGetLatestSync.ts +++ b/bank-feeds/src/funcs/managedBankFeedsGetLatestSync.ts @@ -1,202 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get latest sync - * - * @remarks - * The _Get latest sync_ endpoint returns the status for a given source account's [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - */ -export function managedBankFeedsGetLatestSync( - client: CodatBankFeedsCore, - request: operations.GetLatestManagedBankFeedSyncRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.SyncStatusResult | undefined, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetLatestManagedBankFeedSyncRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.SyncStatusResult | undefined, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetLatestManagedBankFeedSyncRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - sourceAccountId: encodeSimple("sourceAccountId", payload.sourceAccountId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs/latest", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-latest-managed-bank-feed-sync", - oAuth2Scopes: null, +type Call = CodatBankFeeds["managedBankFeeds"]["getLatestSync"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.SyncStatusResult | undefined, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.SyncStatusResult$inboundSchema.optional()), - M.nil(204, shared.SyncStatusResult$inboundSchema.optional()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function managedBankFeedsGetLatestSync( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.managedBankFeeds.getLatestSync(request, options))); } diff --git a/bank-feeds/src/funcs/managedBankFeedsGetSync.ts b/bank-feeds/src/funcs/managedBankFeedsGetSync.ts index 50f342967..ee7d88fcf 100644 --- a/bank-feeds/src/funcs/managedBankFeedsGetSync.ts +++ b/bank-feeds/src/funcs/managedBankFeedsGetSync.ts @@ -1,203 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get sync - * - * @remarks - * The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given 'syncId'. - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - */ -export function managedBankFeedsGetSync( - client: CodatBankFeedsCore, - request: operations.GetManagedBankFeedSyncRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.SyncStatusResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetManagedBankFeedSyncRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.SyncStatusResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetManagedBankFeedSyncRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - sourceAccountId: encodeSimple("sourceAccountId", payload.sourceAccountId, { - explode: false, - charEncoding: "percent", - }), - syncId: encodeSimple("syncId", payload.syncId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs/{syncId}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-managed-bank-feed-sync", - oAuth2Scopes: null, +type Call = CodatBankFeeds["managedBankFeeds"]["getSync"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.SyncStatusResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.SyncStatusResult$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function managedBankFeedsGetSync( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.managedBankFeeds.getSync(request, options))); } diff --git a/bank-feeds/src/funcs/managedBankFeedsRunAdHocSync.ts b/bank-feeds/src/funcs/managedBankFeedsRunAdHocSync.ts index 977838206..a35d78baf 100644 --- a/bank-feeds/src/funcs/managedBankFeedsRunAdHocSync.ts +++ b/bank-feeds/src/funcs/managedBankFeedsRunAdHocSync.ts @@ -1,216 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Run ad-hoc sync - * - * @remarks - * The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - * - * Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. - */ -export function managedBankFeedsRunAdHocSync( - client: CodatBankFeedsCore, - request: operations.RunManagedBankFeedAdHocSyncRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.StartScheduledSyncResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.RunManagedBankFeedAdHocSyncRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.StartScheduledSyncResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RunManagedBankFeedAdHocSyncRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - sourceAccountId: encodeSimple("sourceAccountId", payload.sourceAccountId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/{sourceAccountId}/managedBankFeeds/syncs", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "run-managed-bank-feed-ad-hoc-sync", - oAuth2Scopes: null, +type Call = CodatBankFeeds["managedBankFeeds"]["runAdHocSync"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.StartScheduledSyncResult, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.StartScheduledSyncResult$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function managedBankFeedsRunAdHocSync( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.managedBankFeeds.runAdHocSync(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsCreate.ts b/bank-feeds/src/funcs/sourceAccountsCreate.ts index d0bd398eb..8e546444d 100644 --- a/bank-feeds/src/funcs/sourceAccountsCreate.ts +++ b/bank-feeds/src/funcs/sourceAccountsCreate.ts @@ -1,210 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create single source account - * - * @remarks - * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ -export function sourceAccountsCreate( - client: CodatBankFeedsCore, - request: operations.CreateSourceAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateSourceAccountResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateSourceAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateSourceAccountResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateSourceAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-source-account", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateSourceAccountResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateSourceAccountResponseBody$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsCreate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.create(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsCreateBatch.ts b/bank-feeds/src/funcs/sourceAccountsCreateBatch.ts index 3334dbc33..24a40d92c 100644 --- a/bank-feeds/src/funcs/sourceAccountsCreateBatch.ts +++ b/bank-feeds/src/funcs/sourceAccountsCreateBatch.ts @@ -1,212 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create source accounts - * - * @remarks - * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ -export function sourceAccountsCreateBatch( - client: CodatBankFeedsCore, - request: operations.CreateBatchSourceAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateBatchSourceAccountResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateBatchSourceAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateBatchSourceAccountResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateBatchSourceAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/batch", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-batch-source-account", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["createBatch"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateBatchSourceAccountResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, operations.CreateBatchSourceAccountResponse$inboundSchema), - M.json(207, operations.CreateBatchSourceAccountResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail([409, "4XX"]), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsCreateBatch( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.createBatch(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsDelete.ts b/bank-feeds/src/funcs/sourceAccountsDelete.ts index f5a7b697b..f729513be 100644 --- a/bank-feeds/src/funcs/sourceAccountsDelete.ts +++ b/bank-feeds/src/funcs/sourceAccountsDelete.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete source account - * - * @remarks - * The _Delete source account_ endpoint enables you to remove a source account. - * - * Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. - */ -export function sourceAccountsDelete( - client: CodatBankFeedsCore, - request: operations.DeleteSourceAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.DeleteSourceAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DeleteSourceAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - accountId: encodeSimple("accountId", payload.accountId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/{accountId}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-source-account", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsDelete( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.delete(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsDeleteCredentials.ts b/bank-feeds/src/funcs/sourceAccountsDeleteCredentials.ts index 727a5d231..4758eb1ed 100644 --- a/bank-feeds/src/funcs/sourceAccountsDeleteCredentials.ts +++ b/bank-feeds/src/funcs/sourceAccountsDeleteCredentials.ts @@ -1,195 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete all source account credentials - * - * @remarks - * The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. - * - * In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. - */ -export function sourceAccountsDeleteCredentials( - client: CodatBankFeedsCore, - request: operations.DeleteBankFeedCredentialsRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.DeleteBankFeedCredentialsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DeleteBankFeedCredentialsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/credentials", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-bank-feed-credentials", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["deleteCredentials"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsDeleteCredentials( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.deleteCredentials(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsGenerateCredentials.ts b/bank-feeds/src/funcs/sourceAccountsGenerateCredentials.ts index e63f500a2..2e50e6669 100644 --- a/bank-feeds/src/funcs/sourceAccountsGenerateCredentials.ts +++ b/bank-feeds/src/funcs/sourceAccountsGenerateCredentials.ts @@ -1,200 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Generate source account credentials - * - * @remarks - * The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. - * - * The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. - * - * > **For QuickBooks Online only** - * > - * > Only call this endpoint when onboarding SMBs that use QuickBooks Online. - */ -export function sourceAccountsGenerateCredentials( - client: CodatBankFeedsCore, - request: operations.GenerateCredentialsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.BankAccountCredentials, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GenerateCredentialsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.BankAccountCredentials, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GenerateCredentialsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/credentials", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "generate-credentials", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["generateCredentials"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.BankAccountCredentials, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.BankAccountCredentials$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsGenerateCredentials( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.generateCredentials(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsGenerateOtp.ts b/bank-feeds/src/funcs/sourceAccountsGenerateOtp.ts index b7272f79e..e1149e6f3 100644 --- a/bank-feeds/src/funcs/sourceAccountsGenerateOtp.ts +++ b/bank-feeds/src/funcs/sourceAccountsGenerateOtp.ts @@ -1,210 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Generate one-time password - * - * @remarks - * The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. - * - * > **For Sage only** - * > - * > Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. - */ -export function sourceAccountsGenerateOtp( - client: CodatBankFeedsCore, - request: operations.GenerateOtpRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.GenerateOtpResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GenerateOtpRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.GenerateOtpResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GenerateOtpRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/bankFeeds/otp", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "generate-otp", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["generateOtp"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.GenerateOtpResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.GenerateOtpResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsGenerateOtp( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.generateOtp(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsList.ts b/bank-feeds/src/funcs/sourceAccountsList.ts index 27729b81b..c2e518cfc 100644 --- a/bank-feeds/src/funcs/sourceAccountsList.ts +++ b/bank-feeds/src/funcs/sourceAccountsList.ts @@ -1,196 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List source accounts - * - * @remarks - * The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company's connection. - * - * [Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank's bank account within Codat's domain from which transactions are synced into the accounting platform. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ -export function sourceAccountsList( - client: CodatBankFeedsCore, - request: operations.ListSourceAccountsRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListSourceAccountsResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.ListSourceAccountsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListSourceAccountsResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListSourceAccountsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-source-accounts", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListSourceAccountsResponseBody, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListSourceAccountsResponseBody$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsList( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.list(request, options))); } diff --git a/bank-feeds/src/funcs/sourceAccountsUpdate.ts b/bank-feeds/src/funcs/sourceAccountsUpdate.ts index ba81169e5..37501638a 100644 --- a/bank-feeds/src/funcs/sourceAccountsUpdate.ts +++ b/bank-feeds/src/funcs/sourceAccountsUpdate.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update source account - * - * @remarks - * The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. - * - * ### Tips and pitfalls - * - * * This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. - * * The `status` field can only be updated to 'disconnected'. - * * The `balance` field can only be updated on accounts that are **not** 'connected'. - * * Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. - */ -export function sourceAccountsUpdate( - client: CodatBankFeedsCore, - request: operations.UpdateSourceAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.SourceAccount, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.UpdateSourceAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.SourceAccount, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateSourceAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.SourceAccount, { explode: true }); - - const pathParams = { - accountId: encodeSimple("accountId", payload.accountId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/{accountId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-source-account", - oAuth2Scopes: null, +type Call = CodatBankFeeds["sourceAccounts"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.SourceAccount, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.SourceAccount$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function sourceAccountsUpdate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sourceAccounts.update(request, options))); } diff --git a/bank-feeds/src/funcs/transactionsCreate.ts b/bank-feeds/src/funcs/transactionsCreate.ts index 26442c921..34172168c 100644 --- a/bank-feeds/src/funcs/transactionsCreate.ts +++ b/bank-feeds/src/funcs/transactionsCreate.ts @@ -1,227 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bank transactions - * - * @remarks - * The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company's connection. - * - * [Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB's bank account. - * - * **Integration-specific behavior** - * - * The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. - * Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. - */ -export function transactionsCreate( - client: CodatBankFeedsCore, - request: operations.CreateBankTransactionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateBankTransactionsResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.CreateBankTransactionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateBankTransactionsResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateBankTransactionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CreateBankTransactions, { - explode: true, - }); - - const pathParams = { - accountId: encodeSimple("accountId", payload.accountId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bank-transactions", - oAuth2Scopes: null, +type Call = CodatBankFeeds["transactions"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateBankTransactionsResponse, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateBankTransactionsResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionsCreate( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactions.create(request, options))); } diff --git a/bank-feeds/src/funcs/transactionsGetCreateModel.ts b/bank-feeds/src/funcs/transactionsGetCreateModel.ts index 02d7357d7..de2c3e9f3 100644 --- a/bank-feeds/src/funcs/transactionsGetCreateModel.ts +++ b/bank-feeds/src/funcs/transactionsGetCreateModel.ts @@ -1,205 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get create bank transactions model - * - * @remarks - * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. - * - * [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ -export function transactionsGetCreateModel( - client: CodatBankFeedsCore, - request: operations.GetCreateBankTransactionsModelRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCreateBankTransactionsModelRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCreateBankTransactionsModelRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - accountId: encodeSimple("accountId", payload.accountId, { - explode: false, - charEncoding: "percent", - }), - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-bank-transactions-model", - oAuth2Scopes: null, +type Call = CodatBankFeeds["transactions"]["getCreateModel"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOption, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOption$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionsGetCreateModel( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactions.getCreateModel(request, options))); } diff --git a/bank-feeds/src/funcs/transactionsGetCreateOperation.ts b/bank-feeds/src/funcs/transactionsGetCreateOperation.ts index aba975175..746ec389e 100644 --- a/bank-feeds/src/funcs/transactionsGetCreateOperation.ts +++ b/bank-feeds/src/funcs/transactionsGetCreateOperation.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get create operation - * - * @remarks - * The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - * - * For bank feeds, your push operations will only relate to the `bankTransactions` data type. - */ -export function transactionsGetCreateOperation( - client: CodatBankFeedsCore, - request: operations.GetCreateOperationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.GetCreateOperationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCreateOperationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - pushOperationKey: encodeSimple( - "pushOperationKey", - payload.pushOperationKey, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/companies/{companyId}/push/{pushOperationKey}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-operation", - oAuth2Scopes: null, +type Call = CodatBankFeeds["transactions"]["getCreateOperation"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperation, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperation$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionsGetCreateOperation( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactions.getCreateOperation(request, options))); } diff --git a/bank-feeds/src/funcs/transactionsListCreateOperations.ts b/bank-feeds/src/funcs/transactionsListCreateOperations.ts index 7fe300d46..e29ef9684 100644 --- a/bank-feeds/src/funcs/transactionsListCreateOperations.ts +++ b/bank-feeds/src/funcs/transactionsListCreateOperations.ts @@ -1,213 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatBankFeedsError } from "../sdk/models/errors/codatbankfeedserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatBankFeeds, CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List create operations - * - * @remarks - * The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - * - * For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. - */ -export function transactionsListCreateOperations( - client: CodatBankFeedsCore, - request: operations.ListCreateOperationsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatBankFeedsCore, - request: operations.ListCreateOperationsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCreateOperationsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/push")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-create-operations", - oAuth2Scopes: null, +type Call = CodatBankFeeds["transactions"]["listCreateOperations"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperations, - | errors.ErrorMessage - | CodatBankFeedsError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperations$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionsListCreateOperations( + client: CodatBankFeedsCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactions.listCreateOperations(request, options))); } diff --git a/bank-feeds/src/funcs/validateWebhook.ts b/bank-feeds/src/funcs/validateWebhook.ts index b565cd47f..9affb78a9 100644 --- a/bank-feeds/src/funcs/validateWebhook.ts +++ b/bank-feeds/src/funcs/validateWebhook.ts @@ -1,63 +1,73 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodatBankFeedsCore } from "../core.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { ERR, Result } from "../sdk/types/fp.js"; - -export async function validateWebhook(_client: CodatBankFeedsCore, { - request: rawRequest, -}: { - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request; -}): Promise< - Result< - shared.ClientRateLimitWebhook | undefined | shared.SourceAccountWebhook, - SDKValidationError - > -> { - const request = normalizeRequest(rawRequest); - const knownSchemas = [ - shared.clientRateLimitWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - shared.sourceAccountWebhookFromJSON, - shared.sourceAccountWebhookFromJSON, - ]; - - const jsonString = await request.text(); - - for (const schema of knownSchemas) { - const ret = schema(jsonString); - if (ret.ok) { - return ret; +/* tslint:disable */ +/* eslint-disable */ + +import type { CodatBankFeedsCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror"; +import type * as shared from "../sdk/models/index"; + +type ValidateWebhookResult = shared.ClientRateLimitWebhook | shared.SourceAccountWebhook | undefined; + +type WebhookMatchSpec = + | "string" + | "number" + | "boolean" + | "any" + | { kind: "nullable"; inner: WebhookMatchSpec } + | { kind: "array"; items: WebhookMatchSpec } + | { kind: "object"; required: string[]; props: Record }; + +function conformsToWebhookSpec(value: unknown, spec: WebhookMatchSpec): boolean { + if (spec === "any") { return true; } + if (spec === "string") { return typeof value === "string"; } + if (spec === "number") { return typeof value === "number"; } + if (spec === "boolean") { return typeof value === "boolean"; } + if (spec.kind === "nullable") { return value === null || conformsToWebhookSpec(value, spec.inner); } + if (spec.kind === "array") { return Array.isArray(value) && value.every((item) => conformsToWebhookSpec(item, spec.items)); } + if (value === null || typeof value !== "object" || Array.isArray(value)) { return false; } + const object = value as Record; + for (const key of spec.required) { + if (object[key] === undefined) { return false; } + } + for (const key of Object.keys(spec.props)) { + if (object[key] === undefined) { continue; } + if (!conformsToWebhookSpec(object[key], spec.props[key])) { return false; } } - } - - return ERR( - new SDKValidationError( - "No matching schema found for the given webhook payload", - jsonString, - jsonString, - ), - ); + return true; } -function normalizeRequest( - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request, +function normalizeWebhookRequest( + request: { body: string; method: string; url: string; headers: Record | Headers } | Request, ): Request { - if (request instanceof Request) { - return request; - } - return new Request(request.url, request); + if (typeof Request !== "undefined" && request instanceof Request) { return request; } + return new Request(request.url, request); +} + +const WEBHOOK_NO_MATCH_MESSAGE = "No matching schema found for the given webhook payload"; + +const WEBHOOK_MATCH_ORDER: { name: string; spec: WebhookMatchSpec }[] = [ + { name: "ClientRateLimitWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"dailyQuota": "number", "quotaRemaining": "number", "expiryDate": "string"}}}} }, + { name: "SourceAccountWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"referenceCompany": {"kind": "object", "required": [], "props": {"id": "string", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "companyId": "string", "connectionId": "string", "sourceAccount": "any"}}}} } +]; + +export function validateWebhook(_client: CodatBankFeedsCore, { request }: { request: { body: string; method: string; url: string; headers: Record | Headers } | Request }): APIPromise> { + void _client; + return new APIPromise((async (): Promise> => { + const normalized = normalizeWebhookRequest(request); + const jsonString = await normalized.text(); + let parsed: unknown; + try { + parsed = JSON.parse(jsonString); + } catch { + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + } + for (const member of WEBHOOK_MATCH_ORDER) { + if (conformsToWebhookSpec(parsed, member.spec)) { + return OK(parsed as ValidateWebhookResult); + } + } + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + })()); } diff --git a/bank-feeds/src/hooks/hooks.ts b/bank-feeds/src/hooks/hooks.ts index d34c88497..b628a2bf8 100644 --- a/bank-feeds/src/hooks/hooks.ts +++ b/bank-feeds/src/hooks/hooks.ts @@ -1,132 +1,75 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { RequestInput } from "../lib/http.js"; import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, - SDKInitOptions, -} from "./types.js"; - -import { initHooks } from "./registration.js"; + AfterErrorContext, AfterErrorHook, AfterSuccessContext, AfterSuccessHook, + BeforeCreateRequestContext, BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, +} from "./types"; +import { RequestInput } from "../lib/sdkconfig"; +import { initHooks } from "./registration"; export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + const presetHooks: Array = []; + for (const hook of presetHooks) { + if ("sdkInit" in hook) { this.registerSDKInitHook(hook); } + if ("beforeCreateRequest" in hook) { this.registerBeforeCreateRequestHook(hook); } + if ("beforeRequest" in hook) { this.registerBeforeRequestHook(hook); } + if ("afterSuccess" in hook) { this.registerAfterSuccessHook(hook); } + if ("afterError" in hook) { this.registerAfterErrorHook(hook); } + } + initHooks(this); } - initHooks(this); - } - - registerSDKInitHook(hook: SDKInitHook) { - this.sdkInitHooks.push(hook); - } - - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { - this.beforeCreateRequestHooks.push(hook); - } - - registerBeforeRequestHook(hook: BeforeRequestHook) { - this.beforeRequestHooks.push(hook); - } - - registerAfterSuccessHook(hook: AfterSuccessHook) { - this.afterSuccessHooks.push(hook); - } - - registerAfterErrorHook(hook: AfterErrorHook) { - this.afterErrorHooks.push(hook); - } - sdkInit(opts: SDKInitOptions): SDKInitOptions { - return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); - } + registerSDKInitHook(hook: SDKInitHook) { this.sdkInitHooks.push(hook); } + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { this.beforeCreateRequestHooks.push(hook); } + registerBeforeRequestHook(hook: BeforeRequestHook) { this.beforeRequestHooks.push(hook); } + registerAfterSuccessHook(hook: AfterSuccessHook) { this.afterSuccessHooks.push(hook); } + registerAfterErrorHook(hook: AfterErrorHook) { this.afterErrorHooks.push(hook); } - beforeCreateRequest( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - let inp = input; - - for (const hook of this.beforeCreateRequestHooks) { - inp = hook.beforeCreateRequest(hookCtx, inp); + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((o, hook) => hook.sdkInit(o), opts); } - return inp; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - let req = request; - - for (const hook of this.beforeRequestHooks) { - req = await hook.beforeRequest(hookCtx, req); + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + return inp; } - return req; - } - - async afterSuccess( - hookCtx: AfterSuccessContext, - response: Response, - ): Promise { - let res = response; - - for (const hook of this.afterSuccessHooks) { - res = await hook.afterSuccess(hookCtx, res); + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + return req; } - return res; - } - - async afterError( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ): Promise<{ response: Response | null; error: unknown }> { - let res = response; - let err = error; - - for (const hook of this.afterErrorHooks) { - const result = await hook.afterError(hookCtx, res, err); - res = result.response; - err = result.error; + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + return res; } - return { response: res, error: err }; - } + async afterError(hookCtx: AfterErrorContext, response: Response | null, error: unknown): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + return { response: res, error: err }; + } } diff --git a/bank-feeds/src/hooks/index.ts b/bank-feeds/src/hooks/index.ts index f60ec7acd..ae868065a 100644 --- a/bank-feeds/src/hooks/index.ts +++ b/bank-feeds/src/hooks/index.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./hooks.js"; -export * from "./types.js"; +export * from "./hooks"; +export * from "./types"; diff --git a/bank-feeds/src/hooks/types.ts b/bank-feeds/src/hooks/types.ts index 494395f66..3818216a1 100644 --- a/bank-feeds/src/hooks/types.ts +++ b/bank-feeds/src/hooks/types.ts @@ -1,29 +1,23 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { SDKOptions } from "../lib/config.js"; -import { HTTPClient, RequestInput } from "../lib/http.js"; -import { RetryConfig } from "../lib/retries.js"; -import { SecurityState } from "../lib/security.js"; -import { WebhookRecipient } from "../sdk/types/webhooks.js"; +import { SDKOptions, RetryConfig, HTTPClient, RequestInput, SecurityState } from "../lib/sdkconfig"; + +export type Awaitable = T | Promise; export type HookContext = { - baseURL: string | URL; - operationID: string; - oAuth2Scopes: string[] | null; - webhookRecipient?: WebhookRecipient; - securitySource?: any | (() => Promise); - retryConfig: RetryConfig; - resolvedSecurity: SecurityState | null; - options: SDKOptions; + baseURL: string | URL; + operationID: string; + oAuth2Scopes: string[] | null; + securitySource?: unknown | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; + options: SDKOptions; }; -export type Awaitable = T | Promise; - export type SDKInitOptions = { - baseURL: URL | null; - client: HTTPClient; + baseURL: URL | null; + client: HTTPClient; }; export type BeforeCreateRequestContext = HookContext & {}; @@ -31,84 +25,37 @@ export type BeforeRequestContext = HookContext & {}; export type AfterSuccessContext = HookContext & {}; export type AfterErrorContext = HookContext & {}; -/** - * SDKInitHook is called when the SDK is initializing. The - * hook can return a new baseURL and HTTP client to be used by the SDK. - */ export interface SDKInitHook { - sdkInit: (opts: SDKInitOptions) => SDKInitOptions; + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; } export interface BeforeCreateRequestHook { - /** - * A hook that is called before the SDK creates a `Request` object. The hook - * can modify how a request is constructed since certain modifications, like - * changing the request URL, cannot be done on a request object directly. - */ - beforeCreateRequest: ( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ) => RequestInput; + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; } export interface BeforeRequestHook { - /** - * A hook that is called before the SDK sends a request. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * replace the request before it is sent or throw an error to stop the - * request from being sent. - */ - beforeRequest: ( - hookCtx: BeforeRequestContext, - request: Request, - ) => Awaitable; + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; } export interface AfterSuccessHook { - /** - * A hook that is called after the SDK receives a response. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * modify the response before it is handled or throw an error to stop the - * response from being handled. - */ - afterSuccess: ( - hookCtx: AfterSuccessContext, - response: Response, - ) => Awaitable; + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; } export interface AfterErrorHook { - /** - * A hook that is called after the SDK encounters an error, or a - * non-successful response. The hook can introduce instrumentation code such - * as logging, tracing and metrics or modify the response or error values. - */ - afterError: ( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ) => Awaitable<{ - response: Response | null; - error: unknown; - }>; + afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable<{ response: Response | null; error: unknown }>; } export interface Hooks { - /** Registers a hook to be used by the SDK for initialization event. */ - registerSDKInitHook(hook: SDKInitHook): void; - /** Registers a hook to be used by the SDK for to modify `Request` construction. */ - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; - /** Registers a hook to be used by the SDK for the before request event. */ - registerBeforeRequestHook(hook: BeforeRequestHook): void; - /** Registers a hook to be used by the SDK for the after success event. */ - registerAfterSuccessHook(hook: AfterSuccessHook): void; - /** Registers a hook to be used by the SDK for the after error event. */ - registerAfterErrorHook(hook: AfterErrorHook): void; + registerSDKInitHook(hook: SDKInitHook): void; + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + registerBeforeRequestHook(hook: BeforeRequestHook): void; + registerAfterSuccessHook(hook: AfterSuccessHook): void; + registerAfterErrorHook(hook: AfterErrorHook): void; } export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/bank-feeds/src/index.ts b/bank-feeds/src/index.ts index dbcba164a..52b74ba06 100644 --- a/bank-feeds/src/index.ts +++ b/bank-feeds/src/index.ts @@ -1,9 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './sdk/models/index'; +export * from './sdk/types/rfcdate'; +export * from './sdk'; +export * from './lib/sdkconfig'; diff --git a/bank-feeds/src/lib/base64.ts b/bank-feeds/src/lib/base64.ts deleted file mode 100644 index 0aebd8b0a..000000000 --- a/bank-feeds/src/lib/base64.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function bytesToBase64(u8arr: Uint8Array): string { - return btoa(String.fromCodePoint(...u8arr)); -} - -export function bytesFromBase64(encoded: string): Uint8Array { - return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); -} - -export function stringToBytes(str: string): Uint8Array { - return new TextEncoder().encode(str); -} - -export function stringFromBytes(u8arr: Uint8Array): string { - return new TextDecoder().decode(u8arr); -} - -export function stringToBase64(str: string): string { - return bytesToBase64(stringToBytes(str)); -} - -export function stringFromBase64(b64str: string): string { - return stringFromBytes(bytesFromBase64(b64str)); -} - -export const zodOutbound = z - .instanceof(Uint8Array) - .or(z.string().transform(stringToBytes)); - -export const zodInbound = z - .instanceof(Uint8Array) - .or(z.string().transform(bytesFromBase64)); diff --git a/bank-feeds/src/lib/config.ts b/bank-feeds/src/lib/config.ts index dd2fab6e9..416844419 100644 --- a/bank-feeds/src/lib/config.ts +++ b/bank-feeds/src/lib/config.ts @@ -1,67 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.js"; -import { RetryConfig } from "./retries.js"; -import { Params, pathToFunc } from "./url.js"; - -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = [ - /** - * Production - */ - "https://api.codat.io", -] as const; - -export type SDKOptions = { - authHeader?: string | (() => Promise) | undefined; - - httpClient?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - userAgent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: RetryConfig; - timeoutMs?: number; - debugLogger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.serverURL; - - const params: Params = {}; - - if (!serverURL) { - const serverIdx = options.serverIdx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); +export function serverURLFromOptions(options: unknown): string { + void options; + return ""; } - -export const SDK_METADATA = { - language: "typescript", - openapiDocVersion: "3.0.0", - sdkVersion: "8.2.1", - genVersion: "2.879.13", - userAgent: "speakeasy-sdk/typescript 8.2.1 2.879.13 3.0.0 @codat/bank-feeds", -} as const; diff --git a/bank-feeds/src/lib/dlv.ts b/bank-feeds/src/lib/dlv.ts deleted file mode 100644 index e81091f5e..000000000 --- a/bank-feeds/src/lib/dlv.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) 2024 Jason Miller (http://jasonformat.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/** - * @param obj The object to walk - * @param key The key path to walk the object with - * @param def A default value to return if the result is undefined - * - * @example - * dlv(obj, "a.b.c.d") - * @example - * dlv(object, ["a", "b", "c", "d"]) - * @example - * dlv(object, "foo.bar.baz", "Hello, default value!") - */ -export function dlv( - obj: any, - key: string | string[], - def?: T, - p?: number, - undef?: never, -): T | undefined { - key = Array.isArray(key) ? key : key.split("."); - for (p = 0; p < key.length; p++) { - const k = key[p]; - obj = k != null && obj ? obj[k] : undef; - } - return obj === undef ? def : obj; -} diff --git a/bank-feeds/src/lib/encodings.ts b/bank-feeds/src/lib/encodings.ts deleted file mode 100644 index 2791d25bc..000000000 --- a/bank-feeds/src/lib/encodings.ts +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export class EncodingError extends Error { - constructor(message: string) { - super(message); - this.name = "EncodingError"; - } -} - -export function encodeMatrix( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - const keyPrefix = encodeString(pk); - tmp = `${keyPrefix}=${encValue}`; - // trim trailing '=' if value was empty - if (tmp === `${keyPrefix}=`) { - tmp = tmp.slice(0, -1); - } - - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `;${tmp}`; - }); - - return out; -} - -export function encodeLabel( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) - ? `${encodeString(pk)}=` - : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -function formEncoder(sep: string): FormEncoder { - return ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, - ) => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - const encodedSep = encodeString(sep); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep); - } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; - })?.join(encodedSep); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); - }; -} - -export const encodeForm = formEncoder(","); -export const encodeSpaceDelimited = formEncoder(" "); -export const encodePipeDelimited = formEncoder("|"); - -export function encodeBodyForm( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else if (isPlainObject(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else { - encValue = `${encodeValue(pv)}`; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); -} - -export function encodeDeepObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - let out = ""; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - if (!isPlainObject(value)) { - throw new EncodingError(`Expected parameter '${key}' to be an object.`); - } - - Object.entries(value).forEach(([ck, cv]) => { - if (cv == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - if (typeof value === "undefined") { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encVal = encodeString(JSON.stringify(value, jsonReplacer)); - - return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; -} - -export const encodeSimple = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${tmp}` : ""; - }); - - return out.slice(1); -}; - -function explode(key: string, value: unknown): [string, unknown][] { - if (Array.isArray(value)) { - return value.map((v) => [key, v]); - } else if (isPlainObject(value)) { - const o = value ?? {}; - return Object.entries(o).map(([k, v]) => [k, v]); - } else { - return [[key, value]]; - } -} - -function serializeValue(value: unknown): string { - if (value == null) { - return ""; - } else if (value instanceof Date) { - return value.toISOString(); - } else if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else if (typeof value === "object") { - return JSON.stringify(value, jsonReplacer); - } - - return `${value}`; -} - -function jsonReplacer(_: string, value: unknown): unknown { - if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else { - return value; - } -} - -function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; - allowEmptyValue?: string[]; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -type BulkQueryEncoder = ( - values: Record, - options?: QueryEncoderOptions, -) => string; - -export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { - const bulkEncode = function( - values: Record, - options?: QueryEncoderOptions, - ): string { - const opts: QueryEncoderOptions = { - ...options, - explode: options?.explode ?? true, - charEncoding: options?.charEncoding ?? "percent", - }; - - const allowEmptySet = new Set(options?.allowEmptyValue ?? []); - - const encoded = Object.entries(values).map(([key, value]) => { - if (allowEmptySet.has(key)) { - if ( - value === undefined - || value === null - || value === "" - || (Array.isArray(value) && value.length === 0) - ) { - return `${encodeURIComponent(key)}=`; - } - } - return f(key, value, opts); - }); - return queryJoin(...encoded); - }; - - return bulkEncode; -} - -export const encodeJSONQuery = queryEncoder(encodeJSON); -export const encodeFormQuery = queryEncoder(encodeForm); -export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); -export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); -export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); - -function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const tag = val[Symbol.toStringTag]; - if (tag !== "Blob" && tag !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (isBlobLike(value)) { - if (fileName) { - fd.append(key, value as Blob, fileName); - } else { - fd.append(key, value as Blob); - } - } else { - fd.append(key, String(value)); - } -} - -export async function normalizeBlob( - value: Pick, -): Promise { - if (value instanceof Blob) { - return value; - } - return new Blob([await value.arrayBuffer()], { type: value.type }); -} diff --git a/bank-feeds/src/lib/files.ts b/bank-feeds/src/lib/files.ts index 6ca6b37d3..1427b8cf6 100644 --- a/bank-feeds/src/lib/files.ts +++ b/bank-feeds/src/lib/files.ts @@ -1,104 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; +export function bytesToBlob(content: unknown, contentType: string): Blob { + void content; + return new Blob([], { type: contentType }); } -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; +export function getContentTypeFromFileName(fileName: string): string { + void fileName; + return "application/octet-stream"; } -/** - * Creates a Blob from file content with the given MIME type. - * - * Node.js Buffers are Uint8Array subclasses that may share a pooled - * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing - * such a Buffer directly to `new Blob([buf])` can include the entire - * underlying pool on some runtimes, producing a Blob with extra bytes - * that corrupts multipart uploads. - * - * Copying into a standalone Uint8Array ensures the Blob receives only the - * intended bytes regardless of runtime behaviour. - */ -export function bytesToBlob( - content: Uint8Array | ArrayBuffer | Blob | string, - contentType: string, -): Blob { - if (content instanceof Uint8Array) { - return new Blob([new Uint8Array(content)], { type: contentType }); - } - return new Blob([content as BlobPart], { type: contentType }); +export async function readableStreamToArrayBuffer(readable: unknown): Promise { + void readable; + return new ArrayBuffer(0); } diff --git a/bank-feeds/src/lib/http.ts b/bank-feeds/src/lib/http.ts deleted file mode 100644 index 13cf1fd78..000000000 --- a/bank-feeds/src/lib/http.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Fetcher = ( - input: RequestInfo | URL, - init?: RequestInit, -) => Promise; - -export type Awaitable = T | Promise; - -const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } -}; - -export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; -}; - -export interface HTTPClientOptions { - fetcher?: Fetcher; -} - -export type BeforeRequestHook = (req: Request) => Awaitable; -export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; -export type ResponseHook = (res: Response, req: Request) => Awaitable; - -export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; - } - - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } - - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; - } - - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; - } - - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); - - return child; - } -} - -export type StatusCodePredicate = number | string | (number | string)[]; - -// A semicolon surrounded by optional whitespace characters is used to separate -// segments in a media type string. -const mediaParamSeparator = /\s*;\s*/g; - -export function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; - } - - let contentType = - response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); - - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; - - if (wantType.split("/").length !== 2) { - return false; - } - - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; - - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; - } - - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; - } - - if (gotParams.length < wantParams.length) { - return false; - } - - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } - } - - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode( - response: Response, - codes: StatusCodePredicate, -): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string, -): boolean { - return ( - matchStatusCode(response, code) && - matchContentType(response, contentTypePattern) - ); -} - -/** - * Uses various heurisitics to determine if an error is a connection error. - */ -export function isConnectionError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -/** - * Uses various heurisitics to determine if an error is a timeout error. - */ -export function isTimeoutError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - const isLegacyNative = "code" in err && err.code === 23; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} - -/** - * Uses various heurisitics to determine if an error is a abort error. - */ -export function isAbortError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "AbortError"; - const isLegacyNative = "code" in err && err.code === 20; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} diff --git a/bank-feeds/src/lib/is-plain-object.ts b/bank-feeds/src/lib/is-plain-object.ts deleted file mode 100644 index 61070d3d7..000000000 --- a/bank-feeds/src/lib/is-plain-object.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js - -export function isPlainObject(value: unknown): value is object { - if (typeof value !== "object" || value === null) { - return false; - } - - const prototype = Object.getPrototypeOf(value); - return ( - (prototype === null || - prototype === Object.prototype || - Object.getPrototypeOf(prototype) === null) && - !(Symbol.toStringTag in value) && - !(Symbol.iterator in value) - ); -} diff --git a/bank-feeds/src/lib/logger.ts b/bank-feeds/src/lib/logger.ts deleted file mode 100644 index d181f2937..000000000 --- a/bank-feeds/src/lib/logger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/bank-feeds/src/lib/matchers.ts b/bank-feeds/src/lib/matchers.ts deleted file mode 100644 index b096d6f20..000000000 --- a/bank-feeds/src/lib/matchers.ts +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - json: "application/json", - text: "text/plain", - bytes: "application/octet-stream", - stream: "application/octet-stream", - sse: "text/event-stream", - nil: "*", - fail: "*", -}; - -type Schema = { parse(raw: unknown): T }; - -type MatchOptions = { - ctype?: string; - hdrs?: boolean; - key?: string; - sseSentinel?: string; -}; - -export type ValueMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; -}; - -export type ErrorMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; - err: true; -}; - -export type FailMatcher = { - enc: "fail"; - codes: StatusCodePredicate; -}; - -export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; - -export function jsonErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "json", codes, schema }; -} -export function json( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "json", codes, schema }; -} - -export function jsonl( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes, schema }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", codes, schema }; -} -export function textErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "text", codes, schema }; -} -export function text( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "text", codes, schema }; -} - -export function bytesErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "bytes", codes, schema }; -} -export function bytes( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "bytes", codes, schema }; -} - -export function streamErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "stream", codes, schema }; -} -export function stream( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "stream", codes, schema }; -} - -export function sseErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "sse", codes, schema }; -} -export function sse( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "sse", codes, schema }; -} - -export function nilErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "nil", codes, schema }; -} -export function nil( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "nil", codes, schema }; -} - -export function fail(codes: StatusCodePredicate): FailMatcher { - return { enc: "fail", codes }; -} - -export type MatchedValue = Matchers extends Matcher[] - ? T - : never; -export type MatchedError = Matchers extends Matcher[] - ? E - : never; -export type MatchFunc = ( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, - ): Promise< - [result: Result, raw: unknown] - > { - let raw: unknown; - let matcher: Matcher | undefined; - for (const match of matchers) { - const { codes } = match; - const ctpattern = "ctype" in match - ? match.ctype - : DEFAULT_CONTENT_TYPES[match.enc]; - if (ctpattern && matchResponse(response, codes, ctpattern)) { - matcher = match; - break; - } else if (!ctpattern && matchStatusCode(response, codes)) { - matcher = match; - break; - } - } - - if (!matcher) { - return [{ - ok: false, - error: new SDKError("Unexpected Status or Content-Type", { - response, - request, - body: await response.text().catch(() => ""), - }), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - raw = response.body; - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = body; - break; - default: - throw new Error( - `Unsupported response type: ${encoding satisfies never}`, - ); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new SDKError("API error occurred", { request, response, body }), - }, raw]; - } - - const resultKey = matcher.key || options?.resultKey; - let data: unknown; - - if ("err" in matcher) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - request$: request, - response$: response, - body$: body, - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else if (matcher.hdrs) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - if ("err" in matcher) { - const result = safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ); - return [result.ok ? { ok: false, error: result.value } : result, raw]; - } else { - return [ - safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ), - raw, - ]; - } - }; -} - -const headerValRE = /, */; -/** - * Iterates over a Headers object and returns an object with all the header - * entries. Values are represented as an array to account for repeated headers. - */ -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; -} - -function safeParseResponse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, - httpMeta: { response: Response; request: Request; body: string }, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR( - new ResponseValidationError(errorMessage, { - cause: err, - rawValue, - rawMessage: errorMessage, - ...httpMeta, - }), - ); - } -} diff --git a/bank-feeds/src/lib/primitives.ts b/bank-feeds/src/lib/primitives.ts deleted file mode 100644 index d21f1dc49..000000000 --- a/bank-feeds/src/lib/primitives.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -export type Remap = { - [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ - ? Mapping[k] - : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ - ? never - : k /* otherwise keep the key as-is */]: Inp[k]; -}; - -/** - * Converts or omits an object's keys according to a mapping. - * - * @param inp An object whose keys will be remapped - * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. - * @returns A new object with keys remapped or omitted according to the mappings - */ -export function remap< - Inp extends Record, - const Mapping extends { [k in keyof Inp]?: string | null }, ->(inp: Inp, mappings: Mapping): Remap { - let out: any = {}; - - if (!Object.keys(mappings).length) { - out = inp; - return out; - } - - for (const [k, v] of Object.entries(inp)) { - const j = mappings[k]; - if (j === null) { - continue; - } - out[j ?? k] = v; - } - - return out; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} diff --git a/bank-feeds/src/lib/retries.ts b/bank-feeds/src/lib/retries.ts deleted file mode 100644 index e3ce9aba7..000000000 --- a/bank-feeds/src/lib/retries.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { isConnectionError, isTimeoutError } from "./http.js"; - -export type BackoffStrategy = { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; -}; - -const defaultBackoff: BackoffStrategy = { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, -}; - -export type RetryConfig = - | { strategy: "none" } - | { - strategy: "backoff"; - backoff?: BackoffStrategy; - retryConnectionErrors?: boolean; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function retry( - fetchFn: () => Promise, - options: { - config: RetryConfig; - statusCodes: string[]; - }, -): Promise { - switch (options.config.strategy) { - case "backoff": - return retryBackoff( - wrapFetcher(fetchFn, { - statusCodes: options.statusCodes, - retryConnectionErrors: !!options.config.retryConnectionErrors, - }), - options.config.backoff ?? defaultBackoff, - ); - default: - return await fetchFn(); - } -} - -function wrapFetcher( - fn: () => Promise, - options: { - statusCodes: string[]; - retryConnectionErrors: boolean; - }, -): () => Promise { - return async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: err }); - } - }; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -function isRetryableResponse(res: Response, statusCodes: string[]): boolean { - const actual = `${res.status}`; - - return statusCodes.some((code) => { - if (!codeRangeRE.test(code)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -async function retryBackoff( - fn: () => Promise, - strategy: BackoffStrategy, -): Promise { - const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; - - const start = Date.now(); - let x = 0; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/bank-feeds/src/lib/schemas.ts b/bank-feeds/src/lib/schemas.ts deleted file mode 100644 index dc2510e33..000000000 --- a/bank-feeds/src/lib/schemas.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - output, - ZodEffects, - ZodError, - ZodObject, - ZodRawShape, - ZodTypeAny, -} from "zod/v3"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; - -/** - * Utility function that executes some code which may throw a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function parse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Out { - try { - return fn(rawValue); - } catch (err) { - if (err instanceof ZodError) { - throw new SDKValidationError(errorMessage, err, rawValue); - } - throw err; - } -} - -/** - * Utility function that executes some code which may result in a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function safeParse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR(new SDKValidationError(errorMessage, err, rawValue)); - } -} - -export function collectExtraKeys< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - K extends string, ->( - obj: ZodObject, - extrasKey: K, - optional: boolean, -): ZodEffects< - typeof obj, - & output> - & { - [k in K]: Record>; - } -> { - return obj.transform((val) => { - const extras: Record> = {}; - const { shape } = obj; - for (const [key] of Object.entries(val)) { - if (key in shape) { - continue; - } - - const v = val[key]; - if (typeof v === "undefined") { - continue; - } - - extras[key] = v; - delete val[key]; - } - - if (optional && Object.keys(extras).length === 0) { - return val; - } - - return { ...val, [extrasKey]: extras }; - }); -} diff --git a/bank-feeds/src/lib/sdkconfig.ts b/bank-feeds/src/lib/sdkconfig.ts new file mode 100644 index 000000000..3e3bdfe5b --- /dev/null +++ b/bank-feeds/src/lib/sdkconfig.ts @@ -0,0 +1,473 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type { SDKHooks } from "../hooks/hooks"; +import type { HookContext } from "../hooks/types"; + +export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; + +export type RequestInput = { + url: URL; + options?: RequestInit | undefined; +}; + +export type Awaitable = T | Promise; + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +const DEFAULT_FETCHER: Fetcher = (input, init) => (init == null ? fetch(input) : fetch(input, init)); + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const next = await hook(req); + if (next) { + req = next; + } + } + try { + const res = await this.fetcher(req); + for (const hook of this.responseHooks) { + await hook(res, req); + } + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + throw err; + } + } + + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + addHook(hook: "requestError", fn: RequestErrorHook): this; + addHook(hook: "response", fn: ResponseHook): this; + addHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + if (hook === "beforeRequest") { + this.requestHooks.push(fn as BeforeRequestHook); + } else if (hook === "requestError") { + this.requestErrorHooks.push(fn as RequestErrorHook); + } else if (hook === "response") { + this.responseHooks.push(fn as ResponseHook); + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + return this; + } + + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + removeHook(hook: "requestError", fn: RequestErrorHook): this; + removeHook(hook: "response", fn: ResponseHook): this; + removeHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + let target: unknown[]; + if (hook === "beforeRequest") { + target = this.requestHooks; + } else if (hook === "requestError") { + target = this.requestErrorHooks; + } else if (hook === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + const index = target.findIndex((v) => v === fn); + if (index >= 0) { + target.splice(index, 1); + } + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + return child; + } +} + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(...args: unknown[]): void; +} + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +export interface SDKOptions { + authHeader?: string | (() => Promise) | undefined; + debugLogger?: Logger; + httpClient?: HTTPClient; + retryConfig?: RetryConfig; + serverIdx?: number | undefined; + serverURL?: string | undefined; + timeoutMs?: number; + userAgent?: string | undefined; +} + +export type Security = { + authHeader: string; +}; + +export const ServerList = ["https://api.codat.io"] as const; + +export const SDK_METADATA = { + language: "typescript", + genVersion: "codat-sdk-codegen-poc-0.1.0", + sdkVersion: "3.0.0", + openapiDocVersion: "3.0.0", + userAgent: "codat-sdk/typescript 3.0.0 codat-sdk-codegen-poc-0.1.0 3.0.0 @codat/bank-feeds", +} as const; + +export function resolveServerURL(options: SDKOptions = {}): string { + const fromList = ServerList[options.serverIdx ?? 0] ?? ServerList[0]; + return (options.serverURL ?? fromList).replace(/\/+$/, ""); +} + +export function resolveAuthHeader( + authHeader: SDKOptions["authHeader"], +): string | ((name: string) => Promise) | undefined { + if (authHeader == null) { + return undefined; + } + if (typeof authHeader === "function") { + return () => authHeader(); + } + return authHeader; +} + +const DEFAULT_RETRY_CODES = ["408", "429", "5XX"]; + +const DEFAULT_RETRY_CONFIG: RetryConfig = { + strategy: "backoff", + backoff: { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + retryConnectionErrors: true, +}; + +class PermanentError extends Error { + readonly cause: unknown; + constructor(message: string, options?: { cause?: unknown }) { + super(message); + this.name = "PermanentError"; + this.cause = options?.cause; + } +} + +class TemporaryError extends Error { + readonly response: Response; + constructor(message: string, response: Response) { + super(message); + this.name = "TemporaryError"; + this.response = response; + } +} + +function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const msg = err instanceof TypeError ? err.message.toLowerCase() : ""; + const isFetchErr = msg.startsWith("failed to fetch") || msg.startsWith("fetch failed"); + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return isFetchErr || code === "econnreset"; +} + +function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const name = "name" in err ? (err as { name?: unknown }).name : ""; + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return name === "TimeoutError" || code === "econnaborted"; +} + +const codeRangeRE = /^[0-9]xx$/i; + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + return actual.charAt(0) === code.charAt(0); + }); +} + +function retryIntervalFromResponse(res: Response): number { + const retryVal = res.headers.get("retry-after") || ""; + if (!retryVal) { + return 0; + } + const asNumber = Number(retryVal); + if (Number.isInteger(asNumber)) { + return asNumber * 1000; + } + const asDate = Date.parse(retryVal); + if (Number.isInteger(asDate)) { + const deltaMs = asDate - Date.now(); + return deltaMs > 0 ? Math.ceil(deltaMs) : 0; + } + return 0; +} + +function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function wrapFetcher( + fn: () => Promise, + statusCodes: string[], + retryConnectionErrors: boolean, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, statusCodes)) { + throw new TemporaryError("Response failed with retryable status code", res); + } + return res; + } catch (err: unknown) { + if (err instanceof TemporaryError) { + throw err; + } + if (retryConnectionErrors && (isTimeoutError(err) || isConnectionError(err))) { + throw err; + } + throw new PermanentError("Permanent error", { cause: err }); + } + }; +} + +async function retryBackoff(fn: () => Promise, strategy: BackoffStrategy): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + const start = Date.now(); + let x = 0; + for (;;) { + try { + return await fn(); + } catch (err: unknown) { + if (err instanceof PermanentError) { + throw err.cause; + } + if (Date.now() - start > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.response; + } + throw err; + } + let retryInterval = err instanceof TemporaryError ? retryIntervalFromResponse(err.response) : 0; + if (retryInterval <= 0) { + retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + await delay(Math.min(retryInterval, maxInterval)); + x++; + } + } +} + +function retryRequest(fn: () => Promise, config: RetryConfig, statusCodes: string[]): Promise { + if (config.strategy === "backoff") { + return retryBackoff( + wrapFetcher(fn, statusCodes, !!config.retryConnectionErrors), + config.backoff ?? { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + ); + } + return fn(); +} + +export function resolveUserAgent(userAgent: string | undefined): Record { + const agent = userAgent ?? SDK_METADATA.userAgent; + if (!agent) { + return {}; + } + const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + return isBrowser ? {} : { "user-agent": agent }; +} + +function parseURL(input: RequestInfo | URL): URL | null { + try { + return new URL(String(input)); + } catch { + return null; + } +} + +export type SecurityState = { + basic: { username?: string; password?: string }; + headers: Record; + queryParams: Record; + cookies: Record; + oauth2: { type: "none" }; +}; + +function headerValue(headers: HeadersInit | undefined, name: string): string | undefined { + if (!headers) { + return undefined; + } + const lower = name.toLowerCase(); + if (typeof Headers !== "undefined" && headers instanceof Headers) { + return headers.get(name) ?? undefined; + } + if (Array.isArray(headers)) { + const found = headers.find(([k]) => k.toLowerCase() === lower); + return found ? found[1] : undefined; + } + for (const k of Object.keys(headers)) { + if (k.toLowerCase() === lower) { + return (headers as Record)[k]; + } + } + return undefined; +} + +function resolveSecurityState(authValue: string | undefined): SecurityState | null { + if (authValue == null) { + return null; + } + return { + basic: {}, + headers: { Authorization: authValue }, + queryParams: {}, + cookies: {}, + oauth2: { type: "none" }, + }; +} + +export function makeFetch(options: SDKOptions = {}, hooks?: SDKHooks): Fetcher { + const client = options.httpClient; + const logger = options.debugLogger; + return (input, init) => { + const reqInit: RequestInit = init ?? {}; + const stamped = reqInit as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + const operationId = stamped.__codatOperationId; + const config = stamped.__codatRetries ?? options.retryConfig ?? DEFAULT_RETRY_CONFIG; + const retryCodes = stamped.__codatRetryCodes ?? DEFAULT_RETRY_CODES; + for (const key of ["__codatOperationId", "__codatRetries", "__codatRetryCodes"] as const) { + if (key in stamped) { + delete stamped[key]; + } + } + const parsed = parseURL(input); + const ctx: HookContext = { + baseURL: resolveServerURL(options), + operationID: operationId ?? `${(reqInit.method ?? "GET").toUpperCase()} ${parsed ? parsed.pathname : String(input)}`, + oAuth2Scopes: null, + securitySource: options.authHeader, + retryConfig: config, + resolvedSecurity: resolveSecurityState(headerValue(reqInit.headers, "Authorization")), + options, + }; + + let url: RequestInfo | URL = input; + let finalInit: RequestInit = reqInit; + if (hooks && parsed) { + const created = hooks.beforeCreateRequest(ctx, { url: parsed, options: reqInit }); + url = created.url; + finalInit = created.options ?? reqInit; + } + if (!finalInit.signal && options.timeoutMs && options.timeoutMs > 0) { + finalInit = { ...finalInit, signal: AbortSignal.timeout(options.timeoutMs) }; + } + + const dispatch = async (): Promise => { + let request = new Request(url, finalInit); + if (hooks) { + request = await hooks.beforeRequest(ctx, request.clone()); + } + if (logger) { + logger.log(`request: ${request.method} ${request.url}`); + } + let res: Response; + try { + res = client ? await client.request(request) : await fetch(request); + } catch (err) { + if (hooks) { + const handled = await hooks.afterError(ctx, null, err); + if (handled.error) { + throw handled.error; + } + if (handled.response) { + return handled.response; + } + } + throw err; + } + if (logger) { + logger.log(`response: ${res.status}`); + } + if (hooks) { + if (res.status >= 400) { + const handled = await hooks.afterError(ctx, res, null); + if (handled.error) { + throw handled.error; + } + res = handled.response ?? res; + } else { + res = await hooks.afterSuccess(ctx, res); + } + } + return res; + }; + return retryRequest(dispatch, config, retryCodes); + }; +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +export function matchStatusCode(response: Response, codes: StatusCodePredicate): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + return expectedCodes.some((ec) => { + const code = `${ec}`; + if (code === "default") { + return true; + } + if (!codeRangeRE.test(code)) { + return code === actual; + } + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + return actualFamily === expectFamily; + }); +} diff --git a/bank-feeds/src/lib/sdks.ts b/bank-feeds/src/lib/sdks.ts deleted file mode 100644 index 43fcf336e..000000000 --- a/bank-feeds/src/lib/sdks.ts +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, - matchStatusCode, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.js"; - -export type RequestOptions = { - /** - * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If - * `fetchOptions.signal` is set then it will take precedence over this option. - */ - timeoutMs?: number; - /** - * Set or override a retry policy on HTTP calls. - */ - retries?: RetryConfig; - /** - * Specifies the status codes which should be retried using the given retry policy. - */ - retryCodes?: string[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - serverURL?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * Sets various request options on the `fetch` call made by an SDK method. - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} - */ - fetchOptions?: Omit; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - timeoutMs?: number; -}; - -const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; -const webWorkerLike = typeof gt === "object" - && gt != null - && "importScripts" in gt - && typeof gt["importScripts"] === "function"; -const isBrowserLike = webWorkerLike - || (typeof navigator !== "undefined" && "serviceWorker" in navigator) - || (typeof window === "object" && typeof window.document !== "undefined"); - -export class ClientSDK { - readonly #httpClient: HTTPClient; - readonly #hooks: SDKHooks; - readonly #logger?: Logger | undefined; - public readonly _baseURL: URL | null; - public readonly _options: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - if ( - typeof opt === "object" - && opt != null - && "hooks" in opt - && opt.hooks instanceof SDKHooks - ) { - this.#hooks = opt.hooks; - } else { - this.#hooks = new SDKHooks(); - } - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - - const { baseURL, client } = this.#hooks.sdkInit({ - baseURL: url, - client: options.httpClient || new HTTPClient(), - }); - this._baseURL = baseURL; - this.#httpClient = client; - - this._options = { ...options, hooks: this.#hooks }; - - this.#logger = this._options.debugLogger; - } - - public _createRequest( - context: HookContext, - conf: RequestConfig, - options?: RequestOptions, - ): Result { - const { method, path, query, headers: opHeaders, security } = conf; - - const base = conf.baseURL ?? this._baseURL; - if (!base) { - return ERR(new InvalidRequestError("No base URL provided for operation")); - } - const baseURL = new URL(base); - let reqURL: URL; - if (path) { - baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; - reqURL = new URL(path, baseURL); - } else { - reqURL = baseURL; - } - reqURL.hash = ""; - - let finalQuery = query || ""; - - const secQuery: string[] = []; - for (const [k, v] of Object.entries(security?.queryParams || {})) { - const q = encodeForm(k, v, { charEncoding: "percent" }); - if (typeof q !== "undefined") { - secQuery.push(q); - } - } - if (secQuery.length) { - finalQuery += `&${secQuery.join("&")}`; - } - - if (finalQuery) { - const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; - reqURL.search = `?${q}`; - } - - const headers = new Headers(opHeaders); - - const username = security?.basic.username; - const password = security?.basic.password; - if (username != null || password != null) { - const encoded = stringToBase64( - [username || "", password || ""].join(":"), - ); - headers.set("Authorization", `Basic ${encoded}`); - } - - const securityHeaders = new Headers(security?.headers || {}); - for (const [k, v] of securityHeaders) { - headers.set(k, v); - } - - let cookie = headers.get("cookie") || ""; - for (const [k, v] of Object.entries(security?.cookies || {})) { - cookie += `; ${k}=${v}`; - } - cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; - headers.set("cookie", cookie); - - const userHeaders = new Headers( - options?.headers ?? options?.fetchOptions?.headers, - ); - for (const [k, v] of userHeaders) { - headers.set(k, v); - } - - // Only set user agent header in non-browser-like environments since CORS - // policy disallows setting it in browsers e.g. Chrome throws an error. - if (!isBrowserLike) { - headers.set( - conf.uaHeader ?? "user-agent", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - const fetchOptions: Omit = { - ...options?.fetchOptions, - ...options, - }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - let input; - try { - input = this.#hooks.beforeCreateRequest(context, { - url: reqURL, - options: { - ...fetchOptions, - body: conf.body ?? null, - headers, - method, - }, - }); - } catch (err: unknown) { - return ERR( - new UnexpectedClientError("Create request hook failed to execute", { - cause: err, - }), - ); - } - - return OK(new Request(input.url, input.options)); - } - - public async _do( - request: Request, - options: { - context: HookContext; - errorCodes: number | string | (number | string)[]; - retryConfig: RetryConfig; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, errorCodes } = options; - - return retry( - async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); - await logRequest(this.#logger, req).catch((e) => - this.#logger?.log("Failed to log request:", e) - ); - - let response = await this.#httpClient.request(req); - - try { - if (matchStatusCode(response, errorCodes)) { - const result = await this.#hooks.afterError( - context, - response, - null, - ); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this.#hooks.afterSuccess(context, response); - } - } finally { - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.retryCodes }, - ).then( - (r) => OK(r), - (err) => { - switch (true) { - case isAbortError(err): - return ERR( - new RequestAbortedError("Request aborted by client", { - cause: err, - }), - ); - case isTimeoutError(err): - return ERR( - new RequestTimeoutError("Request timed out", { cause: err }), - ); - case isConnectionError(err): - return ERR( - new ConnectionError("Unable to make request", { cause: err }), - ); - default: - return ERR( - new UnexpectedClientError("Unexpected HTTP client error", { - cause: err, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; -const jsonlLikeContentTypeRE = - /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/bank-feeds/src/lib/security.ts b/bank-feeds/src/lib/security.ts deleted file mode 100644 index 3da8e733b..000000000 --- a/bank-feeds/src/lib/security.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as shared from "../sdk/models/shared/index.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - clientID?: string | undefined; - clientSecret?: string | undefined; - tokenURL: string; -}; - -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} - -export class SecurityError extends Error { - constructor( - public code: SecurityErrorCode, - message: string, - ) { - super(message); - this.name = "SecurityError"; - } - - static incomplete(): SecurityError { - return new SecurityError( - SecurityErrorCode.Incomplete, - "Security requirements not met in order to perform the operation", - ); - } - static unrecognizedType(type: string): SecurityError { - return new SecurityError( - SecurityErrorCode.UnrecognisedSecurityType, - `Unrecognised security type: ${type}`, - ); - } -} - -export type SecurityState = { - basic: { username?: string | undefined; password?: string | undefined }; - headers: Record; - queryParams: Record; - cookies: Record; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -type SecurityInputBasic = { - type: "http:basic"; - value: - | { username?: string | undefined; password?: string | undefined } - | null - | undefined; -}; - -type SecurityInputBearer = { - type: "http:bearer"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputAPIKey = { - type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOIDC = { - type: "openIdConnect"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2 = { - type: "oauth2"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2ClientCredentials = { - type: "oauth2:client_credentials"; - value: - | { - clientID?: string | undefined; - clientSecret?: string | undefined; - } - | null - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - const option = options.find((opts) => { - return opts.every((o) => { - if (o.value == null) { - return false; - } else if (o.type === "http:basic") { - return o.value.username != null || o.value.password != null; - } else if (o.type === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - return o.value.clientID != null || o.value.clientSecret != null; - } else if (typeof o.value === "string") { - return !!o.value; - } else { - throw new Error( - `Unrecognized security type: ${o.type} (value type: ${typeof o - .value})`, - ); - } - }); - }); - if (option == null) { - return null; - } - - option.forEach((spec) => { - if (spec.value == null) { - return; - } - - const { type } = spec; - - switch (type) { - case "apiKey:header": - state.headers[spec.fieldName] = spec.value; - break; - case "apiKey:query": - state.queryParams[spec.fieldName] = spec.value; - break; - case "apiKey:cookie": - state.cookies[spec.fieldName] = spec.value; - break; - case "http:basic": - applyBasic(state, spec); - break; - case "http:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - applyBearer(state, spec); - break; - case "oauth2:client_credentials": - break; - case "openIdConnect": - applyBearer(state, spec); - break; - default: - throw SecurityError.unrecognizedType((spec satisfies never, type)); - } - }); - - return state; -} - -function applyBasic( - state: SecurityState, - spec: SecurityInputBasic, -) { - if (spec.value == null) { - return; - } - - state.basic = spec.value; -} - -function applyBearer( - state: SecurityState, - spec: - | SecurityInputBearer - | SecurityInputOAuth2 - | SecurityInputOIDC - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, - allowedFields?: number[], -): SecurityState | null { - let inputs: SecurityInput[][] = [ - [ - { - fieldName: "Authorization", - type: "apiKey:header", - value: security?.authHeader, - }, - ], - ]; - - if (allowedFields) { - inputs = allowedFields.map((i) => { - if (i < 0 || i >= inputs.length) { - throw new RangeError(`invalid allowedFields index ${i}`); - } - return inputs[i]!; - }); - } - - return resolveSecurity(...inputs); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/bank-feeds/src/lib/url.ts b/bank-feeds/src/lib/url.ts deleted file mode 100644 index 79e7ce660..000000000 --- a/bank-feeds/src/lib/url.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const hasOwn = Object.prototype.hasOwnProperty; - -export type Params = Partial>; - -export function pathToFunc( - pathPattern: string, - options?: { charEncoding?: "percent" | "none" }, -): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; - - return function buildURLPath(params: Record = {}): string { - return pathPattern - .replace(paramRE, function (_, placeholder) { - if (!hasOwn.call(params, placeholder)) { - throw new Error(`Parameter '${placeholder}' is required`); - } - - const value = params[placeholder]; - if (typeof value !== "string" && typeof value !== "number") { - throw new Error( - `Parameter '${placeholder}' must be a string or number`, - ); - } - - return options?.charEncoding === "percent" - ? encodeURIComponent(`${value}`) - : `${value}`; - }) - .replace(/^\/+/, ""); - }; -} diff --git a/bank-feeds/src/runtime.ts b/bank-feeds/src/runtime.ts new file mode 100644 index 000000000..40fe0b183 --- /dev/null +++ b/bank-feeds/src/runtime.ts @@ -0,0 +1,518 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { SDKError } from './sdk/models/errors/sdkerror'; +import { ErrorMessage } from './sdk/models/errors/errormessage'; +import type { RetryConfig } from './lib/sdkconfig'; + +export const BASE_PATH = "https://api.codat.io".replace(/\/+$/, ""); + +export type RequestOptions = { + timeoutMs?: number; + retries?: RetryConfig; + retryCodes?: string[]; + serverURL?: string | URL; + fetchOptions?: Omit; +} & Omit; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, options?: RequestOptions): Promise { + const { url, init } = await this.createFetchParams(context, options); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw await buildSpeakeasyError(url, init, response, context.errorStatuses); + } + + private async createFetchParams(context: RequestOpts, options?: RequestOptions) { + const opts: RequestOptions = options ?? {}; + const { + timeoutMs, + retries, + retryCodes, + serverURL, + fetchOptions, + headers: perCallHeaders, + ...restInit + } = opts; + + const base = (typeof serverURL === "string" || serverURL instanceof URL) + ? String(serverURL).replace(/\/+$/, "") + : this.configuration.basePath; + let url = base + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers, + toHeaderRecord(fetchOptions?.headers), + toHeaderRecord(perCallHeaders), + ); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + let body: any; + if (isFormData(context.body) + || (context.body instanceof URLSearchParams) + || isBlob(context.body)) { + body = context.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(context.body); + } else { + body = context.body; + } + + const init: RequestInit = { + ...fetchOptions, + ...restInit, + method: context.method, + headers, + body, + }; + if (init.credentials === undefined && this.configuration.credentials !== undefined) { + init.credentials = this.configuration.credentials; + } + if (!init.signal && timeoutMs && timeoutMs > 0) { + init.signal = AbortSignal.timeout(timeoutMs); + } + + const stamped = init as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + if (context.operationId !== undefined) { + stamped.__codatOperationId = context.operationId; + } + if (retries !== undefined) { + stamped.__codatRetries = retries; + } + if (retryCodes !== undefined) { + stamped.__codatRetryCodes = retryCodes; + } + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +function toHeaderRecord(headers: HeadersInit | undefined): HTTPHeaders { + if (!headers) { + return {}; + } + if (typeof Headers !== "undefined" && headers instanceof Headers) { + const out: HTTPHeaders = {}; + headers.forEach((value, key) => { out[key] = value; }); + return out; + } + if (Array.isArray(headers)) { + const out: HTTPHeaders = {}; + for (const [key, value] of headers) { + out[key] = value; + } + return out; + } + return { ...(headers as Record) }; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +async function buildSpeakeasyError(url: string, init: RequestInit, response: Response, errorStatuses?: number[]): Promise { + const httpResponse = response ?? new Response(null, { status: 500 }); + const body = response ? await response.clone().text() : ""; + const httpMeta = { response: httpResponse, request: new Request(url, { method: init.method }), body }; + let data: any; + try { + data = body ? JSON.parse(body) : undefined; + } catch { + data = undefined; + } + const documentsThisStatus = Array.isArray(errorStatuses) && errorStatuses.indexOf(httpResponse.status) !== -1; + if (documentsThisStatus && data && typeof data === "object" && !Array.isArray(data)) { + return new ErrorMessage(data, httpMeta); + } + return new SDKError("Response returned an error code", httpMeta); +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + operationId?: string; + errorStatuses?: number[]; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} + + +import { Decimal } from './sdk/types/decimal'; +export { Decimal }; + +export function toDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(toDecimal); } + return value instanceof Decimal ? value : new Decimal(value); +} + +export function fromDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(fromDecimal); } + return value instanceof Decimal ? value.toNumber() : value; +} diff --git a/bank-feeds/src/sdk.ts b/bank-feeds/src/sdk.ts new file mode 100644 index 000000000..73e4556cd --- /dev/null +++ b/bank-feeds/src/sdk.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Configuration, ConfigurationParameters } from './runtime'; +import type * as shared from './sdk/models/index'; +import { SDKOptions, resolveServerURL, resolveAuthHeader, resolveUserAgent, makeFetch, HTTPClient } from './lib/sdkconfig'; +import { SDKHooks } from './hooks/hooks'; +import { validateWebhook as runValidateWebhook } from './funcs/validateWebhook'; +import { + AccountMapping, + BankAccounts, + Companies, + CompanyInformation, + Connections, + ManagedBankFeeds, + SourceAccounts, + Transactions, +} from './apis/index'; + +export class CodatBankFeeds { + private readonly _config: Configuration; + + constructor(options: SDKOptions | ConfigurationParameters | Configuration = {}) { + if (options instanceof Configuration) { + this._config = options; + return; + } + const opts = options as SDKOptions & ConfigurationParameters; + const hooks = new SDKHooks(); + const baseURL = opts.basePath ?? resolveServerURL(opts); + let parsedBaseURL: URL | null = null; + try { parsedBaseURL = new URL(baseURL); } catch { parsedBaseURL = null; } + const init = hooks.sdkInit({ baseURL: parsedBaseURL, client: opts.httpClient ?? new HTTPClient() }); + const resolvedBaseURL = init.baseURL ? init.baseURL.toString().replace(/\/+$/, '') : baseURL; + this._config = new Configuration({ + ...opts, + basePath: resolvedBaseURL, + apiKey: opts.apiKey ?? resolveAuthHeader(opts.authHeader), + fetchApi: opts.fetchApi ?? makeFetch({ ...opts, httpClient: init.client }, hooks), + headers: { ...(opts.headers ?? {}), ...resolveUserAgent(opts.userAgent) }, + }); + } + + private _accountMapping?: AccountMapping; + get accountMapping(): AccountMapping { + if (!this._accountMapping) { this._accountMapping = new AccountMapping(this._config); } + return this._accountMapping; + } + + private _bankAccounts?: BankAccounts; + get bankAccounts(): BankAccounts { + if (!this._bankAccounts) { this._bankAccounts = new BankAccounts(this._config); } + return this._bankAccounts; + } + + private _companies?: Companies; + get companies(): Companies { + if (!this._companies) { this._companies = new Companies(this._config); } + return this._companies; + } + + private _companyInformation?: CompanyInformation; + get companyInformation(): CompanyInformation { + if (!this._companyInformation) { this._companyInformation = new CompanyInformation(this._config); } + return this._companyInformation; + } + + private _connections?: Connections; + get connections(): Connections { + if (!this._connections) { this._connections = new Connections(this._config); } + return this._connections; + } + + private _managedBankFeeds?: ManagedBankFeeds; + get managedBankFeeds(): ManagedBankFeeds { + if (!this._managedBankFeeds) { this._managedBankFeeds = new ManagedBankFeeds(this._config); } + return this._managedBankFeeds; + } + + private _sourceAccounts?: SourceAccounts; + get sourceAccounts(): SourceAccounts { + if (!this._sourceAccounts) { this._sourceAccounts = new SourceAccounts(this._config); } + return this._sourceAccounts; + } + + private _transactions?: Transactions; + get transactions(): Transactions { + if (!this._transactions) { this._transactions = new Transactions(this._config); } + return this._transactions; + } + + async validateWebhook(args: { request: { body: string; headers: Record | Headers; url: string; method: string; } | Request; }): Promise { + const outcome = await runValidateWebhook(this as never, { request: args.request }); + if (!outcome.ok) { throw outcome.error; } + return outcome.value; + } +} diff --git a/bank-feeds/src/sdk/accountmapping.ts b/bank-feeds/src/sdk/accountmapping.ts index 6534541b4..7b406a92e 100644 --- a/bank-feeds/src/sdk/accountmapping.ts +++ b/bank-feeds/src/sdk/accountmapping.ts @@ -1,81 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { accountMappingCreate } from "../funcs/accountMappingCreate.js"; -import { accountMappingGet } from "../funcs/accountMappingGet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class AccountMapping extends ClientSDK { - /** - * List bank feed accounts - * - * @remarks - * The *List bank accounts* endpoint returns information about a source bank account and any current or potential target mapping accounts. - * - * A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - * - * > **For custom builds only** - * > - * > Only use this endpoint if you are building your own account management UI. - */ - async get( - request: operations.GetBankAccountMappingRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(accountMappingGet( - this, - request, - options, - )); - } - - /** - * Create bank feed account mapping - * - * @remarks - * The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting software (target account). - * - * A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end user's account in the underlying software). - * - * To find valid target account options, first call the [List bank feed account mappings](https://docs.codat.io//bank-feeds-api#/operations/get-bank-account-mapping) endpoint. - * - * > **For custom builds only** - * > - * > Only use this endpoint if you are building your own account management UI. - * - * #### Account mapping variability - * - * The method of mapping the source account to the target account varies depending on the accounting software your company uses. - * - * #### Mapping options: - * - * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - * - * ### Integration-specific behavior - * - * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - * | --------------------- | ----------- | ---------------- | --------------------------- | - * | Xero | ✅ | ✅ | | - * | FreeAgent | ✅ | ✅ | | - * | Oracle NetSuite | ✅ | ✅ | | - * | Exact Online (NL) | ✅ | ✅ | | - * | QuickBooks Online | | | ✅ | - * | Sage | | | ✅ | - */ - async create( - request: operations.CreateBankAccountMappingRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(accountMappingCreate( - this, - request, - options, - )); - } -} +export { AccountMapping } from "../apis/AccountMapping"; diff --git a/bank-feeds/src/sdk/bankaccounts.ts b/bank-feeds/src/sdk/bankaccounts.ts index 139078192..911d7ba40 100644 --- a/bank-feeds/src/sdk/bankaccounts.ts +++ b/bank-feeds/src/sdk/bankaccounts.ts @@ -1,80 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bankAccountsCreate } from "../funcs/bankAccountsCreate.js"; -import { bankAccountsGetCreateModel } from "../funcs/bankAccountsGetCreateModel.js"; -import { bankAccountsList } from "../funcs/bankAccountsList.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class BankAccounts extends ClientSDK { - /** - * List bank accounts - * - * @remarks - * The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/bank-feeds-api#/operations/refresh-company-data). - */ - async list( - request: operations.ListBankAccountsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsList( - this, - request, - options, - )); - } - - /** - * Get create/update bank account model - * - * @remarks - * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company and integration. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ - async getCreateModel( - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsGetCreateModel( - this, - request, - options, - )); - } - - /** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/bank-feeds-api#/operations/get-create-update-bankAccounts-model). - */ - async create( - request: operations.CreateBankAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsCreate( - this, - request, - options, - )); - } -} +export { BankAccounts } from "../apis/BankAccounts"; diff --git a/bank-feeds/src/sdk/companies.ts b/bank-feeds/src/sdk/companies.ts index f5755cd50..4b89b1e24 100644 --- a/bank-feeds/src/sdk/companies.ts +++ b/bank-feeds/src/sdk/companies.ts @@ -1,172 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companiesCreate } from "../funcs/companiesCreate.js"; -import { companiesDelete } from "../funcs/companiesDelete.js"; -import { companiesGet } from "../funcs/companiesGet.js"; -import { companiesGetAccessToken } from "../funcs/companiesGetAccessToken.js"; -import { companiesList } from "../funcs/companiesList.js"; -import { companiesReplace } from "../funcs/companiesReplace.js"; -import { companiesUpdate } from "../funcs/companiesUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Companies extends ClientSDK { - /** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ - async create( - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesCreate( - this, - request, - options, - )); - } - - /** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ - async list( - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesList( - this, - request, - options, - )); - } - - /** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async get( - request: operations.GetCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGet( - this, - request, - options, - )); - } - - /** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async delete( - request: operations.DeleteCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesDelete( - this, - request, - options, - )); - } - - /** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async replace( - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesReplace( - this, - request, - options, - )); - } - - /** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data. - */ - async update( - request: operations.UpdateCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesUpdate( - this, - request, - options, - )); - } - - /** - * Get company access token - * - * @remarks - * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - * - * The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - */ - async getAccessToken( - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGetAccessToken( - this, - request, - options, - )); - } -} +export { Companies } from "../apis/Companies"; diff --git a/bank-feeds/src/sdk/companyinformation.ts b/bank-feeds/src/sdk/companyinformation.ts index 4bd519abf..621d21495 100644 --- a/bank-feeds/src/sdk/companyinformation.ts +++ b/bank-feeds/src/sdk/companyinformation.ts @@ -1,38 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companyInformationGet } from "../funcs/companyInformationGet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CompanyInformation extends ClientSDK { - /** - * Get company information - * - * @remarks - * Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | Oracle NetSuite | Yes | - * | Xero | Yes | - * | Exact | No | - * | FreeAgent | No | - * | Sage | No | - * | QuickBooks Online | No | - */ - async get( - request: operations.GetCompanyInformationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companyInformationGet( - this, - request, - options, - )); - } -} +export { CompanyInformation } from "../apis/CompanyInformation"; diff --git a/bank-feeds/src/sdk/connections.ts b/bank-feeds/src/sdk/connections.ts index 9253cd633..9abd92e59 100644 --- a/bank-feeds/src/sdk/connections.ts +++ b/bank-feeds/src/sdk/connections.ts @@ -1,103 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { connectionsCreate } from "../funcs/connectionsCreate.js"; -import { connectionsDelete } from "../funcs/connectionsDelete.js"; -import { connectionsGet } from "../funcs/connectionsGet.js"; -import { connectionsList } from "../funcs/connectionsList.js"; -import { connectionsUnlink } from "../funcs/connectionsUnlink.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Connections extends ClientSDK { - /** - * List connections - * - * @remarks - * List the connections for a company. - */ - async list( - request: operations.ListConnectionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsList( - this, - request, - options, - )); - } - - /** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ - async create( - request: operations.CreateConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsCreate( - this, - request, - options, - )); - } - - /** - * Get connection - * - * @remarks - * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - */ - async get( - request: operations.GetConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsGet( - this, - request, - options, - )); - } - - /** - * Delete connection - * - * @remarks - * Revoke and remove a connection from a company. - * This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - */ - async delete( - request: operations.DeleteConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsDelete( - this, - request, - options, - )); - } - - /** - * Unlink connection - * - * @remarks - * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - */ - async unlink( - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsUnlink( - this, - request, - options, - )); - } -} +export { Connections } from "../apis/Connections"; diff --git a/bank-feeds/src/sdk/index.ts b/bank-feeds/src/sdk/index.ts index ecac22648..d28eeda9d 100644 --- a/bank-feeds/src/sdk/index.ts +++ b/bank-feeds/src/sdk/index.ts @@ -1,5 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; +export * from "./sdk"; diff --git a/bank-feeds/src/sdk/managedbankfeeds.ts b/bank-feeds/src/sdk/managedbankfeeds.ts index 0e454a1b7..0919ce6e5 100644 --- a/bank-feeds/src/sdk/managedbankfeeds.ts +++ b/bank-feeds/src/sdk/managedbankfeeds.ts @@ -1,72 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { managedBankFeedsGetLatestSync } from "../funcs/managedBankFeedsGetLatestSync.js"; -import { managedBankFeedsGetSync } from "../funcs/managedBankFeedsGetSync.js"; -import { managedBankFeedsRunAdHocSync } from "../funcs/managedBankFeedsRunAdHocSync.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class ManagedBankFeeds extends ClientSDK { - /** - * Get sync - * - * @remarks - * The _Get sync_ endpoint returns the [sync status](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult) for a given 'syncId'. - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - */ - async getSync( - request: operations.GetManagedBankFeedSyncRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(managedBankFeedsGetSync( - this, - request, - options, - )); - } - - /** - * Get latest sync - * - * @remarks - * The _Get latest sync_ endpoint returns the status for a given source account's [most recent sync](https://docs.codat.io/bank-feeds-api#/schemas/SyncStatusResult). - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - */ - async getLatestSync( - request: operations.GetLatestManagedBankFeedSyncRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(managedBankFeedsGetLatestSync( - this, - request, - options, - )); - } - - /** - * Run ad-hoc sync - * - * @remarks - * The _Run ad-hoc sync_ endpoint immediately runs a sync with a fetch period from the last successful sync to the execution time of the new sync. - * - * A sync is a single execution that fetches bank transactions from a connected bank account and records them in the company's accounting software. - * - * Use either the [_Get latest sync_](https://docs.codat.io/bank-feeds-api#/operations/get-latest-managed-bank-feed-sync) endpoint or the [_Get sync_](https://docs.codat.io/bank-feeds-api#/operations/fetch-managed-bank-feed-sync-by-id) endpoint to get the result of this sync. - */ - async runAdHocSync( - request: operations.RunManagedBankFeedAdHocSyncRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(managedBankFeedsRunAdHocSync( - this, - request, - options, - )); - } -} +export { ManagedBankFeeds } from "../apis/ManagedBankFeeds"; diff --git a/bank-feeds/src/sdk/models/AccessToken.ts b/bank-feeds/src/sdk/models/AccessToken.ts new file mode 100644 index 000000000..3dbe2cc2e --- /dev/null +++ b/bank-feeds/src/sdk/models/AccessToken.ts @@ -0,0 +1,147 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface AccessToken + */ +export interface AccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +/** + * Check if a given object implements the AccessToken interface. + */ +export function instanceOfAccessToken(value: object): value is AccessToken { + if (!('expiresIn' in value) || value['expiresIn'] === undefined) return false; + if (!('accessToken' in value) || value['accessToken'] === undefined) return false; + if (!('tokenType' in value) || value['tokenType'] === undefined) return false; + return true; +} + +export function AccessTokenFromJSON(json: any): AccessToken { + return AccessTokenFromJSONTyped(json, false); +} + +export function AccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccessToken { + if (json == null) { + return json; + } + return { + + 'expiresIn': json['expiresIn'], + 'accessToken': json['accessToken'], + 'tokenType': json['tokenType'], + }; +} + +export function AccessTokenToJSON(json: any): AccessToken { + return AccessTokenToJSONTyped(json, false); +} + +export function AccessTokenToJSONTyped(value?: AccessToken | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'expiresIn': value['expiresIn'], + 'accessToken': value['accessToken'], + 'tokenType': value['tokenType'], + }; +} + + +export interface CompanyAccessTokenAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface CompanyAccessTokenGetResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface GetCompanyAccessTokenResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} diff --git a/bank-feeds/src/sdk/models/BankAccountCreateResponseAllOfData.ts b/bank-feeds/src/sdk/models/BankAccountCreateResponseAllOfData.ts new file mode 100644 index 000000000..40ccf8fab --- /dev/null +++ b/bank-feeds/src/sdk/models/BankAccountCreateResponseAllOfData.ts @@ -0,0 +1,262 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { BankAccountsBankAccountType } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { BankAccountStatus } from './shared/bankaccountstatus'; +import { + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './shared/bankaccountstatus'; + +/** + * + * @export + * @interface BankAccountCreateResponseAllOfData + */ +export interface BankAccountCreateResponseAllOfData { + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountCreateResponseAllOfData + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountCreateResponseAllOfData + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountCreateResponseAllOfData + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountCreateResponseAllOfData + */ + status?: BankAccountStatus; + /** + * + * @type {Metadata} + * @memberof BankAccountCreateResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccountCreateResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccountCreateResponseAllOfData + */ + sourceModifiedDate?: string; +} + + +/** + * @export + */ +export const BankAccountCreateResponseAllOfDataAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type BankAccountCreateResponseAllOfDataAccountTypeEnum = typeof BankAccountCreateResponseAllOfDataAccountTypeEnum[keyof typeof BankAccountCreateResponseAllOfDataAccountTypeEnum]; + + +/** + * Check if a given object implements the BankAccountCreateResponseAllOfData interface. + */ +export function instanceOfBankAccountCreateResponseAllOfData(value: object): value is BankAccountCreateResponseAllOfData { + return true; +} + +export function BankAccountCreateResponseAllOfDataFromJSON(json: any): BankAccountCreateResponseAllOfData { + return BankAccountCreateResponseAllOfDataFromJSONTyped(json, false); +} + +export function BankAccountCreateResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountCreateResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function BankAccountCreateResponseAllOfDataToJSON(json: any): BankAccountCreateResponseAllOfData { + return BankAccountCreateResponseAllOfDataToJSONTyped(json, false); +} + +export function BankAccountCreateResponseAllOfDataToJSONTyped(value?: BankAccountCreateResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/bank-feeds/src/sdk/models/BankTransaction.ts b/bank-feeds/src/sdk/models/BankTransaction.ts new file mode 100644 index 000000000..f91e73fff --- /dev/null +++ b/bank-feeds/src/sdk/models/BankTransaction.ts @@ -0,0 +1,509 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { BankTransactionType } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +/** + * + * @export + * @interface BankTransaction + */ +export interface BankTransaction { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} + + +/** + * @export + */ +export const BankTransactionTransactionTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit', + Int: 'Int', + Div: 'Div', + Fee: 'Fee', + SerChg: 'SerChg', + Dep: 'Dep', + Atm: 'Atm', + Pos: 'Pos', + Xfer: 'Xfer', + Check: 'Check', + Payment: 'Payment', + Cash: 'Cash', + DirectDep: 'DirectDep', + DirectDebit: 'DirectDebit', + RepeatPmt: 'RepeatPmt', + Other: 'Other' +} as const; +export type BankTransactionTransactionTypeEnum = typeof BankTransactionTransactionTypeEnum[keyof typeof BankTransactionTransactionTypeEnum]; + + +/** + * Check if a given object implements the BankTransaction interface. + */ +export function instanceOfBankTransaction(value: object): value is BankTransaction { + return true; +} + +export function BankTransactionFromJSON(json: any): BankTransaction { + return BankTransactionFromJSONTyped(json, false); +} + +export function BankTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankTransaction { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'date': json['date'] == null ? undefined : json['date'], + 'description': json['description'] == null ? undefined : json['description'], + 'counterparty': json['counterparty'] == null ? undefined : json['counterparty'], + 'reference': json['reference'] == null ? undefined : json['reference'], + 'reconciled': json['reconciled'] == null ? undefined : json['reconciled'], + 'amount': json['amount'] == null ? undefined : toDecimal(json['amount']), + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'transactionType': json['transactionType'] == null ? undefined : json['transactionType'], + }; +} + +export function BankTransactionToJSON(json: any): BankTransaction { + return BankTransactionToJSONTyped(json, false); +} + +export function BankTransactionToJSONTyped(value?: BankTransaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'date': value['date'], + 'description': value['description'], + 'counterparty': value['counterparty'], + 'reference': value['reference'], + 'reconciled': value['reconciled'], + 'amount': fromDecimal(value['amount']), + 'balance': fromDecimal(value['balance']), + 'transactionType': value['transactionType'], + }; +} + + +export interface BankTransactions { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} + +export interface BankTransactionsBankTransaction { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} + +export interface CreateBankTransactionResponseBankTransaction { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} + +export interface CreateBankTransactionsBankTransaction { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} + +export interface CreateBankTransactionsResponseBankTransaction { + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + * @type {string} + * @memberof BankTransaction + */ + id?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2023-08-22T10:21:00 + * 2023-08-22 + * ``` + * + * When pushing bank transaction data to Codat, the date is treated as a local date. This means: + * + * - The date/time is used exactly as provided, without any timezone conversion. + * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. + * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). + * @type {string} + * @memberof BankTransaction + */ + date?: string; + /** + * Description of the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + description?: string | null; + /** + * The giving or receiving party such as a person or organization. + * @type {string} + * @memberof BankTransaction + */ + counterparty?: string | null; + /** + * An optional reference to the bank transaction. + * @type {string} + * @memberof BankTransaction + */ + reference?: string | null; + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. + * @type {boolean} + * @memberof BankTransaction + */ + reconciled?: boolean | null; + /** + * The amount transacted in the bank transaction. + * @type {number} + * @memberof BankTransaction + */ + amount?: Decimal | number; + /** + * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. + * @type {number} + * @memberof BankTransaction + */ + balance?: Decimal | number; + /** + * Type of transaction for the bank statement line. + * @type {string} + * @memberof BankTransaction + */ + transactionType?: BankTransactionType | null; +} diff --git a/bank-feeds/src/sdk/models/CompanyDetails.ts b/bank-feeds/src/sdk/models/CompanyDetails.ts new file mode 100644 index 000000000..d87dfed52 --- /dev/null +++ b/bank-feeds/src/sdk/models/CompanyDetails.ts @@ -0,0 +1,1452 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { CompanyReference } from './shared/companyreference'; +import { + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './shared/companyreference'; + +/** + * + * @export + * @interface CompanyDetails + */ +export interface CompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +/** + * Check if a given object implements the CompanyDetails interface. + */ +export function instanceOfCompanyDetails(value: object): value is CompanyDetails { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyDetailsFromJSON(json: any): CompanyDetails { + return CompanyDetailsFromJSONTyped(json, false); +} + +export function CompanyDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + }; +} + +export function CompanyDetailsToJSON(json: any): CompanyDetails { + return CompanyDetailsToJSONTyped(json, false); +} + +export function CompanyDetailsToJSONTyped(value?: CompanyDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + }; +} + + +export interface CompaniesCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompaniesListResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCreateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyGetResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyReplaceResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyUpdateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CreateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface GetCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ListCompaniesResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ReplaceCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface UpdateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} diff --git a/bank-feeds/src/sdk/models/CreateBatchSourceAccount201ResponseInner.ts b/bank-feeds/src/sdk/models/CreateBatchSourceAccount201ResponseInner.ts new file mode 100644 index 000000000..d416a06f7 --- /dev/null +++ b/bank-feeds/src/sdk/models/CreateBatchSourceAccount201ResponseInner.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { SourceAccountBatchCreateResponse } from './shared/sourceaccountbatchcreateresponse'; +import { + instanceOfSourceAccountBatchCreateResponse, + SourceAccountBatchCreateResponseFromJSON, + SourceAccountBatchCreateResponseFromJSONTyped, + SourceAccountBatchCreateResponseToJSON, +} from './shared/sourceaccountbatchcreateresponse'; +import type { SourceAccountV2BatchCreateResponse } from './shared/sourceaccountv2batchcreateresponse'; +import { + instanceOfSourceAccountV2BatchCreateResponse, + SourceAccountV2BatchCreateResponseFromJSON, + SourceAccountV2BatchCreateResponseFromJSONTyped, + SourceAccountV2BatchCreateResponseToJSON, +} from './shared/sourceaccountv2batchcreateresponse'; + +/** + * @type CreateBatchSourceAccount201ResponseInner + * + * @export + */ +export type CreateBatchSourceAccount201ResponseInner = SourceAccountBatchCreateResponse | SourceAccountV2BatchCreateResponse; + +export function CreateBatchSourceAccount201ResponseInnerFromJSON(json: any): CreateBatchSourceAccount201ResponseInner { + return CreateBatchSourceAccount201ResponseInnerFromJSONTyped(json, false); +} + +export function CreateBatchSourceAccount201ResponseInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBatchSourceAccount201ResponseInner { + if (json == null) { + return json; + } + if (instanceOfSourceAccountBatchCreateResponse(json)) { + return SourceAccountBatchCreateResponseFromJSONTyped(json, true); + } + if (instanceOfSourceAccountV2BatchCreateResponse(json)) { + return SourceAccountV2BatchCreateResponseFromJSONTyped(json, true); + } + + return {} as any; +} + +export function CreateBatchSourceAccount201ResponseInnerToJSON(json: any): any { + return CreateBatchSourceAccount201ResponseInnerToJSONTyped(json, false); +} + +export function CreateBatchSourceAccount201ResponseInnerToJSONTyped(value?: CreateBatchSourceAccount201ResponseInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (instanceOfSourceAccountBatchCreateResponse(value)) { + return SourceAccountBatchCreateResponseToJSON(value as SourceAccountBatchCreateResponse); + } + if (instanceOfSourceAccountV2BatchCreateResponse(value)) { + return SourceAccountV2BatchCreateResponseToJSON(value as SourceAccountV2BatchCreateResponse); + } + + return {}; +} + diff --git a/bank-feeds/src/sdk/models/CreateBatchSourceAccount207ResponseInner.ts b/bank-feeds/src/sdk/models/CreateBatchSourceAccount207ResponseInner.ts new file mode 100644 index 000000000..a66801e13 --- /dev/null +++ b/bank-feeds/src/sdk/models/CreateBatchSourceAccount207ResponseInner.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { SourceAccountBatchCreateResponse } from './shared/sourceaccountbatchcreateresponse'; +import { + instanceOfSourceAccountBatchCreateResponse, + SourceAccountBatchCreateResponseFromJSON, + SourceAccountBatchCreateResponseFromJSONTyped, + SourceAccountBatchCreateResponseToJSON, +} from './shared/sourceaccountbatchcreateresponse'; +import type { SourceAccountBatchErrorResponse } from './shared/sourceaccountbatcherrorresponse'; +import { + instanceOfSourceAccountBatchErrorResponse, + SourceAccountBatchErrorResponseFromJSON, + SourceAccountBatchErrorResponseFromJSONTyped, + SourceAccountBatchErrorResponseToJSON, +} from './shared/sourceaccountbatcherrorresponse'; +import type { SourceAccountV2BatchCreateResponse } from './shared/sourceaccountv2batchcreateresponse'; +import { + instanceOfSourceAccountV2BatchCreateResponse, + SourceAccountV2BatchCreateResponseFromJSON, + SourceAccountV2BatchCreateResponseFromJSONTyped, + SourceAccountV2BatchCreateResponseToJSON, +} from './shared/sourceaccountv2batchcreateresponse'; + +/** + * @type CreateBatchSourceAccount207ResponseInner + * + * @export + */ +export type CreateBatchSourceAccount207ResponseInner = SourceAccountBatchCreateResponse | SourceAccountBatchErrorResponse | SourceAccountV2BatchCreateResponse; + +export function CreateBatchSourceAccount207ResponseInnerFromJSON(json: any): CreateBatchSourceAccount207ResponseInner { + return CreateBatchSourceAccount207ResponseInnerFromJSONTyped(json, false); +} + +export function CreateBatchSourceAccount207ResponseInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBatchSourceAccount207ResponseInner { + if (json == null) { + return json; + } + if (instanceOfSourceAccountBatchCreateResponse(json)) { + return SourceAccountBatchCreateResponseFromJSONTyped(json, true); + } + if (instanceOfSourceAccountBatchErrorResponse(json)) { + return SourceAccountBatchErrorResponseFromJSONTyped(json, true); + } + if (instanceOfSourceAccountV2BatchCreateResponse(json)) { + return SourceAccountV2BatchCreateResponseFromJSONTyped(json, true); + } + + return {} as any; +} + +export function CreateBatchSourceAccount207ResponseInnerToJSON(json: any): any { + return CreateBatchSourceAccount207ResponseInnerToJSONTyped(json, false); +} + +export function CreateBatchSourceAccount207ResponseInnerToJSONTyped(value?: CreateBatchSourceAccount207ResponseInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (instanceOfSourceAccountBatchCreateResponse(value)) { + return SourceAccountBatchCreateResponseToJSON(value as SourceAccountBatchCreateResponse); + } + if (instanceOfSourceAccountBatchErrorResponse(value)) { + return SourceAccountBatchErrorResponseToJSON(value as SourceAccountBatchErrorResponse); + } + if (instanceOfSourceAccountV2BatchCreateResponse(value)) { + return SourceAccountV2BatchCreateResponseToJSON(value as SourceAccountV2BatchCreateResponse); + } + + return {}; +} + diff --git a/bank-feeds/src/sdk/models/CreateCompanyRequest.ts b/bank-feeds/src/sdk/models/CreateCompanyRequest.ts new file mode 100644 index 000000000..ec06f2e2e --- /dev/null +++ b/bank-feeds/src/sdk/models/CreateCompanyRequest.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ + +import type { CompanyRequestBody } from './shared/companyrequestbody'; +/* eslint-disable */ + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} + +export interface CompanyRequestBodyCreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} diff --git a/bank-feeds/src/sdk/models/CreateSourceAccount200Response.ts b/bank-feeds/src/sdk/models/CreateSourceAccount200Response.ts new file mode 100644 index 000000000..07571a007 --- /dev/null +++ b/bank-feeds/src/sdk/models/CreateSourceAccount200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { SourceAccount } from './shared/sourceaccount'; +import { + instanceOfSourceAccount, + SourceAccountFromJSON, + SourceAccountFromJSONTyped, + SourceAccountToJSON, +} from './shared/sourceaccount'; +import type { SourceAccountV2 } from './shared/sourceaccountv2'; +import { + instanceOfSourceAccountV2, + SourceAccountV2FromJSON, + SourceAccountV2FromJSONTyped, + SourceAccountV2ToJSON, +} from './shared/sourceaccountv2'; + +/** + * @type CreateSourceAccount200Response + * + * @export + */ +export type CreateSourceAccount200Response = SourceAccount | SourceAccountV2; + +export function CreateSourceAccount200ResponseFromJSON(json: any): CreateSourceAccount200Response { + return CreateSourceAccount200ResponseFromJSONTyped(json, false); +} + +export function CreateSourceAccount200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSourceAccount200Response { + if (json == null) { + return json; + } + if (instanceOfSourceAccount(json)) { + return SourceAccountFromJSONTyped(json, true); + } + if (instanceOfSourceAccountV2(json)) { + return SourceAccountV2FromJSONTyped(json, true); + } + + return {} as any; +} + +export function CreateSourceAccount200ResponseToJSON(json: any): any { + return CreateSourceAccount200ResponseToJSONTyped(json, false); +} + +export function CreateSourceAccount200ResponseToJSONTyped(value?: CreateSourceAccount200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (instanceOfSourceAccount(value)) { + return SourceAccountToJSON(value as SourceAccount); + } + if (instanceOfSourceAccountV2(value)) { + return SourceAccountV2ToJSON(value as SourceAccountV2); + } + + return {}; +} + diff --git a/bank-feeds/src/sdk/models/ErrorMessage.ts b/bank-feeds/src/sdk/models/ErrorMessage.ts new file mode 100644 index 000000000..0801c13f3 --- /dev/null +++ b/bank-feeds/src/sdk/models/ErrorMessage.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { ErrorValidation } from './shared/errorvalidation'; +import { + ErrorValidationFromJSON, + ErrorValidationFromJSONTyped, + ErrorValidationToJSON, + ErrorValidationToJSONTyped, +} from './shared/errorvalidation'; + +/** + * + * @export + * @interface ErrorMessage + */ +export interface ErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +/** + * Check if a given object implements the ErrorMessage interface. + */ +export function instanceOfErrorMessage(value: object): value is ErrorMessage { + return true; +} + +export function ErrorMessageFromJSON(json: any): ErrorMessage { + return ErrorMessageFromJSONTyped(json, false); +} + +export function ErrorMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorMessage { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'service': json['service'] == null ? undefined : json['service'], + 'error': json['error'] == null ? undefined : json['error'], + 'correlationId': json['correlationId'] == null ? undefined : json['correlationId'], + 'validation': json['validation'] == null ? undefined : ErrorValidationFromJSON(json['validation']), + 'canBeRetried': json['canBeRetried'] == null ? undefined : json['canBeRetried'], + 'detailedErrorCode': json['detailedErrorCode'] == null ? undefined : json['detailedErrorCode'], + }; +} + +export function ErrorMessageToJSON(json: any): ErrorMessage { + return ErrorMessageToJSONTyped(json, false); +} + +export function ErrorMessageToJSONTyped(value?: ErrorMessage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'service': value['service'], + 'error': value['error'], + 'correlationId': value['correlationId'], + 'validation': ErrorValidationToJSON(value['validation']), + 'canBeRetried': value['canBeRetried'], + 'detailedErrorCode': value['detailedErrorCode'], + }; +} + + +export interface ErrorMessageData { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} diff --git a/bank-feeds/src/sdk/models/Items.ts b/bank-feeds/src/sdk/models/Items.ts new file mode 100644 index 000000000..b78872e5d --- /dev/null +++ b/bank-feeds/src/sdk/models/Items.ts @@ -0,0 +1,550 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { BankAccountStatus } from './shared/bankaccountstatus'; +import { + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './shared/bankaccountstatus'; + +/** + * > **Accessing Bank Accounts through Banking API** + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > + * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. + * + * ## Overview + * + * A list of bank accounts associated with a company and a specific data connection. + * + * Bank accounts data includes: + * * The name and ID of the account in the accounting software. + * * The currency and balance of the account. + * * The sort code and account number. + * @export + * @interface Items + */ +export interface Items { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof Items + */ + accountName?: string; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof Items + */ + accountType?: ItemsAccountTypeEnum; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof Items + */ + nominalCode?: string; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof Items + */ + sortCode?: string; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof Items + */ + accountNumber?: string; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof Items + */ + iBan?: string; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof Items + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof Items + */ + balance?: Decimal | number; + /** + * The institution of the bank account. + * @type {string} + * @memberof Items + */ + institution?: string; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof Items + */ + availableBalance?: Decimal | number; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof Items + */ + overdraftLimit?: Decimal | number; + /** + * + * @type {BankAccountStatus} + * @memberof Items + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof Items + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Items + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Items + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + sourceModifiedDate?: string; +} + + +/** + * @export + */ +export const ItemsAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type ItemsAccountTypeEnum = typeof ItemsAccountTypeEnum[keyof typeof ItemsAccountTypeEnum]; + + +/** + * Check if a given object implements the Items interface. + */ +export function instanceOfItems(value: object): value is Items { + return true; +} + +export function ItemsFromJSON(json: any): Items { + return ItemsFromJSONTyped(json, false); +} + +export function ItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Items { + if (json == null) { + return json; + } + return { + + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'id': json['id'] == null ? undefined : json['id'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function ItemsToJSON(json: any): Items { + return ItemsToJSONTyped(json, false); +} + +export function ItemsToJSONTyped(value?: Items | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + 'id': value['id'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface BankAccountCreateResponseItems { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof Items + */ + accountName?: string; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof Items + */ + accountType?: ItemsAccountTypeEnum; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof Items + */ + nominalCode?: string; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof Items + */ + sortCode?: string; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof Items + */ + accountNumber?: string; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof Items + */ + iBan?: string; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof Items + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof Items + */ + balance?: Decimal | number; + /** + * The institution of the bank account. + * @type {string} + * @memberof Items + */ + institution?: string; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof Items + */ + availableBalance?: Decimal | number; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof Items + */ + overdraftLimit?: Decimal | number; + /** + * + * @type {BankAccountStatus} + * @memberof Items + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof Items + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Items + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Items + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + sourceModifiedDate?: string; +} + +export interface CreateBankAccountResponseItems { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof Items + */ + accountName?: string; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof Items + */ + accountType?: ItemsAccountTypeEnum; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof Items + */ + nominalCode?: string; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof Items + */ + sortCode?: string; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof Items + */ + accountNumber?: string; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof Items + */ + iBan?: string; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof Items + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof Items + */ + balance?: Decimal | number; + /** + * The institution of the bank account. + * @type {string} + * @memberof Items + */ + institution?: string; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof Items + */ + availableBalance?: Decimal | number; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof Items + */ + overdraftLimit?: Decimal | number; + /** + * + * @type {BankAccountStatus} + * @memberof Items + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof Items + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Items + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Items + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Items + */ + sourceModifiedDate?: string; +} diff --git a/bank-feeds/src/sdk/models/ListSourceAccounts200Response.ts b/bank-feeds/src/sdk/models/ListSourceAccounts200Response.ts new file mode 100644 index 000000000..b4631f976 --- /dev/null +++ b/bank-feeds/src/sdk/models/ListSourceAccounts200Response.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ + +import { SourceAccountFromJSON, SourceAccountToJSON } from './shared/sourceaccount'; +import type { SourceAccount } from './shared/sourceaccount'; +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @type ListSourceAccounts200Response + * + * @export + */ +export type ListSourceAccounts200Response = Array; + +export function ListSourceAccounts200ResponseFromJSON(json: any): ListSourceAccounts200Response { + return ListSourceAccounts200ResponseFromJSONTyped(json, false); +} + +export function ListSourceAccounts200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListSourceAccounts200Response { + if (json == null) { + return json; + } + + return (json as Array).map(SourceAccountFromJSON); +} + +export function ListSourceAccounts200ResponseToJSON(json: any): any { + return ListSourceAccounts200ResponseToJSONTyped(json, false); +} + +export function ListSourceAccounts200ResponseToJSONTyped(value?: ListSourceAccounts200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + + return (value as Array).map(SourceAccountToJSON); +} + diff --git a/bank-feeds/src/sdk/models/Model1.ts b/bank-feeds/src/sdk/models/Model1.ts new file mode 100644 index 000000000..986c7f325 --- /dev/null +++ b/bank-feeds/src/sdk/models/Model1.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface Model1 + */ +export interface Model1 { + /** + * Current page number. + * @type {number} + * @memberof Model1 + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Model1 + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Model1 + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Model1 + */ + links: Links; +} + +/** + * Check if a given object implements the Model1 interface. + */ +export function instanceOfModel1(value: object): value is Model1 { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function Model1FromJSON(json: any): Model1 { + return Model1FromJSONTyped(json, false); +} + +export function Model1FromJSONTyped(json: any, ignoreDiscriminator: boolean): Model1 { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + }; +} + +export function Model1ToJSON(json: any): Model1 { + return Model1ToJSONTyped(json, false); +} + +export function Model1ToJSONTyped(value?: Model1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + }; +} + diff --git a/bank-feeds/src/sdk/models/PullOperation.ts b/bank-feeds/src/sdk/models/PullOperation.ts new file mode 100644 index 000000000..79941c701 --- /dev/null +++ b/bank-feeds/src/sdk/models/PullOperation.ts @@ -0,0 +1,341 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { DatasetStatus } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +/** + * Information about a queued, in progress or completed pull operation. + * *Formally called `dataset`* + * @export + * @interface PullOperation + */ +export interface PullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + + +/** + * @export + */ +export const PullOperationStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type PullOperationStatusEnum = typeof PullOperationStatusEnum[keyof typeof PullOperationStatusEnum]; + + +/** + * Check if a given object implements the PullOperation interface. + */ +export function instanceOfPullOperation(value: object): value is PullOperation { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('connectionId' in value) || value['connectionId'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('requested' in value) || value['requested'] === undefined) return false; + if (!('progress' in value) || value['progress'] === undefined) return false; + if (!('isCompleted' in value) || value['isCompleted'] === undefined) return false; + if (!('isErrored' in value) || value['isErrored'] === undefined) return false; + return true; +} + +export function PullOperationFromJSON(json: any): PullOperation { + return PullOperationFromJSONTyped(json, false); +} + +export function PullOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperation { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'companyId': json['companyId'], + 'connectionId': json['connectionId'], + 'dataType': json['dataType'], + 'status': json['status'], + 'statusDescription': json['statusDescription'] == null ? undefined : json['statusDescription'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'requested': json['requested'], + 'completed': json['completed'] == null ? undefined : json['completed'], + 'progress': json['progress'], + 'isCompleted': json['isCompleted'], + 'isErrored': json['isErrored'], + }; +} + +export function PullOperationToJSON(json: any): PullOperation { + return PullOperationToJSONTyped(json, false); +} + +export function PullOperationToJSONTyped(value?: PullOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'dataType': value['dataType'], + 'status': value['status'], + 'statusDescription': value['statusDescription'], + 'errorMessage': value['errorMessage'], + 'requested': value['requested'], + 'completed': value['completed'], + 'progress': value['progress'], + 'isCompleted': value['isCompleted'], + 'isErrored': value['isErrored'], + }; +} + + +export interface PullOperationsPullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} diff --git a/bank-feeds/src/sdk/models/PullOperations.ts b/bank-feeds/src/sdk/models/PullOperations.ts new file mode 100644 index 000000000..cfc9df040 --- /dev/null +++ b/bank-feeds/src/sdk/models/PullOperations.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { PullOperation } from './PullOperation'; +import { + PullOperationFromJSON, + PullOperationFromJSONTyped, + PullOperationToJSON, + PullOperationToJSONTyped, +} from './PullOperation'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface PullOperations + */ +export interface PullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PullOperations interface. + */ +export function instanceOfPullOperations(value: object): value is PullOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PullOperationsFromJSON(json: any): PullOperations { + return PullOperationsFromJSONTyped(json, false); +} + +export function PullOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PullOperationFromJSON)), + }; +} + +export function PullOperationsToJSON(json: any): PullOperations { + return PullOperationsToJSONTyped(json, false); +} + +export function PullOperationsToJSONTyped(value?: PullOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PullOperationToJSON)), + }; +} + diff --git a/bank-feeds/src/sdk/models/SourceAccountBatchErrorResponseResult.ts b/bank-feeds/src/sdk/models/SourceAccountBatchErrorResponseResult.ts new file mode 100644 index 000000000..aadc5c8a2 --- /dev/null +++ b/bank-feeds/src/sdk/models/SourceAccountBatchErrorResponseResult.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface SourceAccountBatchErrorResponseResult + */ +export interface SourceAccountBatchErrorResponseResult { + /** + * The error status code for the attempted creation of the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponseResult + */ + statusCode?: string; + /** + * The error description for the attempted creation of the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponseResult + */ + error?: string; +} + +/** + * Check if a given object implements the SourceAccountBatchErrorResponseResult interface. + */ +export function instanceOfSourceAccountBatchErrorResponseResult(value: object): value is SourceAccountBatchErrorResponseResult { + return true; +} + +export function SourceAccountBatchErrorResponseResultFromJSON(json: any): SourceAccountBatchErrorResponseResult { + return SourceAccountBatchErrorResponseResultFromJSONTyped(json, false); +} + +export function SourceAccountBatchErrorResponseResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountBatchErrorResponseResult { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'error': json['error'] == null ? undefined : json['error'], + }; +} + +export function SourceAccountBatchErrorResponseResultToJSON(json: any): SourceAccountBatchErrorResponseResult { + return SourceAccountBatchErrorResponseResultToJSONTyped(json, false); +} + +export function SourceAccountBatchErrorResponseResultToJSONTyped(value?: SourceAccountBatchErrorResponseResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'error': value['error'], + }; +} + + +export interface Result { + /** + * The error status code for the attempted creation of the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponseResult + */ + statusCode?: string; + /** + * The error description for the attempted creation of the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponseResult + */ + error?: string; +} diff --git a/bank-feeds/src/sdk/models/UpdateConnection.ts b/bank-feeds/src/sdk/models/UpdateConnection.ts new file mode 100644 index 000000000..44b305cd2 --- /dev/null +++ b/bank-feeds/src/sdk/models/UpdateConnection.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { DataConnectionStatus } from './shared/dataconnectionstatus'; +import { + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './shared/dataconnectionstatus'; + +/** + * + * @export + * @interface UpdateConnection + */ +export interface UpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + + + +/** + * Check if a given object implements the UpdateConnection interface. + */ +export function instanceOfUpdateConnection(value: object): value is UpdateConnection { + return true; +} + +export function UpdateConnectionFromJSON(json: any): UpdateConnection { + return UpdateConnectionFromJSONTyped(json, false); +} + +export function UpdateConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateConnection { + if (json == null) { + return json; + } + return { + + ...json, + 'status': json['status'] == null ? undefined : DataConnectionStatusFromJSON(json['status']), + }; +} + +export function UpdateConnectionToJSON(json: any): UpdateConnection { + return UpdateConnectionToJSONTyped(json, false); +} + +export function UpdateConnectionToJSONTyped(value?: UpdateConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'status': DataConnectionStatusToJSON(value['status']), + }; +} + + +export interface ConnectionUnlinkRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionUpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} diff --git a/bank-feeds/src/sdk/models/_speakeasy_enums.ts b/bank-feeds/src/sdk/models/_speakeasy_enums.ts new file mode 100644 index 000000000..3e3e963d0 --- /dev/null +++ b/bank-feeds/src/sdk/models/_speakeasy_enums.ts @@ -0,0 +1,4159 @@ +/* tslint:disable */ +/* eslint-disable */ + +export const AccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type AccountAccountType = (typeof AccountAccountType)[keyof typeof AccountAccountType]; +export const AccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type AccountStatus = "Active" | "Archived" | "Pending" | "Unknown" | "connected" | "connecting" | "disconnected" | "pending" | "unknown"; +export const AccountStatus1 = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type AccountStatus1 = "Active" | "Archived" | "Pending" | "Unknown" | "connected" | "connecting" | "disconnected" | "pending" | "unknown"; +export const AccountStatus2 = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type AccountStatus2 = "Active" | "Archived" | "Pending" | "Unknown" | "connected" | "connecting" | "disconnected" | "pending" | "unknown"; +export const AccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountStatusBankAccountStatus = (typeof AccountStatusBankAccountStatus)[keyof typeof AccountStatusBankAccountStatus]; +export const AccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type AccountType = (typeof AccountType)[keyof typeof AccountType]; +export const AccountType1 = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type AccountType1 = (typeof AccountType1)[keyof typeof AccountType1]; +export const AccountType2 = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type AccountType2 = (typeof AccountType2)[keyof typeof AccountType2]; +export const AccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountTypeBankAccountType = (typeof AccountTypeBankAccountType)[keyof typeof AccountTypeBankAccountType]; +export const AccountingBankAccountAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountAccountType = (typeof AccountingBankAccountAccountType)[keyof typeof AccountingBankAccountAccountType]; +export const AccountingBankAccountBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountBankAccountType = (typeof AccountingBankAccountBankAccountType)[keyof typeof AccountingBankAccountBankAccountType]; +export const BankAccountCreateResponseAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseAccountType = (typeof BankAccountCreateResponseAccountType)[keyof typeof BankAccountCreateResponseAccountType]; +export const BankAccountCreateResponseBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseBankAccountType = (typeof BankAccountCreateResponseBankAccountType)[keyof typeof BankAccountCreateResponseBankAccountType]; +export const BankAccountCreateResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountCreateResponseDataType = (typeof BankAccountCreateResponseDataType)[keyof typeof BankAccountCreateResponseDataType]; +export const BankAccountCreateResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponsePushChangeType = (typeof BankAccountCreateResponsePushChangeType)[keyof typeof BankAccountCreateResponsePushChangeType]; +export const BankAccountCreateResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountCreateResponsePushOperationStatus = (typeof BankAccountCreateResponsePushOperationStatus)[keyof typeof BankAccountCreateResponsePushOperationStatus]; +export const BankAccountCreateResponseRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountCreateResponseRecordRefDataType = (typeof BankAccountCreateResponseRecordRefDataType)[keyof typeof BankAccountCreateResponseRecordRefDataType]; +export const BankAccountCreateResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountCreateResponseStatusPushOperationStatus = (typeof BankAccountCreateResponseStatusPushOperationStatus)[keyof typeof BankAccountCreateResponseStatusPushOperationStatus]; +export const BankAccountCreateResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseTypePushChangeType = (typeof BankAccountCreateResponseTypePushChangeType)[keyof typeof BankAccountCreateResponseTypePushChangeType]; +export const BankAccountPrototypeAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeAccountType = (typeof BankAccountPrototypeAccountType)[keyof typeof BankAccountPrototypeAccountType]; +export const BankAccountPrototypeAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeAccountTypeBankAccountType = (typeof BankAccountPrototypeAccountTypeBankAccountType)[keyof typeof BankAccountPrototypeAccountTypeBankAccountType]; +export const BankAccountPrototypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeBankAccountType = (typeof BankAccountPrototypeBankAccountType)[keyof typeof BankAccountPrototypeBankAccountType]; +export const BankAccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountStatusBankAccountStatus = (typeof BankAccountStatusBankAccountStatus)[keyof typeof BankAccountStatusBankAccountStatus]; +export const BankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountType = (typeof BankAccountType)[keyof typeof BankAccountType]; +export const BankAccountsAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountsAccountTypeBankAccountType = (typeof BankAccountsAccountTypeBankAccountType)[keyof typeof BankAccountsAccountTypeBankAccountType]; +export const BankAccountsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountsBankAccountStatus = (typeof BankAccountsBankAccountStatus)[keyof typeof BankAccountsBankAccountStatus]; +export const BankAccountsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountsBankAccountType = (typeof BankAccountsBankAccountType)[keyof typeof BankAccountsBankAccountType]; +export const BankAccountsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountsDataType = (typeof BankAccountsDataType)[keyof typeof BankAccountsDataType]; +export const BankAccountsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsPushChangeType = (typeof BankAccountsPushChangeType)[keyof typeof BankAccountsPushChangeType]; +export const BankAccountsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsPushOperationStatus = (typeof BankAccountsPushOperationStatus)[keyof typeof BankAccountsPushOperationStatus]; +export const BankAccountsRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountsRecordRefDataType = (typeof BankAccountsRecordRefDataType)[keyof typeof BankAccountsRecordRefDataType]; +export const BankAccountsResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountsResultsBankAccountStatus = (typeof BankAccountsResultsBankAccountStatus)[keyof typeof BankAccountsResultsBankAccountStatus]; +export const BankAccountsResultsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountsResultsDataType = (typeof BankAccountsResultsDataType)[keyof typeof BankAccountsResultsDataType]; +export const BankAccountsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsResultsPushChangeType = (typeof BankAccountsResultsPushChangeType)[keyof typeof BankAccountsResultsPushChangeType]; +export const BankAccountsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsResultsPushOperationStatus = (typeof BankAccountsResultsPushOperationStatus)[keyof typeof BankAccountsResultsPushOperationStatus]; +export const BankAccountsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsStatusPushOperationStatus = (typeof BankAccountsStatusPushOperationStatus)[keyof typeof BankAccountsStatusPushOperationStatus]; +export const BankAccountsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsTypePushChangeType = (typeof BankAccountsTypePushChangeType)[keyof typeof BankAccountsTypePushChangeType]; +export const BankTransactionBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type BankTransactionBankTransactionType = (typeof BankTransactionBankTransactionType)[keyof typeof BankTransactionBankTransactionType]; +export const BankTransactionTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type BankTransactionTransactionType = (typeof BankTransactionTransactionType)[keyof typeof BankTransactionTransactionType]; +export const BankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type BankTransactionType = (typeof BankTransactionType)[keyof typeof BankTransactionType]; +export const BankTransactionsBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type BankTransactionsBankTransactionType = (typeof BankTransactionsBankTransactionType)[keyof typeof BankTransactionsBankTransactionType]; +export const BankTransactionsTransactionTypeBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type BankTransactionsTransactionTypeBankTransactionType = (typeof BankTransactionsTransactionTypeBankTransactionType)[keyof typeof BankTransactionsTransactionTypeBankTransactionType]; +export const CompaniesDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionSourceType = (typeof CompaniesDataConnectionSourceType)[keyof typeof CompaniesDataConnectionSourceType]; +export const CompaniesDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionStatus = (typeof CompaniesDataConnectionStatus)[keyof typeof CompaniesDataConnectionStatus]; +export const CompaniesDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionsDataConnectionSourceType = (typeof CompaniesDataConnectionsDataConnectionSourceType)[keyof typeof CompaniesDataConnectionsDataConnectionSourceType]; +export const CompaniesDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionsDataConnectionStatus = (typeof CompaniesDataConnectionsDataConnectionStatus)[keyof typeof CompaniesDataConnectionsDataConnectionStatus]; +export const CompaniesErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesErrorStatus = (typeof CompaniesErrorStatus)[keyof typeof CompaniesErrorStatus]; +export const CompaniesSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesSourceTypeDataConnectionSourceType = (typeof CompaniesSourceTypeDataConnectionSourceType)[keyof typeof CompaniesSourceTypeDataConnectionSourceType]; +export const CompaniesStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesStatusDataConnectionStatus = (typeof CompaniesStatusDataConnectionStatus)[keyof typeof CompaniesStatusDataConnectionStatus]; +export const CompaniesStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesStatusErrorStatus = (typeof CompaniesStatusErrorStatus)[keyof typeof CompaniesStatusErrorStatus]; +export const CompanyDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionSourceType = (typeof CompanyDataConnectionSourceType)[keyof typeof CompanyDataConnectionSourceType]; +export const CompanyDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionStatus = (typeof CompanyDataConnectionStatus)[keyof typeof CompanyDataConnectionStatus]; +export const CompanyDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionsDataConnectionSourceType = (typeof CompanyDataConnectionsDataConnectionSourceType)[keyof typeof CompanyDataConnectionsDataConnectionSourceType]; +export const CompanyDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionsDataConnectionStatus = (typeof CompanyDataConnectionsDataConnectionStatus)[keyof typeof CompanyDataConnectionsDataConnectionStatus]; +export const CompanyErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyErrorStatus = (typeof CompanyErrorStatus)[keyof typeof CompanyErrorStatus]; +export const CompanySourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanySourceTypeDataConnectionSourceType = (typeof CompanySourceTypeDataConnectionSourceType)[keyof typeof CompanySourceTypeDataConnectionSourceType]; +export const CompanyStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyStatusDataConnectionStatus = (typeof CompanyStatusDataConnectionStatus)[keyof typeof CompanyStatusDataConnectionStatus]; +export const CompanyStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyStatusErrorStatus = (typeof CompanyStatusErrorStatus)[keyof typeof CompanyStatusErrorStatus]; +export const ConnectionDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionDataConnectionSourceType = (typeof ConnectionDataConnectionSourceType)[keyof typeof ConnectionDataConnectionSourceType]; +export const ConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionDataConnectionStatus = (typeof ConnectionDataConnectionStatus)[keyof typeof ConnectionDataConnectionStatus]; +export const ConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionErrorStatus = (typeof ConnectionErrorStatus)[keyof typeof ConnectionErrorStatus]; +export const ConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceType = (typeof ConnectionSourceType)[keyof typeof ConnectionSourceType]; +export const ConnectionSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceTypeDataConnectionSourceType = (typeof ConnectionSourceTypeDataConnectionSourceType)[keyof typeof ConnectionSourceTypeDataConnectionSourceType]; +export const ConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionStatusDataConnectionStatus = (typeof ConnectionStatusDataConnectionStatus)[keyof typeof ConnectionStatusDataConnectionStatus]; +export const ConnectionStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionStatusErrorStatus = (typeof ConnectionStatusErrorStatus)[keyof typeof ConnectionStatusErrorStatus]; +export const ConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsDataConnectionSourceType = (typeof ConnectionsDataConnectionSourceType)[keyof typeof ConnectionsDataConnectionSourceType]; +export const ConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsDataConnectionStatus = (typeof ConnectionsDataConnectionStatus)[keyof typeof ConnectionsDataConnectionStatus]; +export const ConnectionsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsErrorStatus = (typeof ConnectionsErrorStatus)[keyof typeof ConnectionsErrorStatus]; +export const ConnectionsResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsResultsDataConnectionSourceType = (typeof ConnectionsResultsDataConnectionSourceType)[keyof typeof ConnectionsResultsDataConnectionSourceType]; +export const ConnectionsResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsResultsDataConnectionStatus = (typeof ConnectionsResultsDataConnectionStatus)[keyof typeof ConnectionsResultsDataConnectionStatus]; +export const ConnectionsSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsSourceTypeDataConnectionSourceType = (typeof ConnectionsSourceTypeDataConnectionSourceType)[keyof typeof ConnectionsSourceTypeDataConnectionSourceType]; +export const ConnectionsStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsStatusDataConnectionStatus = (typeof ConnectionsStatusDataConnectionStatus)[keyof typeof ConnectionsStatusDataConnectionStatus]; +export const ConnectionsStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsStatusErrorStatus = (typeof ConnectionsStatusErrorStatus)[keyof typeof ConnectionsStatusErrorStatus]; +export const CreateBankAccountResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankAccountResponseDataType = (typeof CreateBankAccountResponseDataType)[keyof typeof CreateBankAccountResponseDataType]; +export const CreateBankAccountResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponsePushChangeType = (typeof CreateBankAccountResponsePushChangeType)[keyof typeof CreateBankAccountResponsePushChangeType]; +export const CreateBankAccountResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankAccountResponsePushOperationStatus = (typeof CreateBankAccountResponsePushOperationStatus)[keyof typeof CreateBankAccountResponsePushOperationStatus]; +export const CreateBankAccountResponseRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankAccountResponseRecordRefDataType = (typeof CreateBankAccountResponseRecordRefDataType)[keyof typeof CreateBankAccountResponseRecordRefDataType]; +export const CreateBankAccountResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankAccountResponseStatusPushOperationStatus = (typeof CreateBankAccountResponseStatusPushOperationStatus)[keyof typeof CreateBankAccountResponseStatusPushOperationStatus]; +export const CreateBankAccountResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseTypePushChangeType = (typeof CreateBankAccountResponseTypePushChangeType)[keyof typeof CreateBankAccountResponseTypePushChangeType]; +export const CreateBankTransactionsBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type CreateBankTransactionsBankTransactionType = (typeof CreateBankTransactionsBankTransactionType)[keyof typeof CreateBankTransactionsBankTransactionType]; +export const CreateBankTransactionsResponseBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type CreateBankTransactionsResponseBankTransactionType = (typeof CreateBankTransactionsResponseBankTransactionType)[keyof typeof CreateBankTransactionsResponseBankTransactionType]; +export const CreateBankTransactionsResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankTransactionsResponseDataType = (typeof CreateBankTransactionsResponseDataType)[keyof typeof CreateBankTransactionsResponseDataType]; +export const CreateBankTransactionsResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankTransactionsResponsePushChangeType = (typeof CreateBankTransactionsResponsePushChangeType)[keyof typeof CreateBankTransactionsResponsePushChangeType]; +export const CreateBankTransactionsResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankTransactionsResponsePushOperationStatus = (typeof CreateBankTransactionsResponsePushOperationStatus)[keyof typeof CreateBankTransactionsResponsePushOperationStatus]; +export const CreateBankTransactionsResponseRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankTransactionsResponseRecordRefDataType = (typeof CreateBankTransactionsResponseRecordRefDataType)[keyof typeof CreateBankTransactionsResponseRecordRefDataType]; +export const CreateBankTransactionsResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankTransactionsResponseStatusPushOperationStatus = (typeof CreateBankTransactionsResponseStatusPushOperationStatus)[keyof typeof CreateBankTransactionsResponseStatusPushOperationStatus]; +export const CreateBankTransactionsResponseTransactionTypeBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type CreateBankTransactionsResponseTransactionTypeBankTransactionType = (typeof CreateBankTransactionsResponseTransactionTypeBankTransactionType)[keyof typeof CreateBankTransactionsResponseTransactionTypeBankTransactionType]; +export const CreateBankTransactionsResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankTransactionsResponseTypePushChangeType = (typeof CreateBankTransactionsResponseTypePushChangeType)[keyof typeof CreateBankTransactionsResponseTypePushChangeType]; +export const CreateBankTransactionsTransactionTypeBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type CreateBankTransactionsTransactionTypeBankTransactionType = (typeof CreateBankTransactionsTransactionTypeBankTransactionType)[keyof typeof CreateBankTransactionsTransactionTypeBankTransactionType]; +export const CreateBatchSourceAccountRequestBodyAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type CreateBatchSourceAccountRequestBodyAccountType = (typeof CreateBatchSourceAccountRequestBodyAccountType)[keyof typeof CreateBatchSourceAccountRequestBodyAccountType]; +export const CreateBatchSourceAccountRequestBodyRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type CreateBatchSourceAccountRequestBodyRoutingInfoType = (typeof CreateBatchSourceAccountRequestBodyRoutingInfoType)[keyof typeof CreateBatchSourceAccountRequestBodyRoutingInfoType]; +export const CreateBatchSourceAccountRequestBodyType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type CreateBatchSourceAccountRequestBodyType = (typeof CreateBatchSourceAccountRequestBodyType)[keyof typeof CreateBatchSourceAccountRequestBodyType]; +export const CreateSourceAccountRequestBodyAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type CreateSourceAccountRequestBodyAccountType = (typeof CreateSourceAccountRequestBodyAccountType)[keyof typeof CreateSourceAccountRequestBodyAccountType]; +export const CreateSourceAccountRequestBodyRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type CreateSourceAccountRequestBodyRoutingInfoType = (typeof CreateSourceAccountRequestBodyRoutingInfoType)[keyof typeof CreateSourceAccountRequestBodyRoutingInfoType]; +export const CreateSourceAccountRequestBodyType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type CreateSourceAccountRequestBodyType = (typeof CreateSourceAccountRequestBodyType)[keyof typeof CreateSourceAccountRequestBodyType]; +export const DataConnectionErrorErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorErrorStatus = (typeof DataConnectionErrorErrorStatus)[keyof typeof DataConnectionErrorErrorStatus]; +export const DataConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatus = (typeof DataConnectionErrorStatus)[keyof typeof DataConnectionErrorStatus]; +export const DataConnectionErrorStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatusErrorStatus = (typeof DataConnectionErrorStatusErrorStatus)[keyof typeof DataConnectionErrorStatusErrorStatus]; +export const DataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionSourceType = (typeof DataConnectionSourceType)[keyof typeof DataConnectionSourceType]; +export const DataConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionStatusDataConnectionStatus = (typeof DataConnectionStatusDataConnectionStatus)[keyof typeof DataConnectionStatusDataConnectionStatus]; +export const DataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionsDataConnectionSourceType = (typeof DataConnectionsDataConnectionSourceType)[keyof typeof DataConnectionsDataConnectionSourceType]; +export const DataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionsDataConnectionStatus = (typeof DataConnectionsDataConnectionStatus)[keyof typeof DataConnectionsDataConnectionStatus]; +export const DataTypeDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataType = (typeof DataTypeDataType)[keyof typeof DataTypeDataType]; +export const DataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypes = (typeof DataTypes)[keyof typeof DataTypes]; +export const DatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DatasetStatus = (typeof DatasetStatus)[keyof typeof DatasetStatus]; +export const ErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ErrorStatus = (typeof ErrorStatus)[keyof typeof ErrorStatus]; +export const ItemsAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type ItemsAccountType = (typeof ItemsAccountType)[keyof typeof ItemsAccountType]; +export const ItemsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ItemsBankAccountStatus = (typeof ItemsBankAccountStatus)[keyof typeof ItemsBankAccountStatus]; +export const ItemsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ItemsBankAccountType = (typeof ItemsBankAccountType)[keyof typeof ItemsBankAccountType]; +export const ItemsBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type ItemsBankTransactionType = (typeof ItemsBankTransactionType)[keyof typeof ItemsBankTransactionType]; +export const ItemsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ItemsDataConnectionSourceType = (typeof ItemsDataConnectionSourceType)[keyof typeof ItemsDataConnectionSourceType]; +export const ItemsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ItemsDataConnectionStatus = (typeof ItemsDataConnectionStatus)[keyof typeof ItemsDataConnectionStatus]; +export const ItemsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ItemsDataType = (typeof ItemsDataType)[keyof typeof ItemsDataType]; +export const ItemsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ItemsDatasetStatus = (typeof ItemsDatasetStatus)[keyof typeof ItemsDatasetStatus]; +export const ItemsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ItemsErrorStatus = (typeof ItemsErrorStatus)[keyof typeof ItemsErrorStatus]; +export const ItemsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ItemsPushChangeType = (typeof ItemsPushChangeType)[keyof typeof ItemsPushChangeType]; +export const ItemsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ItemsPushOperationStatus = (typeof ItemsPushOperationStatus)[keyof typeof ItemsPushOperationStatus]; +export const ItemsPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type ItemsPushOptionType = (typeof ItemsPushOptionType)[keyof typeof ItemsPushOptionType]; +export const ItemsStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type ItemsStatus = (typeof ItemsStatus)[keyof typeof ItemsStatus]; +export const ItemsType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type ItemsType = (typeof ItemsType)[keyof typeof ItemsType]; +export const OneDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type OneDataConnectionSourceType = (typeof OneDataConnectionSourceType)[keyof typeof OneDataConnectionSourceType]; +export const OneDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type OneDataConnectionStatus = (typeof OneDataConnectionStatus)[keyof typeof OneDataConnectionStatus]; +export const OneDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type OneDataType = (typeof OneDataType)[keyof typeof OneDataType]; +export const OneErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type OneErrorStatus = (typeof OneErrorStatus)[keyof typeof OneErrorStatus]; +export const OnePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type OnePushChangeType = (typeof OnePushChangeType)[keyof typeof OnePushChangeType]; +export const OnePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type OnePushOperationStatus = (typeof OnePushOperationStatus)[keyof typeof OnePushOperationStatus]; +export const OneStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type OneStatus = (typeof OneStatus)[keyof typeof OneStatus]; +export const OptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionType = (typeof OptionType)[keyof typeof OptionType]; +export const OptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionTypePushOptionType = (typeof OptionTypePushOptionType)[keyof typeof OptionTypePushOptionType]; +export const PayloadAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type PayloadAccountType = (typeof PayloadAccountType)[keyof typeof PayloadAccountType]; +export const PayloadRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type PayloadRoutingInfoType = (typeof PayloadRoutingInfoType)[keyof typeof PayloadRoutingInfoType]; +export const PayloadSourceAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type PayloadSourceAccountAccountType = (typeof PayloadSourceAccountAccountType)[keyof typeof PayloadSourceAccountAccountType]; +export const PayloadSourceAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type PayloadSourceAccountStatus = (typeof PayloadSourceAccountStatus)[keyof typeof PayloadSourceAccountStatus]; +export const PayloadSourceAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type PayloadSourceAccountType = (typeof PayloadSourceAccountType)[keyof typeof PayloadSourceAccountType]; +export const PayloadStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type PayloadStatus = (typeof PayloadStatus)[keyof typeof PayloadStatus]; +export const PayloadType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type PayloadType = (typeof PayloadType)[keyof typeof PayloadType]; +export const PropertieAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type PropertieAccountStatus = (typeof PropertieAccountStatus)[keyof typeof PropertieAccountStatus]; +export const PropertieAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type PropertieAccountType = (typeof PropertieAccountType)[keyof typeof PropertieAccountType]; +export const PropertieBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type PropertieBankAccountStatus = (typeof PropertieBankAccountStatus)[keyof typeof PropertieBankAccountStatus]; +export const PropertieBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type PropertieBankTransactionType = (typeof PropertieBankTransactionType)[keyof typeof PropertieBankTransactionType]; +export const PropertieDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieDataConnectionSourceType = (typeof PropertieDataConnectionSourceType)[keyof typeof PropertieDataConnectionSourceType]; +export const PropertieDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type PropertieDataConnectionStatus = (typeof PropertieDataConnectionStatus)[keyof typeof PropertieDataConnectionStatus]; +export const PropertieDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType = (typeof PropertieDataType)[keyof typeof PropertieDataType]; +export const PropertieDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataTypes = (typeof PropertieDataTypes)[keyof typeof PropertieDataTypes]; +export const PropertieErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type PropertieErrorStatus = (typeof PropertieErrorStatus)[keyof typeof PropertieErrorStatus]; +export const PropertieOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertieOptionType = (typeof PropertieOptionType)[keyof typeof PropertieOptionType]; +export const PropertiePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PropertiePushChangeType = (typeof PropertiePushChangeType)[keyof typeof PropertiePushChangeType]; +export const PropertiePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PropertiePushOperationStatus = (typeof PropertiePushOperationStatus)[keyof typeof PropertiePushOperationStatus]; +export const PropertiePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertiePushOptionType = (typeof PropertiePushOptionType)[keyof typeof PropertiePushOptionType]; +export const PropertieSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieSourceType = (typeof PropertieSourceType)[keyof typeof PropertieSourceType]; +export const PropertieStatus = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type PropertieStatus = (typeof PropertieStatus)[keyof typeof PropertieStatus]; +export const PropertieStatus1 = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type PropertieStatus1 = (typeof PropertieStatus1)[keyof typeof PropertieStatus1]; +export const PropertieStatus2 = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type PropertieStatus2 = (typeof PropertieStatus2)[keyof typeof PropertieStatus2]; +export const PropertieTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type PropertieTransactionType = (typeof PropertieTransactionType)[keyof typeof PropertieTransactionType]; +export const PropertieType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type PropertieType = (typeof PropertieType)[keyof typeof PropertieType]; +export const PullOperationDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationDatasetStatus = (typeof PullOperationDatasetStatus)[keyof typeof PullOperationDatasetStatus]; +export const PullOperationStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatus = (typeof PullOperationStatus)[keyof typeof PullOperationStatus]; +export const PullOperationStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatusDatasetStatus = (typeof PullOperationStatusDatasetStatus)[keyof typeof PullOperationStatusDatasetStatus]; +export const PullOperationsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsDatasetStatus = (typeof PullOperationsDatasetStatus)[keyof typeof PullOperationsDatasetStatus]; +export const PullOperationsStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsStatusDatasetStatus = (typeof PullOperationsStatusDatasetStatus)[keyof typeof PullOperationsStatusDatasetStatus]; +export const PushChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushChangeTypePushChangeType = (typeof PushChangeTypePushChangeType)[keyof typeof PushChangeTypePushChangeType]; +export const PushOperationChangeDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataType = (typeof PushOperationChangeDataType)[keyof typeof PushOperationChangeDataType]; +export const PushOperationChangePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangePushChangeType = (typeof PushOperationChangePushChangeType)[keyof typeof PushOperationChangePushChangeType]; +export const PushOperationChangeRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeRecordRefDataType = (typeof PushOperationChangeRecordRefDataType)[keyof typeof PushOperationChangeRecordRefDataType]; +export const PushOperationChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangeTypePushChangeType = (typeof PushOperationChangeTypePushChangeType)[keyof typeof PushOperationChangeTypePushChangeType]; +export const PushOperationDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataType = (typeof PushOperationDataType)[keyof typeof PushOperationDataType]; +export const PushOperationPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationPushChangeType = (typeof PushOperationPushChangeType)[keyof typeof PushOperationPushChangeType]; +export const PushOperationPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationPushOperationStatus = (typeof PushOperationPushOperationStatus)[keyof typeof PushOperationPushOperationStatus]; +export const PushOperationRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRecordRefDataType = (typeof PushOperationRecordRefDataType)[keyof typeof PushOperationRecordRefDataType]; +export const PushOperationRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataType = (typeof PushOperationRefDataType)[keyof typeof PushOperationRefDataType]; +export const PushOperationReferenceDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataType = (typeof PushOperationReferenceDataType)[keyof typeof PushOperationReferenceDataType]; +export const PushOperationStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationStatusPushOperationStatus = (typeof PushOperationStatusPushOperationStatus)[keyof typeof PushOperationStatusPushOperationStatus]; +export const PushOperationTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationTypePushChangeType = (typeof PushOperationTypePushChangeType)[keyof typeof PushOperationTypePushChangeType]; +export const PushOperationsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataType = (typeof PushOperationsDataType)[keyof typeof PushOperationsDataType]; +export const PushOperationsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsPushChangeType = (typeof PushOperationsPushChangeType)[keyof typeof PushOperationsPushChangeType]; +export const PushOperationsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsPushOperationStatus = (typeof PushOperationsPushOperationStatus)[keyof typeof PushOperationsPushOperationStatus]; +export const PushOperationsRecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsRecordRefDataType = (typeof PushOperationsRecordRefDataType)[keyof typeof PushOperationsRecordRefDataType]; +export const PushOperationsResultsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsResultsDataType = (typeof PushOperationsResultsDataType)[keyof typeof PushOperationsResultsDataType]; +export const PushOperationsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsResultsPushChangeType = (typeof PushOperationsResultsPushChangeType)[keyof typeof PushOperationsResultsPushChangeType]; +export const PushOperationsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsResultsPushOperationStatus = (typeof PushOperationsResultsPushOperationStatus)[keyof typeof PushOperationsResultsPushOperationStatus]; +export const PushOperationsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsStatusPushOperationStatus = (typeof PushOperationsStatusPushOperationStatus)[keyof typeof PushOperationsStatusPushOperationStatus]; +export const PushOperationsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsTypePushChangeType = (typeof PushOperationsTypePushChangeType)[keyof typeof PushOperationsTypePushChangeType]; +export const PushOptionChoicePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoicePushOptionType = (typeof PushOptionChoicePushOptionType)[keyof typeof PushOptionChoicePushOptionType]; +export const PushOptionChoiceTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoiceTypePushOptionType = (typeof PushOptionChoiceTypePushOptionType)[keyof typeof PushOptionChoiceTypePushOptionType]; +export const PushOptionPropertyPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyPushOptionType = (typeof PushOptionPropertyPushOptionType)[keyof typeof PushOptionPropertyPushOptionType]; +export const PushOptionPropertyTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyTypePushOptionType = (typeof PushOptionPropertyTypePushOptionType)[keyof typeof PushOptionPropertyTypePushOptionType]; +export const PushOptionPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPushOptionType = (typeof PushOptionPushOptionType)[keyof typeof PushOptionPushOptionType]; +export const PushOptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionTypePushOptionType = (typeof PushOptionTypePushOptionType)[keyof typeof PushOptionTypePushOptionType]; +export const RecordRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type RecordRefDataType = (typeof RecordRefDataType)[keyof typeof RecordRefDataType]; +export const ResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ResultsBankAccountStatus = (typeof ResultsBankAccountStatus)[keyof typeof ResultsBankAccountStatus]; +export const ResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ResultsDataConnectionSourceType = (typeof ResultsDataConnectionSourceType)[keyof typeof ResultsDataConnectionSourceType]; +export const ResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ResultsDataConnectionStatus = (typeof ResultsDataConnectionStatus)[keyof typeof ResultsDataConnectionStatus]; +export const ResultsDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ResultsDataType = (typeof ResultsDataType)[keyof typeof ResultsDataType]; +export const ResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ResultsPushChangeType = (typeof ResultsPushChangeType)[keyof typeof ResultsPushChangeType]; +export const ResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ResultsPushOperationStatus = (typeof ResultsPushOperationStatus)[keyof typeof ResultsPushOperationStatus]; +export const RoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type RoutingInfoType = (typeof RoutingInfoType)[keyof typeof RoutingInfoType]; +export const SchemaAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type SchemaAccountStatus = (typeof SchemaAccountStatus)[keyof typeof SchemaAccountStatus]; +export const SchemaAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SchemaAccountType = (typeof SchemaAccountType)[keyof typeof SchemaAccountType]; +export const SchemaBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type SchemaBankAccountStatus = (typeof SchemaBankAccountStatus)[keyof typeof SchemaBankAccountStatus]; +export const SchemaBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type SchemaBankTransactionType = (typeof SchemaBankTransactionType)[keyof typeof SchemaBankTransactionType]; +export const SchemaDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaDataConnectionSourceType = (typeof SchemaDataConnectionSourceType)[keyof typeof SchemaDataConnectionSourceType]; +export const SchemaDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type SchemaDataConnectionStatus = (typeof SchemaDataConnectionStatus)[keyof typeof SchemaDataConnectionStatus]; +export const SchemaDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType = (typeof SchemaDataType)[keyof typeof SchemaDataType]; +export const SchemaDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataTypes = (typeof SchemaDataTypes)[keyof typeof SchemaDataTypes]; +export const SchemaErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type SchemaErrorStatus = (typeof SchemaErrorStatus)[keyof typeof SchemaErrorStatus]; +export const SchemaOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaOptionType = (typeof SchemaOptionType)[keyof typeof SchemaOptionType]; +export const SchemaPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type SchemaPushChangeType = (typeof SchemaPushChangeType)[keyof typeof SchemaPushChangeType]; +export const SchemaPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type SchemaPushOperationStatus = (typeof SchemaPushOperationStatus)[keyof typeof SchemaPushOperationStatus]; +export const SchemaPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaPushOptionType = (typeof SchemaPushOptionType)[keyof typeof SchemaPushOptionType]; +export const SchemaSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaSourceType = (typeof SchemaSourceType)[keyof typeof SchemaSourceType]; +export const SchemaStatus = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SchemaStatus = (typeof SchemaStatus)[keyof typeof SchemaStatus]; +export const SchemaStatus1 = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SchemaStatus1 = (typeof SchemaStatus1)[keyof typeof SchemaStatus1]; +export const SchemaStatus2 = { + Active: "Active", + Resolved: "Resolved", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SchemaStatus2 = (typeof SchemaStatus2)[keyof typeof SchemaStatus2]; +export const SchemaTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type SchemaTransactionType = (typeof SchemaTransactionType)[keyof typeof SchemaTransactionType]; +export const SchemaType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; +export const SourceAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountAccountType = (typeof SourceAccountAccountType)[keyof typeof SourceAccountAccountType]; +export const SourceAccountBatchCreateResponseAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountBatchCreateResponseAccountStatus = (typeof SourceAccountBatchCreateResponseAccountStatus)[keyof typeof SourceAccountBatchCreateResponseAccountStatus]; +export const SourceAccountBatchCreateResponseStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountBatchCreateResponseStatus = (typeof SourceAccountBatchCreateResponseStatus)[keyof typeof SourceAccountBatchCreateResponseStatus]; +export const SourceAccountBatchCreateResultAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountBatchCreateResultAccountStatus = (typeof SourceAccountBatchCreateResultAccountStatus)[keyof typeof SourceAccountBatchCreateResultAccountStatus]; +export const SourceAccountBatchCreateResultStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountBatchCreateResultStatus = (typeof SourceAccountBatchCreateResultStatus)[keyof typeof SourceAccountBatchCreateResultStatus]; +export const SourceAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountStatus = (typeof SourceAccountStatus)[keyof typeof SourceAccountStatus]; +export const SourceAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountType = (typeof SourceAccountType)[keyof typeof SourceAccountType]; +export const SourceAccountV2AccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountV2AccountType = (typeof SourceAccountV2AccountType)[keyof typeof SourceAccountV2AccountType]; +export const SourceAccountV2BatchCreateResponseAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountV2BatchCreateResponseAccountAccountType = (typeof SourceAccountV2BatchCreateResponseAccountAccountType)[keyof typeof SourceAccountV2BatchCreateResponseAccountAccountType]; +export const SourceAccountV2BatchCreateResponseAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountV2BatchCreateResponseAccountStatus = (typeof SourceAccountV2BatchCreateResponseAccountStatus)[keyof typeof SourceAccountV2BatchCreateResponseAccountStatus]; +export const SourceAccountV2BatchCreateResponseAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResponseAccountType = (typeof SourceAccountV2BatchCreateResponseAccountType)[keyof typeof SourceAccountV2BatchCreateResponseAccountType]; +export const SourceAccountV2BatchCreateResponseAccountType1 = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResponseAccountType1 = (typeof SourceAccountV2BatchCreateResponseAccountType1)[keyof typeof SourceAccountV2BatchCreateResponseAccountType1]; +export const SourceAccountV2BatchCreateResponseAccountType2 = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResponseAccountType2 = (typeof SourceAccountV2BatchCreateResponseAccountType2)[keyof typeof SourceAccountV2BatchCreateResponseAccountType2]; +export const SourceAccountV2BatchCreateResponseRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResponseRoutingInfoType = (typeof SourceAccountV2BatchCreateResponseRoutingInfoType)[keyof typeof SourceAccountV2BatchCreateResponseRoutingInfoType]; +export const SourceAccountV2BatchCreateResponseStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountV2BatchCreateResponseStatus = (typeof SourceAccountV2BatchCreateResponseStatus)[keyof typeof SourceAccountV2BatchCreateResponseStatus]; +export const SourceAccountV2BatchCreateResponseType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResponseType = (typeof SourceAccountV2BatchCreateResponseType)[keyof typeof SourceAccountV2BatchCreateResponseType]; +export const SourceAccountV2BatchCreateResultAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountV2BatchCreateResultAccountAccountType = (typeof SourceAccountV2BatchCreateResultAccountAccountType)[keyof typeof SourceAccountV2BatchCreateResultAccountAccountType]; +export const SourceAccountV2BatchCreateResultAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountV2BatchCreateResultAccountStatus = (typeof SourceAccountV2BatchCreateResultAccountStatus)[keyof typeof SourceAccountV2BatchCreateResultAccountStatus]; +export const SourceAccountV2BatchCreateResultAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResultAccountType = (typeof SourceAccountV2BatchCreateResultAccountType)[keyof typeof SourceAccountV2BatchCreateResultAccountType]; +export const SourceAccountV2BatchCreateResultAccountType1 = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResultAccountType1 = (typeof SourceAccountV2BatchCreateResultAccountType1)[keyof typeof SourceAccountV2BatchCreateResultAccountType1]; +export const SourceAccountV2BatchCreateResultAccountType2 = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Checking: "checking", + Clabe: "clabe", + CreditCard: "creditCard", + Iban: "iban", + Ifsc: "ifsc", + Loan: "loan", + Nz2: "nz2", + PrepaidCard: "prepaidCard", + Rtn: "rtn", + Savings: "savings", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResultAccountType2 = (typeof SourceAccountV2BatchCreateResultAccountType2)[keyof typeof SourceAccountV2BatchCreateResultAccountType2]; +export const SourceAccountV2BatchCreateResultRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResultRoutingInfoType = (typeof SourceAccountV2BatchCreateResultRoutingInfoType)[keyof typeof SourceAccountV2BatchCreateResultRoutingInfoType]; +export const SourceAccountV2BatchCreateResultStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountV2BatchCreateResultStatus = (typeof SourceAccountV2BatchCreateResultStatus)[keyof typeof SourceAccountV2BatchCreateResultStatus]; +export const SourceAccountV2BatchCreateResultType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2BatchCreateResultType = (typeof SourceAccountV2BatchCreateResultType)[keyof typeof SourceAccountV2BatchCreateResultType]; +export const SourceAccountV2PrototypeAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountV2PrototypeAccountType = (typeof SourceAccountV2PrototypeAccountType)[keyof typeof SourceAccountV2PrototypeAccountType]; +export const SourceAccountV2PrototypeRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2PrototypeRoutingInfoType = (typeof SourceAccountV2PrototypeRoutingInfoType)[keyof typeof SourceAccountV2PrototypeRoutingInfoType]; +export const SourceAccountV2PrototypeType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2PrototypeType = (typeof SourceAccountV2PrototypeType)[keyof typeof SourceAccountV2PrototypeType]; +export const SourceAccountV2RoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2RoutingInfoType = (typeof SourceAccountV2RoutingInfoType)[keyof typeof SourceAccountV2RoutingInfoType]; +export const SourceAccountV2Status = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountV2Status = (typeof SourceAccountV2Status)[keyof typeof SourceAccountV2Status]; +export const SourceAccountV2Type = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountV2Type = (typeof SourceAccountV2Type)[keyof typeof SourceAccountV2Type]; +export const SourceAccountWebhookAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountWebhookAccountType = (typeof SourceAccountWebhookAccountType)[keyof typeof SourceAccountWebhookAccountType]; +export const SourceAccountWebhookPayloadAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountWebhookPayloadAccountType = (typeof SourceAccountWebhookPayloadAccountType)[keyof typeof SourceAccountWebhookPayloadAccountType]; +export const SourceAccountWebhookPayloadRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookPayloadRoutingInfoType = (typeof SourceAccountWebhookPayloadRoutingInfoType)[keyof typeof SourceAccountWebhookPayloadRoutingInfoType]; +export const SourceAccountWebhookPayloadSourceAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountWebhookPayloadSourceAccountAccountType = (typeof SourceAccountWebhookPayloadSourceAccountAccountType)[keyof typeof SourceAccountWebhookPayloadSourceAccountAccountType]; +export const SourceAccountWebhookPayloadSourceAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountWebhookPayloadSourceAccountStatus = (typeof SourceAccountWebhookPayloadSourceAccountStatus)[keyof typeof SourceAccountWebhookPayloadSourceAccountStatus]; +export const SourceAccountWebhookPayloadSourceAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookPayloadSourceAccountType = (typeof SourceAccountWebhookPayloadSourceAccountType)[keyof typeof SourceAccountWebhookPayloadSourceAccountType]; +export const SourceAccountWebhookPayloadStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountWebhookPayloadStatus = (typeof SourceAccountWebhookPayloadStatus)[keyof typeof SourceAccountWebhookPayloadStatus]; +export const SourceAccountWebhookPayloadType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookPayloadType = (typeof SourceAccountWebhookPayloadType)[keyof typeof SourceAccountWebhookPayloadType]; +export const SourceAccountWebhookRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookRoutingInfoType = (typeof SourceAccountWebhookRoutingInfoType)[keyof typeof SourceAccountWebhookRoutingInfoType]; +export const SourceAccountWebhookSourceAccountAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountWebhookSourceAccountAccountType = (typeof SourceAccountWebhookSourceAccountAccountType)[keyof typeof SourceAccountWebhookSourceAccountAccountType]; +export const SourceAccountWebhookSourceAccountStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountWebhookSourceAccountStatus = (typeof SourceAccountWebhookSourceAccountStatus)[keyof typeof SourceAccountWebhookSourceAccountStatus]; +export const SourceAccountWebhookSourceAccountType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookSourceAccountType = (typeof SourceAccountWebhookSourceAccountType)[keyof typeof SourceAccountWebhookSourceAccountType]; +export const SourceAccountWebhookStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountWebhookStatus = (typeof SourceAccountWebhookStatus)[keyof typeof SourceAccountWebhookStatus]; +export const SourceAccountWebhookType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountWebhookType = (typeof SourceAccountWebhookType)[keyof typeof SourceAccountWebhookType]; +export const SourceAccountsAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type SourceAccountsAccountType = (typeof SourceAccountsAccountType)[keyof typeof SourceAccountsAccountType]; +export const SourceAccountsRoutingInfoType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountsRoutingInfoType = (typeof SourceAccountsRoutingInfoType)[keyof typeof SourceAccountsRoutingInfoType]; +export const SourceAccountsStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type SourceAccountsStatus = (typeof SourceAccountsStatus)[keyof typeof SourceAccountsStatus]; +export const SourceAccountsType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type SourceAccountsType = (typeof SourceAccountsType)[keyof typeof SourceAccountsType]; +export const SourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceType = (typeof SourceType)[keyof typeof SourceType]; +export const SourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceTypeDataConnectionSourceType = (typeof SourceTypeDataConnectionSourceType)[keyof typeof SourceTypeDataConnectionSourceType]; +export const Status = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type Status = (typeof Status)[keyof typeof Status]; +export const Status1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type Status1 = (typeof Status1)[keyof typeof Status1]; +export const Status2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type Status2 = (typeof Status2)[keyof typeof Status2]; +export const StatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type StatusDataConnectionStatus = (typeof StatusDataConnectionStatus)[keyof typeof StatusDataConnectionStatus]; +export const StatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusDatasetStatus = (typeof StatusDatasetStatus)[keyof typeof StatusDatasetStatus]; +export const StatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type StatusErrorStatus = (typeof StatusErrorStatus)[keyof typeof StatusErrorStatus]; +export const StatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type StatusPushOperationStatus = (typeof StatusPushOperationStatus)[keyof typeof StatusPushOperationStatus]; +export const TransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; +export const TransactionTypeBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type TransactionTypeBankTransactionType = (typeof TransactionTypeBankTransactionType)[keyof typeof TransactionTypeBankTransactionType]; +export const Type = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type Type = (typeof Type)[keyof typeof Type]; +export const TypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type TypePushChangeType = (typeof TypePushChangeType)[keyof typeof TypePushChangeType]; +export const TypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type TypePushOptionType = (typeof TypePushOptionType)[keyof typeof TypePushOptionType]; +export const ZeroAccountType = { + Checking: "checking", + CreditCard: "creditCard", + Loan: "loan", + PrepaidCard: "prepaidCard", + Savings: "savings", +} as const; +export type ZeroAccountType = (typeof ZeroAccountType)[keyof typeof ZeroAccountType]; +export const ZeroBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ZeroBankAccountStatus = (typeof ZeroBankAccountStatus)[keyof typeof ZeroBankAccountStatus]; +export const ZeroBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ZeroBankAccountType = (typeof ZeroBankAccountType)[keyof typeof ZeroBankAccountType]; +export const ZeroBankTransactionType = { + Atm: "Atm", + Cash: "Cash", + Check: "Check", + Credit: "Credit", + Debit: "Debit", + Dep: "Dep", + DirectDebit: "DirectDebit", + DirectDep: "DirectDep", + Div: "Div", + Fee: "Fee", + Int: "Int", + Other: "Other", + Payment: "Payment", + Pos: "Pos", + RepeatPmt: "RepeatPmt", + SerChg: "SerChg", + Unknown: "Unknown", + Xfer: "Xfer", +} as const; +export type ZeroBankTransactionType = (typeof ZeroBankTransactionType)[keyof typeof ZeroBankTransactionType]; +export const ZeroDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ZeroDataConnectionSourceType = (typeof ZeroDataConnectionSourceType)[keyof typeof ZeroDataConnectionSourceType]; +export const ZeroDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ZeroDataConnectionStatus = (typeof ZeroDataConnectionStatus)[keyof typeof ZeroDataConnectionStatus]; +export const ZeroDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ZeroDataType = (typeof ZeroDataType)[keyof typeof ZeroDataType]; +export const ZeroDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ZeroDatasetStatus = (typeof ZeroDatasetStatus)[keyof typeof ZeroDatasetStatus]; +export const ZeroErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ZeroErrorStatus = (typeof ZeroErrorStatus)[keyof typeof ZeroErrorStatus]; +export const ZeroPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ZeroPushChangeType = (typeof ZeroPushChangeType)[keyof typeof ZeroPushChangeType]; +export const ZeroPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ZeroPushOperationStatus = (typeof ZeroPushOperationStatus)[keyof typeof ZeroPushOperationStatus]; +export const ZeroStatus = { + Connected: "connected", + Connecting: "connecting", + Disconnected: "disconnected", + Pending: "pending", + Unknown: "unknown", +} as const; +export type ZeroStatus = (typeof ZeroStatus)[keyof typeof ZeroStatus]; +export const ZeroType = { + Aba: "aba", + Apca: "apca", + Bankcode: "bankcode", + Blz: "blz", + Bsb: "bsb", + Clabe: "clabe", + Iban: "iban", + Ifsc: "ifsc", + Nz2: "nz2", + Rtn: "rtn", + Sortcode: "sortcode", + Swift: "swift", + Trno: "trno", +} as const; +export type ZeroType = (typeof ZeroType)[keyof typeof ZeroType]; diff --git a/bank-feeds/src/sdk/models/_speakeasy_hoisted.ts b/bank-feeds/src/sdk/models/_speakeasy_hoisted.ts new file mode 100644 index 000000000..16e9ac319 --- /dev/null +++ b/bank-feeds/src/sdk/models/_speakeasy_hoisted.ts @@ -0,0 +1,14 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type * as shared from './index'; + +export type SourceAccountWebhookPayloadSourceAccount = shared.SourceAccountV2 | shared.SourceAccount; + +export interface ConnectionInfo {} + +export interface Content {} + +export interface Properties {} + +export interface Tags {} diff --git a/bank-feeds/src/sdk/models/_speakeasy_operations.ts b/bank-feeds/src/sdk/models/_speakeasy_operations.ts new file mode 100644 index 000000000..2b6cda327 --- /dev/null +++ b/bank-feeds/src/sdk/models/_speakeasy_operations.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type * as shared from './index'; + +export type CreateBatchSourceAccountResponse = Array; +export type CreateSourceAccountResponseBody = shared.CreateSourceAccount200Response; +export type ListSourceAccountsResponseBody = shared.ListSourceAccounts200Response; diff --git a/bank-feeds/src/sdk/models/errors/codatbankfeedserror.ts b/bank-feeds/src/sdk/models/errors/codatbankfeedserror.ts index 030f46e30..fca521722 100644 --- a/bank-feeds/src/sdk/models/errors/codatbankfeedserror.ts +++ b/bank-feeds/src/sdk/models/errors/codatbankfeedserror.ts @@ -1,35 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** The base class for all HTTP error responses */ export class CodatBankFeedsError extends Error { - /** HTTP status code */ - public readonly statusCode: number; - /** HTTP body */ - public readonly body: string; - /** HTTP headers */ - public readonly headers: Headers; - /** HTTP content type */ - public readonly contentType: string; - /** Raw response */ - public readonly rawResponse: Response; + readonly body: string; + readonly statusCode: number; + readonly contentType: string; + readonly headers: Headers; + readonly rawResponse: Response; - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.statusCode = httpMeta.response.status; - this.body = httpMeta.body; - this.headers = httpMeta.response.headers; - this.contentType = httpMeta.response.headers.get("content-type") || ""; - this.rawResponse = httpMeta.response; - - this.name = "CodatBankFeedsError"; - } + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message); + this.name = "CodatBankFeedsError"; + this.body = httpMeta.body; + this.statusCode = httpMeta.response.status; + this.contentType = httpMeta.response.headers.get("content-type") ?? ""; + this.headers = httpMeta.response.headers; + this.rawResponse = httpMeta.response; + } } diff --git a/bank-feeds/src/sdk/models/errors/errormessage.ts b/bank-feeds/src/sdk/models/errors/errormessage.ts index aaaa11f94..357f2f84f 100644 --- a/bank-feeds/src/sdk/models/errors/errormessage.ts +++ b/bank-feeds/src/sdk/models/errors/errormessage.ts @@ -1,120 +1,38 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; -import { CodatBankFeedsError } from "./codatbankfeedserror.js"; +import { CodatBankFeedsError } from "./codatbankfeedserror"; +import type { ErrorMessageData } from "../ErrorMessage"; +import type { ErrorValidation } from "../shared/errorvalidation"; -/** - * The request made is not valid. - */ -export type ErrorMessageData = { - /** - * The HTTP status code returned by the error. - */ - statusCode?: number | undefined; - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; -}; +export type { ErrorMessageData }; -/** - * The request made is not valid. - */ export class ErrorMessage extends CodatBankFeedsError { - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; + service?: string | undefined; + error?: string | undefined; + correlationId?: string | undefined; + validation?: ErrorValidation | null | undefined; + canBeRetried?: string | undefined; + detailedErrorCode?: number | undefined; - /** The original data that was passed to this error instance. */ - data$: ErrorMessageData; + data$: ErrorMessageData; - constructor( - err: ErrorMessageData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - if (err.service != null) this.service = err.service; - if (err.error != null) this.error = err.error; - if (err.correlationId != null) this.correlationId = err.correlationId; - if (err.validation != null) this.validation = err.validation; - if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; - if (err.detailedErrorCode != null) { - this.detailedErrorCode = err.detailedErrorCode; + constructor( + err: ErrorMessageData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const data = err as ErrorMessageData & { message?: unknown }; + const message = typeof data.message === "string" + ? data.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + if (err.service != null) this.service = err.service; + if (err.error != null) this.error = err.error; + if (err.correlationId != null) this.correlationId = err.correlationId; + if (err.validation != null) this.validation = err.validation; + if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; + if (err.detailedErrorCode != null) this.detailedErrorCode = err.detailedErrorCode; + this.name = "ErrorMessage"; } - - this.name = "ErrorMessage"; - } } - -/** @internal */ -export const ErrorMessage$inboundSchema: z.ZodType< - ErrorMessage, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - service: z.string().optional(), - error: z.string().optional(), - correlationId: z.string().optional(), - validation: z.nullable(shared.ErrorValidation$inboundSchema).optional(), - canBeRetried: z.string().optional(), - detailedErrorCode: z.number().int().optional(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new ErrorMessage(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/bank-feeds/src/sdk/models/errors/httpclienterrors.ts b/bank-feeds/src/sdk/models/errors/httpclienterrors.ts index b34f61212..0bfc5af09 100644 --- a/bank-feeds/src/sdk/models/errors/httpclienterrors.ts +++ b/bank-feeds/src/sdk/models/errors/httpclienterrors.ts @@ -1,62 +1,47 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Base class for all HTTP errors. - */ export class HTTPClientError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - override name = "HTTPClientError"; - constructor(message: string, opts?: { cause?: unknown }) { - let msg = message; - if (opts?.cause) { - msg += `: ${opts.cause}`; - } + readonly cause: unknown; - super(msg, opts); - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = opts?.cause; + constructor(message: string, opts?: { cause?: unknown }) { + super(message); + this.name = "HTTPClientError"; + this.cause = opts?.cause; } - } } -/** - * An error to capture unrecognised or unexpected errors when making HTTP calls. - */ export class UnexpectedClientError extends HTTPClientError { - override name = "UnexpectedClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "UnexpectedClientError"; + } } -/** - * An error that is raised when any inputs used to create a request are invalid. - */ export class InvalidRequestError extends HTTPClientError { - override name = "InvalidRequestError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "InvalidRequestError"; + } } -/** - * An error that is raised when a HTTP request was aborted by the client error. - */ export class RequestAbortedError extends HTTPClientError { - override readonly name = "RequestAbortedError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestAbortedError"; + } } -/** - * An error that is raised when a HTTP request timed out due to an AbortSignal - * signal timeout. - */ export class RequestTimeoutError extends HTTPClientError { - override readonly name = "RequestTimeoutError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestTimeoutError"; + } } -/** - * An error that is raised when a HTTP client is unable to make a request to - * a server. - */ export class ConnectionError extends HTTPClientError { - override readonly name = "ConnectionError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "ConnectionError"; + } } diff --git a/bank-feeds/src/sdk/models/errors/index.ts b/bank-feeds/src/sdk/models/errors/index.ts index 3617ce964..9e1c63808 100644 --- a/bank-feeds/src/sdk/models/errors/index.ts +++ b/bank-feeds/src/sdk/models/errors/index.ts @@ -1,10 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./codatbankfeedserror.js"; -export * from "./errormessage.js"; -export * from "./httpclienterrors.js"; -export * from "./responsevalidationerror.js"; -export * from "./sdkerror.js"; -export * from "./sdkvalidationerror.js"; +export * from './codatbankfeedserror'; +export * from './errormessage'; +export * from './httpclienterrors'; +export * from './responsevalidationerror'; +export * from './sdkerror'; +export * from './sdkvalidationerror'; diff --git a/bank-feeds/src/sdk/models/errors/responsevalidationerror.ts b/bank-feeds/src/sdk/models/errors/responsevalidationerror.ts index 9504c0e67..60d18bf61 100644 --- a/bank-feeds/src/sdk/models/errors/responsevalidationerror.ts +++ b/bank-feeds/src/sdk/models/errors/responsevalidationerror.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatBankFeedsError } from "./codatbankfeedserror.js"; -import { formatZodError } from "./sdkvalidationerror.js"; +import { CodatBankFeedsError } from "./codatbankfeedserror"; export class ResponseValidationError extends CodatBankFeedsError { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; + readonly cause: unknown; + readonly rawMessage: unknown; + readonly rawValue: unknown; - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - constructor( - message: string, - extra: { - response: Response; - request: Request; - body: string; - cause: unknown; - rawValue: unknown; - rawMessage: unknown; - }, - ) { - super(message, extra); - this.name = "ResponseValidationError"; - this.cause = extra.cause; - this.rawValue = extra.rawValue; - this.rawMessage = extra.rawMessage; - } + constructor( + message: string, + extra: { response: Response; request: Request; body: string; cause: unknown; rawValue: unknown; rawMessage: unknown }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawMessage = extra.rawMessage; + this.rawValue = extra.rawValue; + } - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + pretty(): string { + return this.message; } - } } diff --git a/bank-feeds/src/sdk/models/errors/sdkerror.ts b/bank-feeds/src/sdk/models/errors/sdkerror.ts index b81e466a8..efb493aab 100644 --- a/bank-feeds/src/sdk/models/errors/sdkerror.ts +++ b/bank-feeds/src/sdk/models/errors/sdkerror.ts @@ -1,40 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatBankFeedsError } from "./codatbankfeedserror.js"; +import { CodatBankFeedsError } from "./codatbankfeedserror"; -/** The fallback error class if no more specific error class is matched */ export class SDKError extends CodatBankFeedsError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message, httpMeta); + this.name = "SDKError"; } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : ". "; - let bodyDisplay = body; - if (body.length > 10000) { - const truncated = body.substring(0, 10000); - const remaining = body.length - 10000; - bodyDisplay = `${truncated}...and ${remaining} more chars`; - } - message += `Body: ${bodyDisplay}`; - message = message.trim(); - super(message, httpMeta); - this.name = "SDKError"; - } } diff --git a/bank-feeds/src/sdk/models/errors/sdkvalidationerror.ts b/bank-feeds/src/sdk/models/errors/sdkvalidationerror.ts index 6826e1208..23a011c8c 100644 --- a/bank-feeds/src/sdk/models/errors/sdkvalidationerror.ts +++ b/bank-feeds/src/sdk/models/errors/sdkvalidationerror.ts @@ -1,109 +1,26 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export class SDKValidationError extends Error { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` - static override [Symbol.hasInstance]( - instance: unknown, - ): instance is SDKValidationError { - if (!(instance instanceof Error)) return false; - if (!("rawValue" in instance)) return false; - if (!("rawMessage" in instance)) return false; - if (!("pretty" in instance)) return false; - if (typeof instance.pretty !== "function") return false; - return true; - } - - constructor(message: string, cause: unknown, rawValue: unknown) { - super(`${message}: ${cause}`); - this.name = "SDKValidationError"; - this.cause = cause; - this.rawValue = rawValue; - this.rawMessage = message; - } - - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + readonly cause: unknown; + readonly rawValue: unknown; + readonly rawMessage: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + this.rawMessage = message; } - } -} -export function formatZodError(err: z.ZodError, level = 0): string { - let pre = " ".repeat(level); - pre = level > 0 ? `│${pre}` : pre; - pre += " ".repeat(level); - - let message = ""; - const append = (str: string) => (message += `\n${pre}${str}`); - - const len = err.issues.length; - const headline = len === 1 ? `${len} issue found` : `${len} issues found`; - - if (len) { - append(`┌ ${headline}:`); - } - - for (const issue of err.issues) { - let path = issue.path.join("."); - path = path ? `.${path}` : ""; - append(`│ • [${path}]: ${issue.message} (${issue.code})`); - switch (issue.code) { - case "invalid_literal": - case "invalid_type": { - append(`│ Want: ${issue.expected}`); - append(`│ Got: ${issue.received}`); - break; - } - case "unrecognized_keys": { - append(`│ Keys: ${issue.keys.join(", ")}`); - break; - } - case "invalid_enum_value": { - append(`│ Allowed: ${issue.options.join(", ")}`); - append(`│ Got: ${issue.received}`); - break; - } - case "invalid_union_discriminator": { - append(`│ Allowed: ${issue.options.join(", ")}`); - break; - } - case "invalid_union": { - const len = issue.unionErrors.length; - append( - `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, - ); - issue.unionErrors.forEach((err, i) => { - append(`│ ✖︎ Member ${i + 1} of ${len}`); - append(`${formatZodError(err, level + 1)}`); - }); - } + pretty(): string { + return this.message; } - } - - if (err.issues.length) { - append(`└─*`); - } +} - return message.slice(1); +export function formatZodError(err: unknown, level?: number): string { + void err; + void level; + return ""; } diff --git a/bank-feeds/src/sdk/models/index.ts b/bank-feeds/src/sdk/models/index.ts new file mode 100644 index 000000000..7f0d7f493 --- /dev/null +++ b/bank-feeds/src/sdk/models/index.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AccessToken'; +export * from './shared/accountinfo'; +export * from './shared/accountingbankaccount'; +export * from './shared/bankaccountcreateresponse'; +export * from './BankAccountCreateResponseAllOfData'; +export * from './shared/bankaccountcredentials'; +export * from './shared/bankaccountprototype'; +export * from './shared/bankaccountstatus'; +export * from './shared/bankaccounts'; +export * from './shared/bankfeedaccountmapping'; +export * from './shared/bankfeedaccountmappingresponse'; +export * from './shared/bankfeedmapping'; +export * from './BankTransaction'; +export * from './shared/clientratelimitwebhook'; +export * from './shared/clientratelimitwebhookpayload'; +export * from './shared/companies'; +export * from './shared/company'; +export * from './shared/companyaccesstoken'; +export * from './CompanyDetails'; +export * from './shared/companyinformation'; +export * from './shared/companyreference'; +export * from './shared/companyreferencelinks'; +export * from './shared/companyrequestbody'; +export * from './shared/companyupdaterequest'; +export * from './shared/connection'; +export * from './shared/connections'; +export * from './shared/createbanktransactions'; +export * from './shared/createbanktransactionsresponse'; +export * from './CreateBatchSourceAccount201ResponseInner'; +export * from './CreateBatchSourceAccount207ResponseInner'; +export * from './operations/createbatchsourceaccountrequestbody'; +export * from './operations/createconnectionrequestbody'; +export * from './CreateSourceAccount200Response'; +export * from './operations/createsourceaccountrequestbody'; +export * from './shared/dataconnectionerror'; +export * from './shared/dataconnectionstatus'; +export * from './shared/datatype'; +export * from './ErrorMessage'; +export * from './shared/errorvalidation'; +export * from './shared/errorvalidationitem'; +export * from './shared/generateotpresponse'; +export * from './shared/halref'; +export * from './Items'; +export * from './shared/links'; +export * from './ListSourceAccounts200Response'; +export * from './shared/metadata'; +export * from './Model1'; +export * from './PullOperation'; +export * from './PullOperations'; +export * from './shared/pushchangetype'; +export * from './shared/pushfieldvalidation'; +export * from './shared/pushoperation'; +export * from './shared/pushoperationchange'; +export * from './shared/pushoperationref'; +export * from './shared/pushoperationstatus'; +export * from './shared/pushoperations'; +export * from './shared/pushoption'; +export * from './shared/pushoptionchoice'; +export * from './shared/pushoptionproperty'; +export * from './shared/pushoptiontype'; +export * from './shared/pushvalidationinfo'; +export * from './shared/routinginfo'; +export * from './shared/sourceaccount'; +export * from './shared/sourceaccountbatchcreateresponse'; +export * from './shared/sourceaccountbatchcreateresult'; +export * from './shared/sourceaccountbatcherrorresponse'; +export * from './SourceAccountBatchErrorResponseResult'; +export * from './shared/sourceaccountprototype'; +export * from './shared/sourceaccountv2'; +export * from './shared/sourceaccountv2batchcreateresponse'; +export * from './shared/sourceaccountv2batchcreateresult'; +export * from './shared/sourceaccountv2prototype'; +export * from './shared/sourceaccountwebhook'; +export * from './shared/sourceaccountwebhookpayload'; +export * from './shared/startscheduledsyncresult'; +export * from './shared/supplementaldata'; +export * from './shared/syncstatusresult'; +export * from './shared/targetaccountoption'; +export * from './UpdateConnection'; +export * from './shared/validation'; +export * from './shared/validationitem'; +export * from './_speakeasy_enums'; +export * from './_speakeasy_hoisted'; +export type { Security } from '../../lib/sdkconfig'; + +export type { ListCompaniesRequest } from './operations/listcompanies'; +export type { GetCompanyRequest } from './operations/getcompany'; +export type { ReplaceCompanyRequest } from './operations/replacecompany'; +export type { UpdateCompanyRequest } from './operations/updatecompany'; +export type { DeleteCompanyRequest } from './operations/deletecompany'; +export type { GetCompanyAccessTokenRequest } from './operations/getcompanyaccesstoken'; +export type { ListConnectionsRequest } from './operations/listconnections'; +export type { CreateConnectionRequest } from './operations/createconnection'; +export type { GetConnectionRequest } from './operations/getconnection'; +export type { UnlinkConnectionRequest } from './operations/unlinkconnection'; +export type { DeleteConnectionRequest } from './operations/deleteconnection'; +export type { ListBankAccountsRequest } from './operations/listbankaccounts'; +export type { GetCreateBankAccountsModelRequest } from './operations/getcreatebankaccountsmodel'; +export type { CreateBankAccountRequest } from './operations/createbankaccount'; +export type { CreateBatchSourceAccountRequest } from './operations/createbatchsourceaccount'; +export type { ListSourceAccountsRequest } from './operations/listsourceaccounts'; +export type { CreateSourceAccountRequest } from './operations/createsourceaccount'; +export type { UpdateSourceAccountRequest } from './operations/updatesourceaccount'; +export type { DeleteSourceAccountRequest } from './operations/deletesourceaccount'; +export type { GenerateCredentialsRequest } from './operations/generatecredentials'; +export type { DeleteBankFeedCredentialsRequest } from './operations/deletebankfeedcredentials'; +export type { GetBankAccountMappingRequest } from './operations/getbankaccountmapping'; +export type { CreateBankAccountMappingRequest } from './operations/createbankaccountmapping'; +export type { GetCompanyInformationRequest } from './operations/getcompanyinformation'; +export type { GenerateOtpRequest } from './operations/generateotp'; +export type { CreateBankTransactionsRequest } from './operations/createbanktransactions'; +export type { GetCreateBankTransactionsModelRequest } from './operations/getcreatebanktransactionsmodel'; +export type { GetCreateOperationRequest } from './operations/getcreateoperation'; +export type { ListCreateOperationsRequest } from './operations/listcreateoperations'; +export type { GetManagedBankFeedSyncRequest } from './operations/getmanagedbankfeedsync'; +export type { GetLatestManagedBankFeedSyncRequest } from './operations/getlatestmanagedbankfeedsync'; +export type { RunManagedBankFeedAdHocSyncRequest } from './operations/runmanagedbankfeedadhocsync'; + +export * as operations from './operations'; +export * as shared from './shared'; diff --git a/bank-feeds/src/sdk/models/operations/createbankaccount.ts b/bank-feeds/src/sdk/models/operations/createbankaccount.ts index d1a7b8063..1c715600c 100644 --- a/bank-feeds/src/sdk/models/operations/createbankaccount.ts +++ b/bank-feeds/src/sdk/models/operations/createbankaccount.ts @@ -1,50 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { BankAccountPrototype } from '../shared/bankaccountprototype'; +/* eslint-disable */ -export type CreateBankAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - bankAccountPrototype?: shared.BankAccountPrototype | undefined; -}; - -/** @internal */ -export type CreateBankAccountRequest$Outbound = { - companyId: string; - connectionId: string; - timeoutInMinutes?: number | undefined; - bankAccountPrototype?: shared.BankAccountPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateBankAccountRequest$outboundSchema: z.ZodType< - CreateBankAccountRequest$Outbound, - z.ZodTypeDef, - CreateBankAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - timeoutInMinutes: z.number().int().optional(), - bankAccountPrototype: shared.BankAccountPrototype$outboundSchema.optional(), -}); - -export function createBankAccountRequestToJSON( - createBankAccountRequest: CreateBankAccountRequest, -): string { - return JSON.stringify( - CreateBankAccountRequest$outboundSchema.parse(createBankAccountRequest), - ); +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + bankAccountPrototype?: BankAccountPrototype | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createbankaccountmapping.ts b/bank-feeds/src/sdk/models/operations/createbankaccountmapping.ts index d21e54888..41d9d511c 100644 --- a/bank-feeds/src/sdk/models/operations/createbankaccountmapping.ts +++ b/bank-feeds/src/sdk/models/operations/createbankaccountmapping.ts @@ -1,52 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BankFeedAccountMapping } from '../shared/bankfeedaccountmapping'; +/* eslint-disable */ -export type CreateBankAccountMappingRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - bankFeedAccountMapping?: shared.BankFeedAccountMapping | undefined; -}; - -/** @internal */ -export type CreateBankAccountMappingRequest$Outbound = { - companyId: string; - connectionId: string; - BankFeedAccountMapping?: shared.BankFeedAccountMapping$Outbound | undefined; -}; - -/** @internal */ -export const CreateBankAccountMappingRequest$outboundSchema: z.ZodType< - CreateBankAccountMappingRequest$Outbound, - z.ZodTypeDef, - CreateBankAccountMappingRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - bankFeedAccountMapping: shared.BankFeedAccountMapping$outboundSchema - .optional(), -}).transform((v) => { - return remap$(v, { - bankFeedAccountMapping: "BankFeedAccountMapping", - }); -}); - -export function createBankAccountMappingRequestToJSON( - createBankAccountMappingRequest: CreateBankAccountMappingRequest, -): string { - return JSON.stringify( - CreateBankAccountMappingRequest$outboundSchema.parse( - createBankAccountMappingRequest, - ), - ); +export interface CreateBankAccountMappingRequest { + companyId: string; + connectionId: string; + bankFeedAccountMapping?: BankFeedAccountMapping | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createbanktransactions.ts b/bank-feeds/src/sdk/models/operations/createbanktransactions.ts index f9678d812..6b0c40a6f 100644 --- a/bank-feeds/src/sdk/models/operations/createbanktransactions.ts +++ b/bank-feeds/src/sdk/models/operations/createbanktransactions.ts @@ -1,70 +1,13 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; - -export type CreateBankTransactionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for an account. - */ - accountId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - createBankTransactions?: shared.CreateBankTransactions | undefined; -}; - -/** @internal */ -export type CreateBankTransactionsRequest$Outbound = { - companyId: string; - connectionId: string; - accountId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - CreateBankTransactions?: shared.CreateBankTransactions$Outbound | undefined; -}; - -/** @internal */ -export const CreateBankTransactionsRequest$outboundSchema: z.ZodType< - CreateBankTransactionsRequest$Outbound, - z.ZodTypeDef, - CreateBankTransactionsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - accountId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - createBankTransactions: shared.CreateBankTransactions$outboundSchema - .optional(), -}).transform((v) => { - return remap$(v, { - createBankTransactions: "CreateBankTransactions", - }); -}); - -export function createBankTransactionsRequestToJSON( - createBankTransactionsRequest: CreateBankTransactionsRequest, -): string { - return JSON.stringify( - CreateBankTransactionsRequest$outboundSchema.parse( - createBankTransactionsRequest, - ), - ); +/* tslint:disable */ + +import type { CreateBankTransactions } from '../shared/createbanktransactions'; +/* eslint-disable */ + +export interface CreateBankTransactionsRequest { + companyId: string; + connectionId: string; + accountId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + createBankTransactions?: CreateBankTransactions | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createbatchsourceaccount.ts b/bank-feeds/src/sdk/models/operations/createbatchsourceaccount.ts index 209a03ed4..620b6d04e 100644 --- a/bank-feeds/src/sdk/models/operations/createbatchsourceaccount.ts +++ b/bank-feeds/src/sdk/models/operations/createbatchsourceaccount.ts @@ -1,185 +1,16 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as shared from "../shared/index.js"; +import type { CreateBatchSourceAccountRequestBody } from './createbatchsourceaccountrequestbody'; +/* eslint-disable */ -export type CreateBatchSourceAccountRequestBody = - | Array - | Array; - -export type CreateBatchSourceAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: - | Array - | Array - | undefined; -}; - -export type CreateBatchSourceAccountResponseBody = - | shared.SourceAccountV2BatchCreateResponse - | shared.SourceAccountBatchCreateResponse - | shared.SourceAccountBatchErrorResponse; - -export type ResponseBody = - | shared.SourceAccountV2BatchCreateResponse - | shared.SourceAccountBatchCreateResponse; - -export type CreateBatchSourceAccountResponse = - | Array< - | shared.SourceAccountV2BatchCreateResponse - | shared.SourceAccountBatchCreateResponse - > - | Array< - | shared.SourceAccountV2BatchCreateResponse - | shared.SourceAccountBatchCreateResponse - | shared.SourceAccountBatchErrorResponse - >; - -/** @internal */ -export type CreateBatchSourceAccountRequestBody$Outbound = - | Array - | Array; - -/** @internal */ -export const CreateBatchSourceAccountRequestBody$outboundSchema: z.ZodType< - CreateBatchSourceAccountRequestBody$Outbound, - z.ZodTypeDef, - CreateBatchSourceAccountRequestBody -> = z.union([ - z.array(shared.SourceAccountV2Prototype$outboundSchema), - z.array(shared.SourceAccountPrototype$outboundSchema), -]); - -export function createBatchSourceAccountRequestBodyToJSON( - createBatchSourceAccountRequestBody: CreateBatchSourceAccountRequestBody, -): string { - return JSON.stringify( - CreateBatchSourceAccountRequestBody$outboundSchema.parse( - createBatchSourceAccountRequestBody, - ), - ); -} - -/** @internal */ -export type CreateBatchSourceAccountRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: - | Array - | Array - | undefined; -}; - -/** @internal */ -export const CreateBatchSourceAccountRequest$outboundSchema: z.ZodType< - CreateBatchSourceAccountRequest$Outbound, - z.ZodTypeDef, - CreateBatchSourceAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.union([ - z.array(shared.SourceAccountV2Prototype$outboundSchema), - z.array(shared.SourceAccountPrototype$outboundSchema), - ]).optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createBatchSourceAccountRequestToJSON( - createBatchSourceAccountRequest: CreateBatchSourceAccountRequest, -): string { - return JSON.stringify( - CreateBatchSourceAccountRequest$outboundSchema.parse( - createBatchSourceAccountRequest, - ), - ); -} - -/** @internal */ -export const CreateBatchSourceAccountResponseBody$inboundSchema: z.ZodType< - CreateBatchSourceAccountResponseBody, - z.ZodTypeDef, - unknown -> = z.union([ - shared.SourceAccountV2BatchCreateResponse$inboundSchema, - shared.SourceAccountBatchCreateResponse$inboundSchema, - shared.SourceAccountBatchErrorResponse$inboundSchema, -]); - -export function createBatchSourceAccountResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - CreateBatchSourceAccountResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateBatchSourceAccountResponseBody' from JSON`, - ); +export interface CreateBatchSourceAccountRequest { + companyId: string; + connectionId: string; + requestBody?: CreateBatchSourceAccountRequestBody | undefined; } -/** @internal */ -export const ResponseBody$inboundSchema: z.ZodType< - ResponseBody, - z.ZodTypeDef, - unknown -> = z.union([ - shared.SourceAccountV2BatchCreateResponse$inboundSchema, - shared.SourceAccountBatchCreateResponse$inboundSchema, -]); - -export function responseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ResponseBody' from JSON`, - ); -} - -/** @internal */ -export const CreateBatchSourceAccountResponse$inboundSchema: z.ZodType< - CreateBatchSourceAccountResponse, - z.ZodTypeDef, - unknown -> = z.union([ - z.array( - z.union([ - shared.SourceAccountV2BatchCreateResponse$inboundSchema, - shared.SourceAccountBatchCreateResponse$inboundSchema, - ]), - ), - z.array( - z.union([ - shared.SourceAccountV2BatchCreateResponse$inboundSchema, - shared.SourceAccountBatchCreateResponse$inboundSchema, - shared.SourceAccountBatchErrorResponse$inboundSchema, - ]), - ), -]); - -export function createBatchSourceAccountResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateBatchSourceAccountResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateBatchSourceAccountResponse' from JSON`, - ); +export interface BatchSourceAccountCreateRequestBody { + companyId: string; + connectionId: string; + requestBody?: CreateBatchSourceAccountRequestBody | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createbatchsourceaccountrequestbody.ts b/bank-feeds/src/sdk/models/operations/createbatchsourceaccountrequestbody.ts new file mode 100644 index 000000000..7a8b54a9b --- /dev/null +++ b/bank-feeds/src/sdk/models/operations/createbatchsourceaccountrequestbody.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ + +import type { SourceAccountPrototype } from '../shared/sourceaccountprototype'; +import type { SourceAccountV2Prototype } from '../shared/sourceaccountv2prototype'; +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @type CreateBatchSourceAccountRequestBody + * + * @export + */ +export type CreateBatchSourceAccountRequestBody = Array | Array; + +export function CreateBatchSourceAccountRequestBodyFromJSON(json: any): CreateBatchSourceAccountRequestBody { + return CreateBatchSourceAccountRequestBodyFromJSONTyped(json, false); +} + +export function CreateBatchSourceAccountRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBatchSourceAccountRequestBody { + if (json == null) { + return json; + } + + return json; +} + +export function CreateBatchSourceAccountRequestBodyToJSON(json: any): any { + return CreateBatchSourceAccountRequestBodyToJSONTyped(json, false); +} + +export function CreateBatchSourceAccountRequestBodyToJSONTyped(value?: CreateBatchSourceAccountRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + + return value; +} + diff --git a/bank-feeds/src/sdk/models/operations/createconnection.ts b/bank-feeds/src/sdk/models/operations/createconnection.ts index dc5bcac12..99117b45a 100644 --- a/bank-feeds/src/sdk/models/operations/createconnection.ts +++ b/bank-feeds/src/sdk/models/operations/createconnection.ts @@ -1,74 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; +import type { CreateConnectionRequestBody } from './createconnectionrequestbody'; +/* eslint-disable */ -export type CreateConnectionRequestBody = { - /** - * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. - */ - platformKey?: string | undefined; -}; - -export type CreateConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: CreateConnectionRequestBody | undefined; -}; - -/** @internal */ -export type CreateConnectionRequestBody$Outbound = { - platformKey?: string | undefined; -}; - -/** @internal */ -export const CreateConnectionRequestBody$outboundSchema: z.ZodType< - CreateConnectionRequestBody$Outbound, - z.ZodTypeDef, - CreateConnectionRequestBody -> = z.object({ - platformKey: z.string().optional(), -}); - -export function createConnectionRequestBodyToJSON( - createConnectionRequestBody: CreateConnectionRequestBody, -): string { - return JSON.stringify( - CreateConnectionRequestBody$outboundSchema.parse( - createConnectionRequestBody, - ), - ); -} - -/** @internal */ -export type CreateConnectionRequest$Outbound = { - companyId: string; - RequestBody?: CreateConnectionRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateConnectionRequest$outboundSchema: z.ZodType< - CreateConnectionRequest$Outbound, - z.ZodTypeDef, - CreateConnectionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.lazy(() => CreateConnectionRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createConnectionRequestToJSON( - createConnectionRequest: CreateConnectionRequest, -): string { - return JSON.stringify( - CreateConnectionRequest$outboundSchema.parse(createConnectionRequest), - ); +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createconnectionrequestbody.ts b/bank-feeds/src/sdk/models/operations/createconnectionrequestbody.ts new file mode 100644 index 000000000..c2b6e4b25 --- /dev/null +++ b/bank-feeds/src/sdk/models/operations/createconnectionrequestbody.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateConnectionRequestBody + */ +export interface CreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +/** + * Check if a given object implements the CreateConnectionRequestBody interface. + */ +export function instanceOfCreateConnectionRequestBody(value: object): value is CreateConnectionRequestBody { + return true; +} + +export function CreateConnectionRequestBodyFromJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyFromJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateConnectionRequestBody { + if (json == null) { + return json; + } + return { + + 'platformKey': json['platformKey'] == null ? undefined : json['platformKey'], + }; +} + +export function CreateConnectionRequestBodyToJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyToJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyToJSONTyped(value?: CreateConnectionRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'platformKey': value['platformKey'], + }; +} + + +export interface ConnectionCreateRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +export interface CreateConnectionCreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} diff --git a/bank-feeds/src/sdk/models/operations/createsourceaccount.ts b/bank-feeds/src/sdk/models/operations/createsourceaccount.ts index d0b3bc729..4c4e5bcbd 100644 --- a/bank-feeds/src/sdk/models/operations/createsourceaccount.ts +++ b/bank-feeds/src/sdk/models/operations/createsourceaccount.ts @@ -1,117 +1,16 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as shared from "../shared/index.js"; +import type { CreateSourceAccountRequestBody } from './createsourceaccountrequestbody'; +/* eslint-disable */ -export type CreateSourceAccountRequestBody = - | shared.SourceAccountV2Prototype - | shared.SourceAccountPrototype; - -export type CreateSourceAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: - | shared.SourceAccountV2Prototype - | shared.SourceAccountPrototype - | undefined; -}; - -/** - * Success - */ -export type CreateSourceAccountResponseBody = - | shared.SourceAccountV2 - | shared.SourceAccount; - -/** @internal */ -export type CreateSourceAccountRequestBody$Outbound = - | shared.SourceAccountV2Prototype$Outbound - | shared.SourceAccountPrototype$Outbound; - -/** @internal */ -export const CreateSourceAccountRequestBody$outboundSchema: z.ZodType< - CreateSourceAccountRequestBody$Outbound, - z.ZodTypeDef, - CreateSourceAccountRequestBody -> = z.union([ - shared.SourceAccountV2Prototype$outboundSchema, - shared.SourceAccountPrototype$outboundSchema, -]); - -export function createSourceAccountRequestBodyToJSON( - createSourceAccountRequestBody: CreateSourceAccountRequestBody, -): string { - return JSON.stringify( - CreateSourceAccountRequestBody$outboundSchema.parse( - createSourceAccountRequestBody, - ), - ); +export interface CreateSourceAccountRequest { + companyId: string; + connectionId: string; + requestBody?: CreateSourceAccountRequestBody | undefined; } -/** @internal */ -export type CreateSourceAccountRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: - | shared.SourceAccountV2Prototype$Outbound - | shared.SourceAccountPrototype$Outbound - | undefined; -}; - -/** @internal */ -export const CreateSourceAccountRequest$outboundSchema: z.ZodType< - CreateSourceAccountRequest$Outbound, - z.ZodTypeDef, - CreateSourceAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.union([ - shared.SourceAccountV2Prototype$outboundSchema, - shared.SourceAccountPrototype$outboundSchema, - ]).optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createSourceAccountRequestToJSON( - createSourceAccountRequest: CreateSourceAccountRequest, -): string { - return JSON.stringify( - CreateSourceAccountRequest$outboundSchema.parse(createSourceAccountRequest), - ); -} - -/** @internal */ -export const CreateSourceAccountResponseBody$inboundSchema: z.ZodType< - CreateSourceAccountResponseBody, - z.ZodTypeDef, - unknown -> = z.union([ - shared.SourceAccountV2$inboundSchema, - shared.SourceAccount$inboundSchema, -]); - -export function createSourceAccountResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSourceAccountResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSourceAccountResponseBody' from JSON`, - ); +export interface SourceAccountCreateRequestBody { + companyId: string; + connectionId: string; + requestBody?: CreateSourceAccountRequestBody | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/createsourceaccountrequestbody.ts b/bank-feeds/src/sdk/models/operations/createsourceaccountrequestbody.ts new file mode 100644 index 000000000..7210ed8d4 --- /dev/null +++ b/bank-feeds/src/sdk/models/operations/createsourceaccountrequestbody.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { SourceAccountPrototype } from '../shared/sourceaccountprototype'; +import { + instanceOfSourceAccountPrototype, + SourceAccountPrototypeFromJSON, + SourceAccountPrototypeFromJSONTyped, + SourceAccountPrototypeToJSON, +} from '../shared/sourceaccountprototype'; +import type { SourceAccountV2Prototype } from '../shared/sourceaccountv2prototype'; +import { + instanceOfSourceAccountV2Prototype, + SourceAccountV2PrototypeFromJSON, + SourceAccountV2PrototypeFromJSONTyped, + SourceAccountV2PrototypeToJSON, +} from '../shared/sourceaccountv2prototype'; + +/** + * @type CreateSourceAccountRequestBody + * + * @export + */ +export type CreateSourceAccountRequestBody = SourceAccountPrototype | SourceAccountV2Prototype; + +export function CreateSourceAccountRequestBodyFromJSON(json: any): CreateSourceAccountRequestBody { + return CreateSourceAccountRequestBodyFromJSONTyped(json, false); +} + +export function CreateSourceAccountRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSourceAccountRequestBody { + if (json == null) { + return json; + } + if (instanceOfSourceAccountPrototype(json)) { + return SourceAccountPrototypeFromJSONTyped(json, true); + } + if (instanceOfSourceAccountV2Prototype(json)) { + return SourceAccountV2PrototypeFromJSONTyped(json, true); + } + + return {} as any; +} + +export function CreateSourceAccountRequestBodyToJSON(json: any): any { + return CreateSourceAccountRequestBodyToJSONTyped(json, false); +} + +export function CreateSourceAccountRequestBodyToJSONTyped(value?: CreateSourceAccountRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (instanceOfSourceAccountPrototype(value)) { + return SourceAccountPrototypeToJSON(value as SourceAccountPrototype); + } + if (instanceOfSourceAccountV2Prototype(value)) { + return SourceAccountV2PrototypeToJSON(value as SourceAccountV2Prototype); + } + + return {}; +} + diff --git a/bank-feeds/src/sdk/models/operations/deletebankfeedcredentials.ts b/bank-feeds/src/sdk/models/operations/deletebankfeedcredentials.ts index 0fc6f9bdb..fcf330a22 100644 --- a/bank-feeds/src/sdk/models/operations/deletebankfeedcredentials.ts +++ b/bank-feeds/src/sdk/models/operations/deletebankfeedcredentials.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteBankFeedCredentialsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type DeleteBankFeedCredentialsRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const DeleteBankFeedCredentialsRequest$outboundSchema: z.ZodType< - DeleteBankFeedCredentialsRequest$Outbound, - z.ZodTypeDef, - DeleteBankFeedCredentialsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function deleteBankFeedCredentialsRequestToJSON( - deleteBankFeedCredentialsRequest: DeleteBankFeedCredentialsRequest, -): string { - return JSON.stringify( - DeleteBankFeedCredentialsRequest$outboundSchema.parse( - deleteBankFeedCredentialsRequest, - ), - ); +export interface DeleteBankFeedCredentialsRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/deletecompany.ts b/bank-feeds/src/sdk/models/operations/deletecompany.ts index dbe555534..84680d5e6 100644 --- a/bank-feeds/src/sdk/models/operations/deletecompany.ts +++ b/bank-feeds/src/sdk/models/operations/deletecompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type DeleteCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const DeleteCompanyRequest$outboundSchema: z.ZodType< - DeleteCompanyRequest$Outbound, - z.ZodTypeDef, - DeleteCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function deleteCompanyRequestToJSON( - deleteCompanyRequest: DeleteCompanyRequest, -): string { - return JSON.stringify( - DeleteCompanyRequest$outboundSchema.parse(deleteCompanyRequest), - ); +export interface DeleteCompanyRequest { + companyId: string; } diff --git a/bank-feeds/src/sdk/models/operations/deleteconnection.ts b/bank-feeds/src/sdk/models/operations/deleteconnection.ts index 83f759970..9a9aeb05b 100644 --- a/bank-feeds/src/sdk/models/operations/deleteconnection.ts +++ b/bank-feeds/src/sdk/models/operations/deleteconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type DeleteConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const DeleteConnectionRequest$outboundSchema: z.ZodType< - DeleteConnectionRequest$Outbound, - z.ZodTypeDef, - DeleteConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function deleteConnectionRequestToJSON( - deleteConnectionRequest: DeleteConnectionRequest, -): string { - return JSON.stringify( - DeleteConnectionRequest$outboundSchema.parse(deleteConnectionRequest), - ); +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/deletesourceaccount.ts b/bank-feeds/src/sdk/models/operations/deletesourceaccount.ts index 1fa06856e..eac1fdd6b 100644 --- a/bank-feeds/src/sdk/models/operations/deletesourceaccount.ts +++ b/bank-feeds/src/sdk/models/operations/deletesourceaccount.ts @@ -1,46 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteSourceAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for an account. - */ - accountId: string; -}; - -/** @internal */ -export type DeleteSourceAccountRequest$Outbound = { - companyId: string; - connectionId: string; - accountId: string; -}; - -/** @internal */ -export const DeleteSourceAccountRequest$outboundSchema: z.ZodType< - DeleteSourceAccountRequest$Outbound, - z.ZodTypeDef, - DeleteSourceAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - accountId: z.string(), -}); - -export function deleteSourceAccountRequestToJSON( - deleteSourceAccountRequest: DeleteSourceAccountRequest, -): string { - return JSON.stringify( - DeleteSourceAccountRequest$outboundSchema.parse(deleteSourceAccountRequest), - ); +export interface DeleteSourceAccountRequest { + companyId: string; + connectionId: string; + accountId: string; } diff --git a/bank-feeds/src/sdk/models/operations/generatecredentials.ts b/bank-feeds/src/sdk/models/operations/generatecredentials.ts index 3266d8687..02f493e78 100644 --- a/bank-feeds/src/sdk/models/operations/generatecredentials.ts +++ b/bank-feeds/src/sdk/models/operations/generatecredentials.ts @@ -1,53 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type GenerateCredentialsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody: ReadableStream | Blob | ArrayBuffer | Uint8Array; -}; - -/** @internal */ -export type GenerateCredentialsRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody: ReadableStream | Blob | ArrayBuffer | Uint8Array; -}; +export interface GenerateCredentialsRequest { + companyId: string; + connectionId: string; + requestBody?: ReadableStream | Blob | ArrayBuffer | Uint8Array; +} -/** @internal */ -export const GenerateCredentialsRequest$outboundSchema: z.ZodType< - GenerateCredentialsRequest$Outbound, - z.ZodTypeDef, - GenerateCredentialsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Uint8Array), - ]), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); +export interface CredentialsGenerateRequestBody { + companyId: string; + connectionId: string; + requestBody?: ReadableStream | Blob | ArrayBuffer | Uint8Array; +} -export function generateCredentialsRequestToJSON( - generateCredentialsRequest: GenerateCredentialsRequest, -): string { - return JSON.stringify( - GenerateCredentialsRequest$outboundSchema.parse(generateCredentialsRequest), - ); +export interface GenerateCredentialsRequestBody { + companyId: string; + connectionId: string; + requestBody?: ReadableStream | Blob | ArrayBuffer | Uint8Array; } diff --git a/bank-feeds/src/sdk/models/operations/generateotp.ts b/bank-feeds/src/sdk/models/operations/generateotp.ts index 0852b56ea..e11746547 100644 --- a/bank-feeds/src/sdk/models/operations/generateotp.ts +++ b/bank-feeds/src/sdk/models/operations/generateotp.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GenerateOtpRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GenerateOtpRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GenerateOtpRequest$outboundSchema: z.ZodType< - GenerateOtpRequest$Outbound, - z.ZodTypeDef, - GenerateOtpRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function generateOtpRequestToJSON( - generateOtpRequest: GenerateOtpRequest, -): string { - return JSON.stringify( - GenerateOtpRequest$outboundSchema.parse(generateOtpRequest), - ); +export interface GenerateOtpRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getbankaccountmapping.ts b/bank-feeds/src/sdk/models/operations/getbankaccountmapping.ts index acfa54967..86ac7b74a 100644 --- a/bank-feeds/src/sdk/models/operations/getbankaccountmapping.ts +++ b/bank-feeds/src/sdk/models/operations/getbankaccountmapping.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetBankAccountMappingRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetBankAccountMappingRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetBankAccountMappingRequest$outboundSchema: z.ZodType< - GetBankAccountMappingRequest$Outbound, - z.ZodTypeDef, - GetBankAccountMappingRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getBankAccountMappingRequestToJSON( - getBankAccountMappingRequest: GetBankAccountMappingRequest, -): string { - return JSON.stringify( - GetBankAccountMappingRequest$outboundSchema.parse( - getBankAccountMappingRequest, - ), - ); +export interface GetBankAccountMappingRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcompany.ts b/bank-feeds/src/sdk/models/operations/getcompany.ts index 77734decc..fc2a6e4a5 100644 --- a/bank-feeds/src/sdk/models/operations/getcompany.ts +++ b/bank-feeds/src/sdk/models/operations/getcompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyRequest$outboundSchema: z.ZodType< - GetCompanyRequest$Outbound, - z.ZodTypeDef, - GetCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyRequestToJSON( - getCompanyRequest: GetCompanyRequest, -): string { - return JSON.stringify( - GetCompanyRequest$outboundSchema.parse(getCompanyRequest), - ); +export interface GetCompanyRequest { + companyId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcompanyaccesstoken.ts b/bank-feeds/src/sdk/models/operations/getcompanyaccesstoken.ts index 6b76f47f2..1ec1601ba 100644 --- a/bank-feeds/src/sdk/models/operations/getcompanyaccesstoken.ts +++ b/bank-feeds/src/sdk/models/operations/getcompanyaccesstoken.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyAccessTokenRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyAccessTokenRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyAccessTokenRequest$outboundSchema: z.ZodType< - GetCompanyAccessTokenRequest$Outbound, - z.ZodTypeDef, - GetCompanyAccessTokenRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyAccessTokenRequestToJSON( - getCompanyAccessTokenRequest: GetCompanyAccessTokenRequest, -): string { - return JSON.stringify( - GetCompanyAccessTokenRequest$outboundSchema.parse( - getCompanyAccessTokenRequest, - ), - ); +export interface GetCompanyAccessTokenRequest { + companyId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcompanyinformation.ts b/bank-feeds/src/sdk/models/operations/getcompanyinformation.ts index bcfcdff0a..2857fd6c8 100644 --- a/bank-feeds/src/sdk/models/operations/getcompanyinformation.ts +++ b/bank-feeds/src/sdk/models/operations/getcompanyinformation.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyInformationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetCompanyInformationRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetCompanyInformationRequest$outboundSchema: z.ZodType< - GetCompanyInformationRequest$Outbound, - z.ZodTypeDef, - GetCompanyInformationRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getCompanyInformationRequestToJSON( - getCompanyInformationRequest: GetCompanyInformationRequest, -): string { - return JSON.stringify( - GetCompanyInformationRequest$outboundSchema.parse( - getCompanyInformationRequest, - ), - ); +export interface GetCompanyInformationRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getconnection.ts b/bank-feeds/src/sdk/models/operations/getconnection.ts index 126d23b85..0c787e45b 100644 --- a/bank-feeds/src/sdk/models/operations/getconnection.ts +++ b/bank-feeds/src/sdk/models/operations/getconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetConnectionRequest$outboundSchema: z.ZodType< - GetConnectionRequest$Outbound, - z.ZodTypeDef, - GetConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getConnectionRequestToJSON( - getConnectionRequest: GetConnectionRequest, -): string { - return JSON.stringify( - GetConnectionRequest$outboundSchema.parse(getConnectionRequest), - ); +export interface GetConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcreatebankaccountsmodel.ts b/bank-feeds/src/sdk/models/operations/getcreatebankaccountsmodel.ts index 455e4e838..ca5d8221c 100644 --- a/bank-feeds/src/sdk/models/operations/getcreatebankaccountsmodel.ts +++ b/bank-feeds/src/sdk/models/operations/getcreatebankaccountsmodel.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCreateBankAccountsModelRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetCreateBankAccountsModelRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetCreateBankAccountsModelRequest$outboundSchema: z.ZodType< - GetCreateBankAccountsModelRequest$Outbound, - z.ZodTypeDef, - GetCreateBankAccountsModelRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getCreateBankAccountsModelRequestToJSON( - getCreateBankAccountsModelRequest: GetCreateBankAccountsModelRequest, -): string { - return JSON.stringify( - GetCreateBankAccountsModelRequest$outboundSchema.parse( - getCreateBankAccountsModelRequest, - ), - ); +export interface GetCreateBankAccountsModelRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcreatebanktransactionsmodel.ts b/bank-feeds/src/sdk/models/operations/getcreatebanktransactionsmodel.ts index fa76cc44f..31137de22 100644 --- a/bank-feeds/src/sdk/models/operations/getcreatebanktransactionsmodel.ts +++ b/bank-feeds/src/sdk/models/operations/getcreatebanktransactionsmodel.ts @@ -1,48 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCreateBankTransactionsModelRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for an account. - */ - accountId: string; -}; - -/** @internal */ -export type GetCreateBankTransactionsModelRequest$Outbound = { - companyId: string; - connectionId: string; - accountId: string; -}; - -/** @internal */ -export const GetCreateBankTransactionsModelRequest$outboundSchema: z.ZodType< - GetCreateBankTransactionsModelRequest$Outbound, - z.ZodTypeDef, - GetCreateBankTransactionsModelRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - accountId: z.string(), -}); - -export function getCreateBankTransactionsModelRequestToJSON( - getCreateBankTransactionsModelRequest: GetCreateBankTransactionsModelRequest, -): string { - return JSON.stringify( - GetCreateBankTransactionsModelRequest$outboundSchema.parse( - getCreateBankTransactionsModelRequest, - ), - ); +export interface GetCreateBankTransactionsModelRequest { + companyId: string; + connectionId: string; + accountId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getcreateoperation.ts b/bank-feeds/src/sdk/models/operations/getcreateoperation.ts index 4df2424d9..83b68aeae 100644 --- a/bank-feeds/src/sdk/models/operations/getcreateoperation.ts +++ b/bank-feeds/src/sdk/models/operations/getcreateoperation.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCreateOperationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Push operation key. - */ - pushOperationKey: string; -}; - -/** @internal */ -export type GetCreateOperationRequest$Outbound = { - companyId: string; - pushOperationKey: string; -}; - -/** @internal */ -export const GetCreateOperationRequest$outboundSchema: z.ZodType< - GetCreateOperationRequest$Outbound, - z.ZodTypeDef, - GetCreateOperationRequest -> = z.object({ - companyId: z.string(), - pushOperationKey: z.string(), -}); - -export function getCreateOperationRequestToJSON( - getCreateOperationRequest: GetCreateOperationRequest, -): string { - return JSON.stringify( - GetCreateOperationRequest$outboundSchema.parse(getCreateOperationRequest), - ); +export interface GetCreateOperationRequest { + companyId: string; + pushOperationKey: string; } diff --git a/bank-feeds/src/sdk/models/operations/getlatestmanagedbankfeedsync.ts b/bank-feeds/src/sdk/models/operations/getlatestmanagedbankfeedsync.ts index 3439c9df2..e3c15bc7c 100644 --- a/bank-feeds/src/sdk/models/operations/getlatestmanagedbankfeedsync.ts +++ b/bank-feeds/src/sdk/models/operations/getlatestmanagedbankfeedsync.ts @@ -1,48 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetLatestManagedBankFeedSyncRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * The ID of the source bank account. - */ - sourceAccountId: string; -}; - -/** @internal */ -export type GetLatestManagedBankFeedSyncRequest$Outbound = { - companyId: string; - connectionId: string; - sourceAccountId: string; -}; - -/** @internal */ -export const GetLatestManagedBankFeedSyncRequest$outboundSchema: z.ZodType< - GetLatestManagedBankFeedSyncRequest$Outbound, - z.ZodTypeDef, - GetLatestManagedBankFeedSyncRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - sourceAccountId: z.string(), -}); - -export function getLatestManagedBankFeedSyncRequestToJSON( - getLatestManagedBankFeedSyncRequest: GetLatestManagedBankFeedSyncRequest, -): string { - return JSON.stringify( - GetLatestManagedBankFeedSyncRequest$outboundSchema.parse( - getLatestManagedBankFeedSyncRequest, - ), - ); +export interface GetLatestManagedBankFeedSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; } diff --git a/bank-feeds/src/sdk/models/operations/getmanagedbankfeedsync.ts b/bank-feeds/src/sdk/models/operations/getmanagedbankfeedsync.ts index 7dc149bbc..d7014a0f0 100644 --- a/bank-feeds/src/sdk/models/operations/getmanagedbankfeedsync.ts +++ b/bank-feeds/src/sdk/models/operations/getmanagedbankfeedsync.ts @@ -1,54 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type GetManagedBankFeedSyncRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * The ID of the source bank account. - */ - sourceAccountId: string; - /** - * The ID of the sync. - */ - syncId: string; -}; - -/** @internal */ -export type GetManagedBankFeedSyncRequest$Outbound = { - companyId: string; - connectionId: string; - sourceAccountId: string; - syncId: string; -}; - -/** @internal */ -export const GetManagedBankFeedSyncRequest$outboundSchema: z.ZodType< - GetManagedBankFeedSyncRequest$Outbound, - z.ZodTypeDef, - GetManagedBankFeedSyncRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - sourceAccountId: z.string(), - syncId: z.string(), -}); - -export function getManagedBankFeedSyncRequestToJSON( - getManagedBankFeedSyncRequest: GetManagedBankFeedSyncRequest, -): string { - return JSON.stringify( - GetManagedBankFeedSyncRequest$outboundSchema.parse( - getManagedBankFeedSyncRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface GetManagedBankFeedSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; + syncId: string; } diff --git a/bank-feeds/src/sdk/models/operations/index.ts b/bank-feeds/src/sdk/models/operations/index.ts index 30110bc84..f8f5ec66a 100644 --- a/bank-feeds/src/sdk/models/operations/index.ts +++ b/bank-feeds/src/sdk/models/operations/index.ts @@ -1,36 +1,42 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./createbankaccount.js"; -export * from "./createbankaccountmapping.js"; -export * from "./createbanktransactions.js"; -export * from "./createbatchsourceaccount.js"; -export * from "./createconnection.js"; -export * from "./createsourceaccount.js"; -export * from "./deletebankfeedcredentials.js"; -export * from "./deletecompany.js"; -export * from "./deleteconnection.js"; -export * from "./deletesourceaccount.js"; -export * from "./generatecredentials.js"; -export * from "./generateotp.js"; -export * from "./getbankaccountmapping.js"; -export * from "./getcompany.js"; -export * from "./getcompanyaccesstoken.js"; -export * from "./getcompanyinformation.js"; -export * from "./getconnection.js"; -export * from "./getcreatebankaccountsmodel.js"; -export * from "./getcreatebanktransactionsmodel.js"; -export * from "./getcreateoperation.js"; -export * from "./getlatestmanagedbankfeedsync.js"; -export * from "./getmanagedbankfeedsync.js"; -export * from "./listbankaccounts.js"; -export * from "./listcompanies.js"; -export * from "./listconnections.js"; -export * from "./listcreateoperations.js"; -export * from "./listsourceaccounts.js"; -export * from "./replacecompany.js"; -export * from "./runmanagedbankfeedadhocsync.js"; -export * from "./unlinkconnection.js"; -export * from "./updatecompany.js"; -export * from "./updatesourceaccount.js"; +export * from './createbankaccountmapping'; +export * from './createbankaccount'; +export * from './createbanktransactions'; +export * from './createbatchsourceaccount'; +export * from './createbatchsourceaccountrequestbody'; +export * from './createconnection'; +export * from './createconnectionrequestbody'; +export * from './createsourceaccount'; +export * from './createsourceaccountrequestbody'; +export * from './deletebankfeedcredentials'; +export * from './deletecompany'; +export * from './deleteconnection'; +export * from './deletesourceaccount'; +export * from './generatecredentials'; +export * from './generateotp'; +export * from './getbankaccountmapping'; +export * from './getcompanyaccesstoken'; +export * from './getcompanyinformation'; +export * from './getcompany'; +export * from './getconnection'; +export * from './getcreatebankaccountsmodel'; +export * from './getcreatebanktransactionsmodel'; +export * from './getcreateoperation'; +export * from './getlatestmanagedbankfeedsync'; +export * from './getmanagedbankfeedsync'; +export * from './listbankaccounts'; +export * from './listcompanies'; +export * from './listconnections'; +export * from './listcreateoperations'; +export * from './listsourceaccounts'; +export * from './replacecompany'; +export * from './runmanagedbankfeedadhocsync'; +export * from './unlinkconnection'; +export * from './updatecompany'; +export * from './updatesourceaccount'; +export { CreateBatchSourceAccountResponse } from '../_speakeasy_operations'; +export { CreateSourceAccountResponseBody } from '../_speakeasy_operations'; +export { ListSourceAccountsResponseBody } from '../_speakeasy_operations'; +export { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; diff --git a/bank-feeds/src/sdk/models/operations/listbankaccounts.ts b/bank-feeds/src/sdk/models/operations/listbankaccounts.ts index b4244f676..40c4035c3 100644 --- a/bank-feeds/src/sdk/models/operations/listbankaccounts.ts +++ b/bank-feeds/src/sdk/models/operations/listbankaccounts.ts @@ -1,64 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListBankAccountsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListBankAccountsRequest$Outbound = { - companyId: string; - connectionId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListBankAccountsRequest$outboundSchema: z.ZodType< - ListBankAccountsRequest$Outbound, - z.ZodTypeDef, - ListBankAccountsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listBankAccountsRequestToJSON( - listBankAccountsRequest: ListBankAccountsRequest, -): string { - return JSON.stringify( - ListBankAccountsRequest$outboundSchema.parse(listBankAccountsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListBankAccountsRequest { + companyId: string; + connectionId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/bank-feeds/src/sdk/models/operations/listcompanies.ts b/bank-feeds/src/sdk/models/operations/listcompanies.ts index 837a6aae5..939f42b3f 100644 --- a/bank-feeds/src/sdk/models/operations/listcompanies.ts +++ b/bank-feeds/src/sdk/models/operations/listcompanies.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCompaniesRequest = { - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; - /** - * Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). - */ - tags?: string | undefined; -}; - -/** @internal */ -export type ListCompaniesRequest$Outbound = { - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; - tags?: string | undefined; -}; - -/** @internal */ -export const ListCompaniesRequest$outboundSchema: z.ZodType< - ListCompaniesRequest$Outbound, - z.ZodTypeDef, - ListCompaniesRequest -> = z.object({ - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), - tags: z.string().optional(), -}); - -export function listCompaniesRequestToJSON( - listCompaniesRequest: ListCompaniesRequest, -): string { - return JSON.stringify( - ListCompaniesRequest$outboundSchema.parse(listCompaniesRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; } diff --git a/bank-feeds/src/sdk/models/operations/listconnections.ts b/bank-feeds/src/sdk/models/operations/listconnections.ts index d1be0d942..47d6ac043 100644 --- a/bank-feeds/src/sdk/models/operations/listconnections.ts +++ b/bank-feeds/src/sdk/models/operations/listconnections.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListConnectionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListConnectionsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListConnectionsRequest$outboundSchema: z.ZodType< - ListConnectionsRequest$Outbound, - z.ZodTypeDef, - ListConnectionsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listConnectionsRequestToJSON( - listConnectionsRequest: ListConnectionsRequest, -): string { - return JSON.stringify( - ListConnectionsRequest$outboundSchema.parse(listConnectionsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/bank-feeds/src/sdk/models/operations/listcreateoperations.ts b/bank-feeds/src/sdk/models/operations/listcreateoperations.ts index 069bc8d41..cb58bf4c4 100644 --- a/bank-feeds/src/sdk/models/operations/listcreateoperations.ts +++ b/bank-feeds/src/sdk/models/operations/listcreateoperations.ts @@ -1,60 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCreateOperationsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListCreateOperationsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListCreateOperationsRequest$outboundSchema: z.ZodType< - ListCreateOperationsRequest$Outbound, - z.ZodTypeDef, - ListCreateOperationsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listCreateOperationsRequestToJSON( - listCreateOperationsRequest: ListCreateOperationsRequest, -): string { - return JSON.stringify( - ListCreateOperationsRequest$outboundSchema.parse( - listCreateOperationsRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCreateOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/bank-feeds/src/sdk/models/operations/listsourceaccounts.ts b/bank-feeds/src/sdk/models/operations/listsourceaccounts.ts index ce1e11557..4e86399cf 100644 --- a/bank-feeds/src/sdk/models/operations/listsourceaccounts.ts +++ b/bank-feeds/src/sdk/models/operations/listsourceaccounts.ts @@ -1,71 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as shared from "../shared/index.js"; - -export type ListSourceAccountsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** - * Success - */ -export type ListSourceAccountsResponseBody = - | Array - | Array; - -/** @internal */ -export type ListSourceAccountsRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const ListSourceAccountsRequest$outboundSchema: z.ZodType< - ListSourceAccountsRequest$Outbound, - z.ZodTypeDef, - ListSourceAccountsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function listSourceAccountsRequestToJSON( - listSourceAccountsRequest: ListSourceAccountsRequest, -): string { - return JSON.stringify( - ListSourceAccountsRequest$outboundSchema.parse(listSourceAccountsRequest), - ); -} - -/** @internal */ -export const ListSourceAccountsResponseBody$inboundSchema: z.ZodType< - ListSourceAccountsResponseBody, - z.ZodTypeDef, - unknown -> = z.union([ - z.array(shared.SourceAccountV2$inboundSchema), - z.array(shared.SourceAccount$inboundSchema), -]); - -export function listSourceAccountsResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListSourceAccountsResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListSourceAccountsResponseBody' from JSON`, - ); +export interface ListSourceAccountsRequest { + companyId: string; + connectionId: string; } diff --git a/bank-feeds/src/sdk/models/operations/replacecompany.ts b/bank-feeds/src/sdk/models/operations/replacecompany.ts index 5ee35551d..6add5d7c2 100644 --- a/bank-feeds/src/sdk/models/operations/replacecompany.ts +++ b/bank-feeds/src/sdk/models/operations/replacecompany.ts @@ -1,43 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyRequestBody } from '../shared/companyrequestbody'; +/* eslint-disable */ -export type ReplaceCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyRequestBody?: shared.CompanyRequestBody | undefined; -}; - -/** @internal */ -export type ReplaceCompanyRequest$Outbound = { - companyId: string; - CompanyRequestBody?: shared.CompanyRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const ReplaceCompanyRequest$outboundSchema: z.ZodType< - ReplaceCompanyRequest$Outbound, - z.ZodTypeDef, - ReplaceCompanyRequest -> = z.object({ - companyId: z.string(), - companyRequestBody: shared.CompanyRequestBody$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyRequestBody: "CompanyRequestBody", - }); -}); - -export function replaceCompanyRequestToJSON( - replaceCompanyRequest: ReplaceCompanyRequest, -): string { - return JSON.stringify( - ReplaceCompanyRequest$outboundSchema.parse(replaceCompanyRequest), - ); +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/runmanagedbankfeedadhocsync.ts b/bank-feeds/src/sdk/models/operations/runmanagedbankfeedadhocsync.ts index d00834b86..425daaaad 100644 --- a/bank-feeds/src/sdk/models/operations/runmanagedbankfeedadhocsync.ts +++ b/bank-feeds/src/sdk/models/operations/runmanagedbankfeedadhocsync.ts @@ -1,48 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type RunManagedBankFeedAdHocSyncRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * The ID of the source bank account. - */ - sourceAccountId: string; -}; - -/** @internal */ -export type RunManagedBankFeedAdHocSyncRequest$Outbound = { - companyId: string; - connectionId: string; - sourceAccountId: string; -}; - -/** @internal */ -export const RunManagedBankFeedAdHocSyncRequest$outboundSchema: z.ZodType< - RunManagedBankFeedAdHocSyncRequest$Outbound, - z.ZodTypeDef, - RunManagedBankFeedAdHocSyncRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - sourceAccountId: z.string(), -}); - -export function runManagedBankFeedAdHocSyncRequestToJSON( - runManagedBankFeedAdHocSyncRequest: RunManagedBankFeedAdHocSyncRequest, -): string { - return JSON.stringify( - RunManagedBankFeedAdHocSyncRequest$outboundSchema.parse( - runManagedBankFeedAdHocSyncRequest, - ), - ); +export interface RunManagedBankFeedAdHocSyncRequest { + companyId: string; + connectionId: string; + sourceAccountId: string; } diff --git a/bank-feeds/src/sdk/models/operations/unlinkconnection.ts b/bank-feeds/src/sdk/models/operations/unlinkconnection.ts index dbdba4a38..6bd02ed51 100644 --- a/bank-feeds/src/sdk/models/operations/unlinkconnection.ts +++ b/bank-feeds/src/sdk/models/operations/unlinkconnection.ts @@ -1,81 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; +/* eslint-disable */ -export type UnlinkConnectionUpdateConnection = { - /** - * The current authorization status of the data connection. - */ - status?: shared.DataConnectionStatus | undefined; -}; - -export type UnlinkConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: UnlinkConnectionUpdateConnection | undefined; -}; - -/** @internal */ -export type UnlinkConnectionUpdateConnection$Outbound = { - status?: string | undefined; -}; - -/** @internal */ -export const UnlinkConnectionUpdateConnection$outboundSchema: z.ZodType< - UnlinkConnectionUpdateConnection$Outbound, - z.ZodTypeDef, - UnlinkConnectionUpdateConnection -> = z.object({ - status: shared.DataConnectionStatus$outboundSchema.optional(), -}); - -export function unlinkConnectionUpdateConnectionToJSON( - unlinkConnectionUpdateConnection: UnlinkConnectionUpdateConnection, -): string { - return JSON.stringify( - UnlinkConnectionUpdateConnection$outboundSchema.parse( - unlinkConnectionUpdateConnection, - ), - ); -} - -/** @internal */ -export type UnlinkConnectionRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: UnlinkConnectionUpdateConnection$Outbound | undefined; -}; - -/** @internal */ -export const UnlinkConnectionRequest$outboundSchema: z.ZodType< - UnlinkConnectionRequest$Outbound, - z.ZodTypeDef, - UnlinkConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.lazy(() => UnlinkConnectionUpdateConnection$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function unlinkConnectionRequestToJSON( - unlinkConnectionRequest: UnlinkConnectionRequest, -): string { - return JSON.stringify( - UnlinkConnectionRequest$outboundSchema.parse(unlinkConnectionRequest), - ); +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UnlinkConnectionUpdateConnection; } diff --git a/bank-feeds/src/sdk/models/operations/updatecompany.ts b/bank-feeds/src/sdk/models/operations/updatecompany.ts index 37ead4428..618928d50 100644 --- a/bank-feeds/src/sdk/models/operations/updatecompany.ts +++ b/bank-feeds/src/sdk/models/operations/updatecompany.ts @@ -1,43 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyUpdateRequest } from '../shared/companyupdaterequest'; +/* eslint-disable */ -export type UpdateCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyUpdateRequest?: shared.CompanyUpdateRequest | undefined; -}; - -/** @internal */ -export type UpdateCompanyRequest$Outbound = { - companyId: string; - CompanyUpdateRequest?: shared.CompanyUpdateRequest$Outbound | undefined; -}; - -/** @internal */ -export const UpdateCompanyRequest$outboundSchema: z.ZodType< - UpdateCompanyRequest$Outbound, - z.ZodTypeDef, - UpdateCompanyRequest -> = z.object({ - companyId: z.string(), - companyUpdateRequest: shared.CompanyUpdateRequest$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyUpdateRequest: "CompanyUpdateRequest", - }); -}); +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; +} -export function updateCompanyRequestToJSON( - updateCompanyRequest: UpdateCompanyRequest, -): string { - return JSON.stringify( - UpdateCompanyRequest$outboundSchema.parse(updateCompanyRequest), - ); +export interface CompanyUpdateRequestUpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; } diff --git a/bank-feeds/src/sdk/models/operations/updatesourceaccount.ts b/bank-feeds/src/sdk/models/operations/updatesourceaccount.ts index 835ff5d80..a50af25a9 100644 --- a/bank-feeds/src/sdk/models/operations/updatesourceaccount.ts +++ b/bank-feeds/src/sdk/models/operations/updatesourceaccount.ts @@ -1,55 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { SourceAccount } from '../shared/sourceaccount'; +/* eslint-disable */ -export type UpdateSourceAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for an account. - */ - accountId: string; - sourceAccount?: shared.SourceAccount | undefined; -}; - -/** @internal */ -export type UpdateSourceAccountRequest$Outbound = { - companyId: string; - connectionId: string; - accountId: string; - SourceAccount?: shared.SourceAccount$Outbound | undefined; -}; - -/** @internal */ -export const UpdateSourceAccountRequest$outboundSchema: z.ZodType< - UpdateSourceAccountRequest$Outbound, - z.ZodTypeDef, - UpdateSourceAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - accountId: z.string(), - sourceAccount: shared.SourceAccount$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - sourceAccount: "SourceAccount", - }); -}); - -export function updateSourceAccountRequestToJSON( - updateSourceAccountRequest: UpdateSourceAccountRequest, -): string { - return JSON.stringify( - UpdateSourceAccountRequest$outboundSchema.parse(updateSourceAccountRequest), - ); +export interface UpdateSourceAccountRequest { + companyId: string; + connectionId: string; + accountId: string; + sourceAccount?: SourceAccount | undefined; } diff --git a/bank-feeds/src/sdk/models/shared/accountinfo.ts b/bank-feeds/src/sdk/models/shared/accountinfo.ts index 3bc959020..fe03cb5bd 100644 --- a/bank-feeds/src/sdk/models/shared/accountinfo.ts +++ b/bank-feeds/src/sdk/models/shared/accountinfo.ts @@ -1,82 +1,423 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AccountInfo = { - /** - * Description of the account. - */ - description?: string | null | undefined; - /** - * Name given to the account by the user. Used in UIs to assist in account selection. - */ - nickname?: string | null | undefined; - /** - * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: - * - * @remarks - * ``` - * 2020-10-08 - * ``` - */ - accountOpenDate?: string | null | undefined; - /** - * Balance of funds available for use. This includes pending activity. - */ - availableBalance?: Decimal$ | number | null | undefined; -}; - -/** @internal */ -export const AccountInfo$inboundSchema: z.ZodType< - AccountInfo, - z.ZodTypeDef, - unknown -> = z.object({ - description: z.nullable(z.string()).optional(), - nickname: z.nullable(z.string()).optional(), - accountOpenDate: z.nullable(z.string()).optional(), - availableBalance: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), -}); -/** @internal */ -export type AccountInfo$Outbound = { - description?: string | null | undefined; - nickname?: string | null | undefined; - accountOpenDate?: string | null | undefined; - availableBalance?: number | null | undefined; -}; - -/** @internal */ -export const AccountInfo$outboundSchema: z.ZodType< - AccountInfo$Outbound, - z.ZodTypeDef, - AccountInfo -> = z.object({ - description: z.nullable(z.string()).optional(), - nickname: z.nullable(z.string()).optional(), - accountOpenDate: z.nullable(z.string()).optional(), - availableBalance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), -}); - -export function accountInfoToJSON(accountInfo: AccountInfo): string { - return JSON.stringify(AccountInfo$outboundSchema.parse(accountInfo)); -} -export function accountInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountInfo' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +/** + * + * @export + * @interface AccountInfo + */ +export interface AccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +/** + * Check if a given object implements the AccountInfo interface. + */ +export function instanceOfAccountInfo(value: object): value is AccountInfo { + return true; +} + +export function AccountInfoFromJSON(json: any): AccountInfo { + return AccountInfoFromJSONTyped(json, false); +} + +export function AccountInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountInfo { + if (json == null) { + return json; + } + return { + + 'description': json['description'] == null ? undefined : json['description'], + 'nickname': json['nickname'] == null ? undefined : json['nickname'], + 'accountOpenDate': json['accountOpenDate'] == null ? undefined : json['accountOpenDate'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + }; +} + +export function AccountInfoToJSON(json: any): AccountInfo { + return AccountInfoToJSONTyped(json, false); +} + +export function AccountInfoToJSONTyped(value?: AccountInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'nickname': value['nickname'], + 'accountOpenDate': value['accountOpenDate'], + 'availableBalance': fromDecimal(value['availableBalance']), + }; +} + + +export interface BatchSourceAccountV2CreationResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface CreateBatchSourceAccountRequestBodyAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface CreateSourceAccountRequestBodyAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface CreateSourceAccountResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface ListSourceAccountsResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountCreateResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountStatusChangedWebhookAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountV2AccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountV2BatchCreateResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountWebhookAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; +} + +export interface SourceAccountsListResponseAccountInfo { + /** + * Description of the account. + * @type {string} + * @memberof AccountInfo + */ + description?: string | null; + /** + * Name given to the account by the user. Used in UIs to assist in account selection. + * @type {string} + * @memberof AccountInfo + */ + nickname?: string | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof AccountInfo + */ + accountOpenDate?: string | null; + /** + * Balance of funds available for use. This includes pending activity. + * @type {number} + * @memberof AccountInfo + */ + availableBalance?: Decimal | number | null; } diff --git a/bank-feeds/src/sdk/models/shared/accountingbankaccount.ts b/bank-feeds/src/sdk/models/shared/accountingbankaccount.ts new file mode 100644 index 000000000..9e80b7bbf --- /dev/null +++ b/bank-feeds/src/sdk/models/shared/accountingbankaccount.ts @@ -0,0 +1,1106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { BankAccountCreateResponseBankAccountType } from '../_speakeasy_enums'; +import type { BankAccountCreateResponseMetadata } from './metadata'; +import type { BankAccountCreateResponseSupplementalData } from './supplementaldata'; +import type { BankAccountsBankAccountType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { SupplementalData } from './supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { Metadata } from './metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './metadata'; +import type { BankAccountStatus } from './bankaccountstatus'; +import { + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './bankaccountstatus'; + +/** + * > **Accessing Bank Accounts through Banking API** + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > + * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. + * + * ## Overview + * + * A list of bank accounts associated with a company and a specific data connection. + * + * Bank accounts data includes: + * * The name and ID of the account in the accounting software. + * * The currency and balance of the account. + * * The sort code and account number. + * @export + * @interface AccountingBankAccount + */ +export interface AccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + + +/** + * @export + */ +export const AccountingBankAccountAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type AccountingBankAccountAccountTypeEnum = typeof AccountingBankAccountAccountTypeEnum[keyof typeof AccountingBankAccountAccountTypeEnum]; + + +/** + * Check if a given object implements the AccountingBankAccount interface. + */ +export function instanceOfAccountingBankAccount(value: object): value is AccountingBankAccount { + return true; +} + +export function AccountingBankAccountFromJSON(json: any): AccountingBankAccount { + return AccountingBankAccountFromJSONTyped(json, false); +} + +export function AccountingBankAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountingBankAccount { + if (json == null) { + return json; + } + return { + + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'id': json['id'] == null ? undefined : json['id'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function AccountingBankAccountToJSON(json: any): AccountingBankAccount { + return AccountingBankAccountToJSONTyped(json, false); +} + +export function AccountingBankAccountToJSONTyped(value?: AccountingBankAccount | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + 'id': value['id'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface AccountingBankAccountsAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + +export interface BankAccountCreateResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountCreateResponseBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: BankAccountCreateResponseMetadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: BankAccountCreateResponseSupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + +export interface BankAccountsAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + +export interface BankAccountsListResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + +export interface CreateBankAccountResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} + +export interface ListBankAccountsResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof AccountingBankAccount + */ + accountType?: BankAccountsBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof AccountingBankAccount + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof AccountingBankAccount + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof AccountingBankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof AccountingBankAccount + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof AccountingBankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof AccountingBankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof AccountingBankAccount + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof AccountingBankAccount + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof AccountingBankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof AccountingBankAccount + */ + status?: BankAccountStatus; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof AccountingBankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof AccountingBankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof AccountingBankAccount + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof AccountingBankAccount + */ + sourceModifiedDate?: string; +} diff --git a/bank-feeds/src/sdk/models/shared/accounttype.ts b/bank-feeds/src/sdk/models/shared/accounttype.ts deleted file mode 100644 index 97dd1abbf..000000000 --- a/bank-feeds/src/sdk/models/shared/accounttype.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - */ -export const AccountType = { - Checking: "checking", - Savings: "savings", - Loan: "loan", - CreditCard: "creditCard", - PrepaidCard: "prepaidCard", -} as const; -/** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - */ -export type AccountType = ClosedEnum; - -/** @internal */ -export const AccountType$outboundSchema: z.ZodNativeEnum = z - .nativeEnum(AccountType); diff --git a/bank-feeds/src/sdk/models/shared/bankaccountcreateresponse.ts b/bank-feeds/src/sdk/models/shared/bankaccountcreateresponse.ts index 26996d727..4ab3fcefa 100644 --- a/bank-feeds/src/sdk/models/shared/bankaccountcreateresponse.ts +++ b/bank-feeds/src/sdk/models/shared/bankaccountcreateresponse.ts @@ -1,405 +1,499 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { BankAccountCreateResponseAccountingBankAccount } from './accountingbankaccount'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - BankAccountStatus, - BankAccountStatus$inboundSchema, -} from "./bankaccountstatus.js"; -import { DataType, DataType$inboundSchema } from "./datatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { BankAccountCreateResponseAllOfData } from '../BankAccountCreateResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + BankAccountCreateResponseAllOfDataFromJSON, + BankAccountCreateResponseAllOfDataFromJSONTyped, + BankAccountCreateResponseAllOfDataToJSON, + BankAccountCreateResponseAllOfDataToJSONTyped, +} from '../BankAccountCreateResponseAllOfData'; +import type { DataType } from './datatype'; +import { + DataTypeFromJSON, + DataTypeFromJSONTyped, + DataTypeToJSON, + DataTypeToJSONTyped, +} from './datatype'; +import type { PushOperationChange } from './pushoperationchange'; +import { + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ -export const BankAccountCreateResponseBankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", -} as const; -/** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * + * @export + * @interface BankAccountCreateResponse */ -export type BankAccountCreateResponseBankAccountType = ClosedEnum< - typeof BankAccountCreateResponseBankAccountType ->; +export interface BankAccountCreateResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof BankAccountCreateResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof BankAccountCreateResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof BankAccountCreateResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof BankAccountCreateResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof BankAccountCreateResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof BankAccountCreateResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof BankAccountCreateResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof BankAccountCreateResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof BankAccountCreateResponse + */ + statusCode: number; + /** + * + * @type {BankAccountCreateResponseAllOfData} + * @memberof BankAccountCreateResponse + */ + data?: BankAccountCreateResponseAccountingBankAccount | null; +} -export type BankAccountCreateResponseMetadata = { - /** - * Indicates whether the record has been deleted in the third-party system this record originated from. - */ - isDeleted?: boolean | null | undefined; -}; -/** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - */ -export type BankAccountCreateResponseSupplementalData = { - content?: { [k: string]: { [k: string]: any } } | null | undefined; -}; /** - * > **Accessing Bank Accounts through Banking API** - * - * @remarks - * > - * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. - * > - * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. - * - * ## Overview - * - * A list of bank accounts associated with a company and a specific data connection. - * - * Bank accounts data includes: - * * The name and ID of the account in the accounting software. - * * The currency and balance of the account. - * * The sort code and account number. - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * Check if a given object implements the BankAccountCreateResponse interface. */ -export type BankAccountCreateResponseAccountingBankAccount = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the bank account in the accounting software. - */ - accountName?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountCreateResponseBankAccountType | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * Xero integrations - * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. - */ - sortCode?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * Xero integrations - * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. - * - * FreeAgent integrations - * For Credit accounts, only the last four digits are required. For other types, the field is optional. - */ - accountNumber?: string | null | undefined; - /** - * International bank account number of the account. Often used when making or receiving international payments. - */ - iBan?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Balance of the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The institution of the bank account. - */ - institution?: string | null | undefined; - /** - * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. - */ - availableBalance?: Decimal$ | number | null | undefined; - /** - * Pre-arranged overdraft limit of the account. - * - * @remarks - * - * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. - */ - overdraftLimit?: Decimal$ | number | null | undefined; - /** - * Status of the bank account. - */ - status?: BankAccountStatus | undefined; - metadata?: BankAccountCreateResponseMetadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - */ - supplementalData?: BankAccountCreateResponseSupplementalData | undefined; -}; - -export type BankAccountCreateResponse = { - data?: BankAccountCreateResponseAccountingBankAccount | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; +export function instanceOfBankAccountCreateResponse(value: object): value is BankAccountCreateResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} -/** @internal */ -export const BankAccountCreateResponseBankAccountType$inboundSchema: - z.ZodNativeEnum = z - .nativeEnum(BankAccountCreateResponseBankAccountType); +export function BankAccountCreateResponseFromJSON(json: any): BankAccountCreateResponse { + return BankAccountCreateResponseFromJSONTyped(json, false); +} -/** @internal */ -export const BankAccountCreateResponseMetadata$inboundSchema: z.ZodType< - BankAccountCreateResponseMetadata, - z.ZodTypeDef, - unknown -> = z.object({ - isDeleted: z.nullable(z.boolean()).optional(), -}); +export function BankAccountCreateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountCreateResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : DataTypeFromJSON(json['dataType']), + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : BankAccountCreateResponseAllOfDataFromJSON(json['data']), + }; +} -export function bankAccountCreateResponseMetadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccountCreateResponseMetadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccountCreateResponseMetadata' from JSON`, - ); +export function BankAccountCreateResponseToJSON(json: any): BankAccountCreateResponse { + return BankAccountCreateResponseToJSONTyped(json, false); } -/** @internal */ -export const BankAccountCreateResponseSupplementalData$inboundSchema: z.ZodType< - BankAccountCreateResponseSupplementalData, - z.ZodTypeDef, - unknown -> = z.object({ - content: z.nullable(z.record(z.record(z.any()))).optional(), -}); +export function BankAccountCreateResponseToJSONTyped(value?: BankAccountCreateResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function bankAccountCreateResponseSupplementalDataFromJSON( - jsonString: string, -): SafeParseResult< - BankAccountCreateResponseSupplementalData, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - BankAccountCreateResponseSupplementalData$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'BankAccountCreateResponseSupplementalData' from JSON`, - ); + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': DataTypeToJSON(value['dataType']), + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': BankAccountCreateResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const BankAccountCreateResponseAccountingBankAccount$inboundSchema: - z.ZodType< - BankAccountCreateResponseAccountingBankAccount, - z.ZodTypeDef, - unknown - > = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - accountName: z.nullable(z.string()).optional(), - accountType: BankAccountCreateResponseBankAccountType$inboundSchema - .optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - iBan: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - institution: z.nullable(z.string()).optional(), - availableBalance: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - overdraftLimit: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - status: BankAccountStatus$inboundSchema.optional(), - metadata: z.lazy(() => BankAccountCreateResponseMetadata$inboundSchema) - .optional(), - supplementalData: z.lazy(() => - BankAccountCreateResponseSupplementalData$inboundSchema - ).optional(), - }); -export function bankAccountCreateResponseAccountingBankAccountFromJSON( - jsonString: string, -): SafeParseResult< - BankAccountCreateResponseAccountingBankAccount, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - BankAccountCreateResponseAccountingBankAccount$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'BankAccountCreateResponseAccountingBankAccount' from JSON`, - ); +export interface BankAccountCreateResponseBankAccountCreateResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof BankAccountCreateResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof BankAccountCreateResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof BankAccountCreateResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof BankAccountCreateResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof BankAccountCreateResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof BankAccountCreateResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof BankAccountCreateResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof BankAccountCreateResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof BankAccountCreateResponse + */ + statusCode: number; + /** + * + * @type {BankAccountCreateResponseAllOfData} + * @memberof BankAccountCreateResponse + */ + data?: BankAccountCreateResponseAllOfData | null; } -/** @internal */ -export const BankAccountCreateResponse$inboundSchema: z.ZodType< - BankAccountCreateResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable( - z.lazy(() => BankAccountCreateResponseAccountingBankAccount$inboundSchema), - ).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: DataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); - -export function bankAccountCreateResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccountCreateResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccountCreateResponse' from JSON`, - ); +export interface CreateBankAccountResponseBankAccountCreateResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof BankAccountCreateResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof BankAccountCreateResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof BankAccountCreateResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof BankAccountCreateResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof BankAccountCreateResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankAccountCreateResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof BankAccountCreateResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof BankAccountCreateResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof BankAccountCreateResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof BankAccountCreateResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof BankAccountCreateResponse + */ + statusCode: number; + /** + * + * @type {BankAccountCreateResponseAllOfData} + * @memberof BankAccountCreateResponse + */ + data?: BankAccountCreateResponseAllOfData | null; } diff --git a/bank-feeds/src/sdk/models/shared/bankaccountcredentials.ts b/bank-feeds/src/sdk/models/shared/bankaccountcredentials.ts index c53a6fa27..fa3e9235f 100644 --- a/bank-feeds/src/sdk/models/shared/bankaccountcredentials.ts +++ b/bank-feeds/src/sdk/models/shared/bankaccountcredentials.ts @@ -1,42 +1,103 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Result of generate credentials + * @export + * @interface BankAccountCredentials + */ +export interface BankAccountCredentials { + /** + * Username used by the bank feeds platform to retrieve transactions + * @type {string} + * @memberof BankAccountCredentials + */ + username?: string; + /** + * Password to enable the bank feeds platform to securely retrieve transactions. + * @type {string} + * @memberof BankAccountCredentials + */ + password?: string; +} + +/** + * Check if a given object implements the BankAccountCredentials interface. */ -export type BankAccountCredentials = { - /** - * Username used by the bank feeds platform to retrieve transactions - */ - username?: string | undefined; - /** - * Password to enable the bank feeds platform to securely retrieve transactions. - */ - password?: string | undefined; -}; - -/** @internal */ -export const BankAccountCredentials$inboundSchema: z.ZodType< - BankAccountCredentials, - z.ZodTypeDef, - unknown -> = z.object({ - username: z.string().optional(), - password: z.string().optional(), -}); - -export function bankAccountCredentialsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccountCredentials$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccountCredentials' from JSON`, - ); +export function instanceOfBankAccountCredentials(value: object): value is BankAccountCredentials { + return true; +} + +export function BankAccountCredentialsFromJSON(json: any): BankAccountCredentials { + return BankAccountCredentialsFromJSONTyped(json, false); +} + +export function BankAccountCredentialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountCredentials { + if (json == null) { + return json; + } + return { + + 'username': json['username'] == null ? undefined : json['username'], + 'password': json['password'] == null ? undefined : json['password'], + }; +} + +export function BankAccountCredentialsToJSON(json: any): BankAccountCredentials { + return BankAccountCredentialsToJSONTyped(json, false); +} + +export function BankAccountCredentialsToJSONTyped(value?: BankAccountCredentials | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'username': value['username'], + 'password': value['password'], + }; +} + + +export interface CredentialsGenerateResponseBankAccountCredentials { + /** + * Username used by the bank feeds platform to retrieve transactions + * @type {string} + * @memberof BankAccountCredentials + */ + username?: string; + /** + * Password to enable the bank feeds platform to securely retrieve transactions. + * @type {string} + * @memberof BankAccountCredentials + */ + password?: string; +} + +export interface GenerateCredentialsResponseBankAccountCredentials { + /** + * Username used by the bank feeds platform to retrieve transactions + * @type {string} + * @memberof BankAccountCredentials + */ + username?: string; + /** + * Password to enable the bank feeds platform to securely retrieve transactions. + * @type {string} + * @memberof BankAccountCredentials + */ + password?: string; } diff --git a/bank-feeds/src/sdk/models/shared/bankaccountprototype.ts b/bank-feeds/src/sdk/models/shared/bankaccountprototype.ts index 550cf21be..dea6c4e7a 100644 --- a/bank-feeds/src/sdk/models/shared/bankaccountprototype.ts +++ b/bank-feeds/src/sdk/models/shared/bankaccountprototype.ts @@ -1,173 +1,1040 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; +import type { BankAccountType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BankAccountStatus } from './bankaccountstatus'; import { - BankAccountStatus, - BankAccountStatus$outboundSchema, -} from "./bankaccountstatus.js"; + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './bankaccountstatus'; /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * + * @export + * @interface BankAccountPrototype + */ +export interface BankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + + +/** + * @export */ -export const BankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", +export const BankAccountPrototypeAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' } as const; +export type BankAccountPrototypeAccountTypeEnum = typeof BankAccountPrototypeAccountTypeEnum[keyof typeof BankAccountPrototypeAccountTypeEnum]; + + /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * Check if a given object implements the BankAccountPrototype interface. */ -export type BankAccountType = ClosedEnum; - -export type BankAccountPrototype = { - /** - * Name of the bank account in the accounting software. - */ - accountName?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountType | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * Xero integrations - * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. - */ - sortCode?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * Xero integrations - * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. - * - * FreeAgent integrations - * For Credit accounts, only the last four digits are required. For other types, the field is optional. - */ - accountNumber?: string | null | undefined; - /** - * International bank account number of the account. Often used when making or receiving international payments. - */ - iBan?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Balance of the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The institution of the bank account. - */ - institution?: string | null | undefined; - /** - * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. - */ - availableBalance?: Decimal$ | number | null | undefined; - /** - * Pre-arranged overdraft limit of the account. - * - * @remarks - * - * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. - */ - overdraftLimit?: Decimal$ | number | null | undefined; - /** - * Status of the bank account. - */ - status?: BankAccountStatus | undefined; -}; - -/** @internal */ -export const BankAccountType$outboundSchema: z.ZodNativeEnum< - typeof BankAccountType -> = z.nativeEnum(BankAccountType); - -/** @internal */ -export type BankAccountPrototype$Outbound = { - accountName?: string | null | undefined; - accountType?: string | undefined; - nominalCode?: string | null | undefined; - sortCode?: string | null | undefined; - accountNumber?: string | null | undefined; - iBan?: string | null | undefined; - currency?: string | undefined; - balance?: number | null | undefined; - institution?: string | null | undefined; - availableBalance?: number | null | undefined; - overdraftLimit?: number | null | undefined; - status?: string | undefined; -}; - -/** @internal */ -export const BankAccountPrototype$outboundSchema: z.ZodType< - BankAccountPrototype$Outbound, - z.ZodTypeDef, - BankAccountPrototype -> = z.object({ - accountName: z.nullable(z.string()).optional(), - accountType: BankAccountType$outboundSchema.optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - iBan: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - institution: z.nullable(z.string()).optional(), - availableBalance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - overdraftLimit: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - status: BankAccountStatus$outboundSchema.optional(), -}); - -export function bankAccountPrototypeToJSON( - bankAccountPrototype: BankAccountPrototype, -): string { - return JSON.stringify( - BankAccountPrototype$outboundSchema.parse(bankAccountPrototype), - ); +export function instanceOfBankAccountPrototype(value: object): value is BankAccountPrototype { + return true; +} + +export function BankAccountPrototypeFromJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeFromJSONTyped(json, false); +} + +export function BankAccountPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountPrototype { + if (json == null) { + return json; + } + return { + + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + }; +} + +export function BankAccountPrototypeToJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeToJSONTyped(json, false); +} + +export function BankAccountPrototypeToJSONTyped(value?: BankAccountPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + }; +} + + +export interface AccountingBankAccountsBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountCreateRequestBody { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountCreateResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountsBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountsListResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountRequestBody { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface ListBankAccountsResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; } diff --git a/bank-feeds/src/sdk/models/shared/bankaccounts.ts b/bank-feeds/src/sdk/models/shared/bankaccounts.ts index 06555a9c9..a92337369 100644 --- a/bank-feeds/src/sdk/models/shared/bankaccounts.ts +++ b/bank-feeds/src/sdk/models/shared/bankaccounts.ts @@ -1,296 +1,314 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - BankAccountStatus, - BankAccountStatus$inboundSchema, -} from "./bankaccountstatus.js"; -import { Links, Links$inboundSchema } from "./links.js"; - +/* tslint:disable */ +/* eslint-disable */ /** - * The type of transactions and balances on the account. + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ -export const BankAccountsBankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", -} as const; -/** - * The type of transactions and balances on the account. + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -export type BankAccountsBankAccountType = ClosedEnum< - typeof BankAccountsBankAccountType ->; -export type Metadata = { - /** - * Indicates whether the record has been deleted in the third-party system this record originated from. - */ - isDeleted?: boolean | null | undefined; -}; +import { mapValues } from '../../../runtime'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; +import type { AccountingBankAccount } from './accountingbankaccount'; +import { + AccountingBankAccountFromJSON, + AccountingBankAccountFromJSONTyped, + AccountingBankAccountToJSON, + AccountingBankAccountToJSONTyped, +} from './accountingbankaccount'; /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + * + * @export + * @interface BankAccounts */ -export type SupplementalData = { - content?: { [k: string]: { [k: string]: any } } | null | undefined; -}; +export interface BankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; +} /** - * > **Accessing Bank Accounts through Banking API** - * - * @remarks - * > - * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. - * > - * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type. - * - * ## Overview - * - * A list of bank accounts associated with a company and a specific data connection. - * - * Bank accounts data includes: - * * The name and ID of the account in the accounting software. - * * The currency and balance of the account. - * * The sort code and account number. + * Check if a given object implements the BankAccounts interface. */ -export type AccountingBankAccount = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the bank account in the accounting software. - */ - accountName?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountsBankAccountType | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * Xero integrations - * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. - */ - sortCode?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * Xero integrations - * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. - * - * FreeAgent integrations - * For Credit accounts, only the last four digits are required. For other types, the field is optional. - */ - accountNumber?: string | null | undefined; - /** - * International bank account number of the account. Often used when making or receiving international payments. - */ - iBan?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Balance of the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The institution of the bank account. - */ - institution?: string | null | undefined; - /** - * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. - */ - availableBalance?: Decimal$ | number | null | undefined; - /** - * Pre-arranged overdraft limit of the account. - * - * @remarks - * - * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. - */ - overdraftLimit?: Decimal$ | number | null | undefined; - /** - * Status of the bank account. - */ - status?: BankAccountStatus | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - */ - supplementalData?: SupplementalData | undefined; -}; +export function instanceOfBankAccounts(value: object): value is BankAccounts { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function BankAccountsFromJSON(json: any): BankAccounts { + return BankAccountsFromJSONTyped(json, false); +} -export type BankAccounts = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; +export function BankAccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccounts { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(AccountingBankAccountFromJSON)), + }; +} -/** @internal */ -export const BankAccountsBankAccountType$inboundSchema: z.ZodNativeEnum< - typeof BankAccountsBankAccountType -> = z.nativeEnum(BankAccountsBankAccountType); +export function BankAccountsToJSON(json: any): BankAccounts { + return BankAccountsToJSONTyped(json, false); +} -/** @internal */ -export const Metadata$inboundSchema: z.ZodType< - Metadata, - z.ZodTypeDef, - unknown -> = z.object({ - isDeleted: z.nullable(z.boolean()).optional(), -}); +export function BankAccountsToJSONTyped(value?: BankAccounts | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function metadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Metadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Metadata' from JSON`, - ); + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(AccountingBankAccountToJSON)), + }; } -/** @internal */ -export const SupplementalData$inboundSchema: z.ZodType< - SupplementalData, - z.ZodTypeDef, - unknown -> = z.object({ - content: z.nullable(z.record(z.record(z.any()))).optional(), -}); -export function supplementalDataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupplementalData$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplementalData' from JSON`, - ); +export interface AccountingBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; +} + +export interface BankAccountsAccountingBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; } -/** @internal */ -export const AccountingBankAccount$inboundSchema: z.ZodType< - AccountingBankAccount, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - accountName: z.nullable(z.string()).optional(), - accountType: BankAccountsBankAccountType$inboundSchema.optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - iBan: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - institution: z.nullable(z.string()).optional(), - availableBalance: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - overdraftLimit: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - status: BankAccountStatus$inboundSchema.optional(), - metadata: z.lazy(() => Metadata$inboundSchema).optional(), - supplementalData: z.lazy(() => SupplementalData$inboundSchema).optional(), -}); +export interface BankAccountsListResponseAccountingBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; +} -export function accountingBankAccountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingBankAccount$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingBankAccount' from JSON`, - ); +export interface BankAccountsListResponseBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; } -/** @internal */ -export const BankAccounts$inboundSchema: z.ZodType< - BankAccounts, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array( - z.nullable(z.lazy(() => AccountingBankAccount$inboundSchema)), - ).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); +export interface ListBankAccountsResponseAccountingBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; +} -export function bankAccountsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccounts$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccounts' from JSON`, - ); +export interface ListBankAccountsResponseBankAccounts { + /** + * Current page number. + * @type {number} + * @memberof BankAccounts + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof BankAccounts + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof BankAccounts + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof BankAccounts + */ + links: Links; + /** + * + * @type {Array} + * @memberof BankAccounts + */ + results?: Array; } diff --git a/bank-feeds/src/sdk/models/shared/bankaccountstatus.ts b/bank-feeds/src/sdk/models/shared/bankaccountstatus.ts index bca71b030..1239f29d3 100644 --- a/bank-feeds/src/sdk/models/shared/bankaccountstatus.ts +++ b/bank-feeds/src/sdk/models/shared/bankaccountstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the bank account. + * @export */ export const BankAccountStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", - Pending: "Pending", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived', + Pending: 'Pending' } as const; -/** - * Status of the bank account. - */ -export type BankAccountStatus = ClosedEnum; - -/** @internal */ -export const BankAccountStatus$inboundSchema: z.ZodNativeEnum< - typeof BankAccountStatus -> = z.nativeEnum(BankAccountStatus); -/** @internal */ -export const BankAccountStatus$outboundSchema: z.ZodNativeEnum< - typeof BankAccountStatus -> = BankAccountStatus$inboundSchema; +export type BankAccountStatus = typeof BankAccountStatus[keyof typeof BankAccountStatus]; + + +export function instanceOfBankAccountStatus(value: any): boolean { + for (const key in BankAccountStatus) { + if (Object.prototype.hasOwnProperty.call(BankAccountStatus, key)) { + if (BankAccountStatus[key as keyof typeof BankAccountStatus] === value) { + return true; + } + } + } + return false; +} + +export function BankAccountStatusFromJSON(json: any): BankAccountStatus { + return BankAccountStatusFromJSONTyped(json, false); +} + +export function BankAccountStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountStatus { + return json as BankAccountStatus; +} + +export function BankAccountStatusToJSON(value?: BankAccountStatus | null): any { + return value as any; +} + +export function BankAccountStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): BankAccountStatus { + return value as BankAccountStatus; +} + diff --git a/bank-feeds/src/sdk/models/shared/bankfeedaccountmapping.ts b/bank-feeds/src/sdk/models/shared/bankfeedaccountmapping.ts index f6c18e8b1..770f16dc1 100644 --- a/bank-feeds/src/sdk/models/shared/bankfeedaccountmapping.ts +++ b/bank-feeds/src/sdk/models/shared/bankfeedaccountmapping.ts @@ -1,64 +1,223 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface BankFeedAccountMapping + */ +export interface BankFeedAccountMapping { + [key: string]: any | any; + /** + * Unique ID for the source account + * @type {string} + * @memberof BankFeedAccountMapping + */ + sourceAccountId: string; + /** + * Unique ID for the target account + * @type {string} + * @memberof BankFeedAccountMapping + */ + targetAccountId?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedAccountMapping + */ + feedStartDate?: string; +} + +/** + * Check if a given object implements the BankFeedAccountMapping interface. + */ +export function instanceOfBankFeedAccountMapping(value: object): value is BankFeedAccountMapping { + if (!('sourceAccountId' in value) || value['sourceAccountId'] === undefined) return false; + return true; +} + +export function BankFeedAccountMappingFromJSON(json: any): BankFeedAccountMapping { + return BankFeedAccountMappingFromJSONTyped(json, false); +} + +export function BankFeedAccountMappingFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankFeedAccountMapping { + if (json == null) { + return json; + } + return { + + ...json, + 'sourceAccountId': json['sourceAccountId'], + 'targetAccountId': json['targetAccountId'] == null ? undefined : json['targetAccountId'], + 'feedStartDate': json['feedStartDate'] == null ? undefined : json['feedStartDate'], + }; +} + +export function BankFeedAccountMappingToJSON(json: any): BankFeedAccountMapping { + return BankFeedAccountMappingToJSONTyped(json, false); +} + +export function BankFeedAccountMappingToJSONTyped(value?: BankFeedAccountMapping | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'sourceAccountId': value['sourceAccountId'], + 'targetAccountId': value['targetAccountId'], + 'feedStartDate': value['feedStartDate'], + }; +} -export type BankFeedAccountMapping = { - /** - * Unique ID for the source account - */ - sourceAccountId: string; - /** - * Unique ID for the target account - */ - targetAccountId?: string | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - feedStartDate?: string | undefined; -}; -/** @internal */ -export type BankFeedAccountMapping$Outbound = { - sourceAccountId: string; - targetAccountId?: string | null | undefined; - feedStartDate?: string | undefined; -}; +export interface BankAccountMappingCreateRequestBody { + [key: string]: any | any; + /** + * Unique ID for the source account + * @type {string} + * @memberof BankFeedAccountMapping + */ + sourceAccountId: string; + /** + * Unique ID for the target account + * @type {string} + * @memberof BankFeedAccountMapping + */ + targetAccountId?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedAccountMapping + */ + feedStartDate?: string; +} -/** @internal */ -export const BankFeedAccountMapping$outboundSchema: z.ZodType< - BankFeedAccountMapping$Outbound, - z.ZodTypeDef, - BankFeedAccountMapping -> = z.object({ - sourceAccountId: z.string(), - targetAccountId: z.nullable(z.string()).optional(), - feedStartDate: z.string().optional(), -}); +export interface CreateBankAccountMappingBankFeedAccountMapping { + [key: string]: any | any; + /** + * Unique ID for the source account + * @type {string} + * @memberof BankFeedAccountMapping + */ + sourceAccountId: string; + /** + * Unique ID for the target account + * @type {string} + * @memberof BankFeedAccountMapping + */ + targetAccountId?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedAccountMapping + */ + feedStartDate?: string; +} -export function bankFeedAccountMappingToJSON( - bankFeedAccountMapping: BankFeedAccountMapping, -): string { - return JSON.stringify( - BankFeedAccountMapping$outboundSchema.parse(bankFeedAccountMapping), - ); +export interface CreateBankAccountMappingRequestBody { + [key: string]: any | any; + /** + * Unique ID for the source account + * @type {string} + * @memberof BankFeedAccountMapping + */ + sourceAccountId: string; + /** + * Unique ID for the target account + * @type {string} + * @memberof BankFeedAccountMapping + */ + targetAccountId?: string | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedAccountMapping + */ + feedStartDate?: string; } diff --git a/bank-feeds/src/sdk/models/shared/bankfeedaccountmappingresponse.ts b/bank-feeds/src/sdk/models/shared/bankfeedaccountmappingresponse.ts index 5f2e99e25..643d3a32e 100644 --- a/bank-feeds/src/sdk/models/shared/bankfeedaccountmappingresponse.ts +++ b/bank-feeds/src/sdk/models/shared/bankfeedaccountmappingresponse.ts @@ -1,49 +1,148 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type BankFeedAccountMappingResponse = { - /** - * Unique ID for the source account. - */ - sourceAccountId?: string | undefined; - /** - * Unique ID for the target account. - */ - targetAccountId?: string | null | undefined; - /** - * Status of the POST request. - */ - status?: string | null | undefined; - /** - * Error returned during the post request - */ - error?: string | null | undefined; -}; - -/** @internal */ -export const BankFeedAccountMappingResponse$inboundSchema: z.ZodType< - BankFeedAccountMappingResponse, - z.ZodTypeDef, - unknown -> = z.object({ - sourceAccountId: z.string().optional(), - targetAccountId: z.nullable(z.string()).optional(), - status: z.nullable(z.string()).optional(), - error: z.nullable(z.string()).optional(), -}); - -export function bankFeedAccountMappingResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankFeedAccountMappingResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankFeedAccountMappingResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface BankFeedAccountMappingResponse + */ +export interface BankFeedAccountMappingResponse { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + sourceAccountId?: string; + /** + * Unique ID for the target account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + targetAccountId?: string | null; + /** + * Status of the POST request. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + status?: string | null; + /** + * Error returned during the post request + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + error?: string | null; +} + +/** + * Check if a given object implements the BankFeedAccountMappingResponse interface. + */ +export function instanceOfBankFeedAccountMappingResponse(value: object): value is BankFeedAccountMappingResponse { + return true; +} + +export function BankFeedAccountMappingResponseFromJSON(json: any): BankFeedAccountMappingResponse { + return BankFeedAccountMappingResponseFromJSONTyped(json, false); +} + +export function BankFeedAccountMappingResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankFeedAccountMappingResponse { + if (json == null) { + return json; + } + return { + + ...json, + 'sourceAccountId': json['sourceAccountId'] == null ? undefined : json['sourceAccountId'], + 'targetAccountId': json['targetAccountId'] == null ? undefined : json['targetAccountId'], + 'status': json['status'] == null ? undefined : json['status'], + 'error': json['error'] == null ? undefined : json['error'], + }; +} + +export function BankFeedAccountMappingResponseToJSON(json: any): BankFeedAccountMappingResponse { + return BankFeedAccountMappingResponseToJSONTyped(json, false); +} + +export function BankFeedAccountMappingResponseToJSONTyped(value?: BankFeedAccountMappingResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'sourceAccountId': value['sourceAccountId'], + 'targetAccountId': value['targetAccountId'], + 'status': value['status'], + 'error': value['error'], + }; +} + + +export interface BankAccountMappingCreateResponseBankFeedAccountMappingResponse { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + sourceAccountId?: string; + /** + * Unique ID for the target account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + targetAccountId?: string | null; + /** + * Status of the POST request. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + status?: string | null; + /** + * Error returned during the post request + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + error?: string | null; +} + +export interface CreateBankAccountMappingResponseBankFeedAccountMappingResponse { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + sourceAccountId?: string; + /** + * Unique ID for the target account. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + targetAccountId?: string | null; + /** + * Status of the POST request. + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + status?: string | null; + /** + * Error returned during the post request + * @type {string} + * @memberof BankFeedAccountMappingResponse + */ + error?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/bankfeedmapping.ts b/bank-feeds/src/sdk/models/shared/bankfeedmapping.ts index 07be2dcff..e0e42c386 100644 --- a/bank-feeds/src/sdk/models/shared/bankfeedmapping.ts +++ b/bank-feeds/src/sdk/models/shared/bankfeedmapping.ts @@ -1,114 +1,349 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { TargetAccountOption } from './targetaccountoption'; import { - TargetAccountOption, - TargetAccountOption$inboundSchema, -} from "./targetaccountoption.js"; + TargetAccountOptionFromJSON, + TargetAccountOptionFromJSONTyped, + TargetAccountOptionToJSON, + TargetAccountOptionToJSONTyped, +} from './targetaccountoption'; /** * A bank feed connection between a source account and a target account, including potential target accounts. + * @export + * @interface BankFeedMapping */ -export type BankFeedMapping = { - /** - * Unique ID for the source account. - */ - sourceAccountId?: string | undefined; - /** - * Name for the source account. - */ - sourceAccountName?: string | undefined; - /** - * Account number for the source account. - */ - sourceAccountNumber?: string | undefined; - /** - * Balance for the source account. - */ - sourceBalance?: Decimal$ | number | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - sourceCurrency?: string | undefined; - /** - * Unique ID for the target account in the accounting software. - */ - targetAccountId?: string | null | undefined; - /** - * Name for the target account in the accounting software. - */ - targetAccountName?: string | undefined; - /** - * The status. - */ - status?: string | undefined; - /** - * An array of potential target accounts. - */ - targetAccountOptions?: Array | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - feedStartDate?: string | undefined; -}; +export interface BankFeedMapping { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountId?: string; + /** + * Name for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountName?: string; + /** + * Account number for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountNumber?: string; + /** + * Balance for the source account. + * @type {number} + * @memberof BankFeedMapping + */ + sourceBalance?: Decimal | number; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankFeedMapping + */ + sourceCurrency?: string; + /** + * Unique ID for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountId?: string | null; + /** + * Name for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountName?: string; + /** + * The status. + * @type {string} + * @memberof BankFeedMapping + */ + status?: string; + /** + * An array of potential target accounts. + * @type {Array} + * @memberof BankFeedMapping + */ + targetAccountOptions?: Array | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedMapping + */ + feedStartDate?: string; +} -/** @internal */ -export const BankFeedMapping$inboundSchema: z.ZodType< - BankFeedMapping, - z.ZodTypeDef, - unknown -> = z.object({ - sourceAccountId: z.string().optional(), - sourceAccountName: z.string().optional(), - sourceAccountNumber: z.string().optional(), - sourceBalance: z.number().transform(v => new Decimal$(v)).optional(), - sourceCurrency: z.string().optional(), - targetAccountId: z.nullable(z.string()).optional(), - targetAccountName: z.string().optional(), - status: z.string().optional(), - targetAccountOptions: z.nullable(z.array(TargetAccountOption$inboundSchema)) - .optional(), - feedStartDate: z.string().optional(), -}); +/** + * Check if a given object implements the BankFeedMapping interface. + */ +export function instanceOfBankFeedMapping(value: object): value is BankFeedMapping { + return true; +} + +export function BankFeedMappingFromJSON(json: any): BankFeedMapping { + return BankFeedMappingFromJSONTyped(json, false); +} + +export function BankFeedMappingFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankFeedMapping { + if (json == null) { + return json; + } + return { + + ...json, + 'sourceAccountId': json['sourceAccountId'] == null ? undefined : json['sourceAccountId'], + 'sourceAccountName': json['sourceAccountName'] == null ? undefined : json['sourceAccountName'], + 'sourceAccountNumber': json['sourceAccountNumber'] == null ? undefined : json['sourceAccountNumber'], + 'sourceBalance': json['sourceBalance'] == null ? undefined : toDecimal(json['sourceBalance']), + 'sourceCurrency': json['sourceCurrency'] == null ? undefined : json['sourceCurrency'], + 'targetAccountId': json['targetAccountId'] == null ? undefined : json['targetAccountId'], + 'targetAccountName': json['targetAccountName'] == null ? undefined : json['targetAccountName'], + 'status': json['status'] == null ? undefined : json['status'], + 'targetAccountOptions': json['targetAccountOptions'] == null ? undefined : ((json['targetAccountOptions'] as Array).map(TargetAccountOptionFromJSON)), + 'feedStartDate': json['feedStartDate'] == null ? undefined : json['feedStartDate'], + }; +} + +export function BankFeedMappingToJSON(json: any): BankFeedMapping { + return BankFeedMappingToJSONTyped(json, false); +} + +export function BankFeedMappingToJSONTyped(value?: BankFeedMapping | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'sourceAccountId': value['sourceAccountId'], + 'sourceAccountName': value['sourceAccountName'], + 'sourceAccountNumber': value['sourceAccountNumber'], + 'sourceBalance': fromDecimal(value['sourceBalance']), + 'sourceCurrency': value['sourceCurrency'], + 'targetAccountId': value['targetAccountId'], + 'targetAccountName': value['targetAccountName'], + 'status': value['status'], + 'targetAccountOptions': value['targetAccountOptions'] == null ? undefined : ((value['targetAccountOptions'] as Array).map(TargetAccountOptionToJSON)), + 'feedStartDate': value['feedStartDate'], + }; +} + + +export interface BankAccountMappingGetResponseBankFeedMapping { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountId?: string; + /** + * Name for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountName?: string; + /** + * Account number for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountNumber?: string; + /** + * Balance for the source account. + * @type {number} + * @memberof BankFeedMapping + */ + sourceBalance?: Decimal | number; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankFeedMapping + */ + sourceCurrency?: string; + /** + * Unique ID for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountId?: string | null; + /** + * Name for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountName?: string; + /** + * The status. + * @type {string} + * @memberof BankFeedMapping + */ + status?: string; + /** + * An array of potential target accounts. + * @type {Array} + * @memberof BankFeedMapping + */ + targetAccountOptions?: Array | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedMapping + */ + feedStartDate?: string; +} -export function bankFeedMappingFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankFeedMapping$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankFeedMapping' from JSON`, - ); +export interface GetBankAccountMappingResponseBankFeedMapping { + [key: string]: any | any; + /** + * Unique ID for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountId?: string; + /** + * Name for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountName?: string; + /** + * Account number for the source account. + * @type {string} + * @memberof BankFeedMapping + */ + sourceAccountNumber?: string; + /** + * Balance for the source account. + * @type {number} + * @memberof BankFeedMapping + */ + sourceBalance?: Decimal | number; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof BankFeedMapping + */ + sourceCurrency?: string; + /** + * Unique ID for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountId?: string | null; + /** + * Name for the target account in the accounting software. + * @type {string} + * @memberof BankFeedMapping + */ + targetAccountName?: string; + /** + * The status. + * @type {string} + * @memberof BankFeedMapping + */ + status?: string; + /** + * An array of potential target accounts. + * @type {Array} + * @memberof BankFeedMapping + */ + targetAccountOptions?: Array | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof BankFeedMapping + */ + feedStartDate?: string; } diff --git a/bank-feeds/src/sdk/models/shared/banktransactions.ts b/bank-feeds/src/sdk/models/shared/banktransactions.ts deleted file mode 100644 index 2b4d9da51..000000000 --- a/bank-feeds/src/sdk/models/shared/banktransactions.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -/** - * Type of transaction for the bank statement line. - */ -export const BankTransactionType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", - Int: "Int", - Div: "Div", - Fee: "Fee", - SerChg: "SerChg", - Dep: "Dep", - Atm: "Atm", - Pos: "Pos", - Xfer: "Xfer", - Check: "Check", - Payment: "Payment", - Cash: "Cash", - DirectDep: "DirectDep", - DirectDebit: "DirectDebit", - RepeatPmt: "RepeatPmt", - Other: "Other", -} as const; -/** - * Type of transaction for the bank statement line. - */ -export type BankTransactionType = ClosedEnum; - -export type BankTransactions = { - /** - * Identifier for the bank account transaction, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2023-08-22T10:21:00 - * 2023-08-22 - * ``` - * - * When pushing bank transaction data to Codat, the date is treated as a local date. This means: - * - * - The date/time is used exactly as provided, without any timezone conversion. - * - If a timezone offset is included (e.g., `2023-08-22T10:21:00-05:00`), the offset will be ignored and only the local date/time portion will be used. - * - We recommend providing dates without a timezone suffix for clarity (e.g., `2023-08-22T10:21:00` rather than `2023-08-22T10:21:00Z`). - */ - date?: string | undefined; - /** - * Description of the bank transaction. - */ - description?: string | null | undefined; - /** - * The giving or receiving party such as a person or organization. - */ - counterparty?: string | null | undefined; - /** - * An optional reference to the bank transaction. - */ - reference?: string | null | undefined; - /** - * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. - */ - reconciled?: boolean | null | undefined; - /** - * The amount transacted in the bank transaction. - */ - amount?: Decimal$ | number | undefined; - /** - * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. - */ - balance?: Decimal$ | number | undefined; - /** - * Type of transaction for the bank statement line. - */ - transactionType?: BankTransactionType | null | undefined; -}; - -/** @internal */ -export const BankTransactionType$inboundSchema: z.ZodNativeEnum< - typeof BankTransactionType -> = z.nativeEnum(BankTransactionType); -/** @internal */ -export const BankTransactionType$outboundSchema: z.ZodNativeEnum< - typeof BankTransactionType -> = BankTransactionType$inboundSchema; - -/** @internal */ -export const BankTransactions$inboundSchema: z.ZodType< - BankTransactions, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - date: z.string().optional(), - description: z.nullable(z.string()).optional(), - counterparty: z.nullable(z.string()).optional(), - reference: z.nullable(z.string()).optional(), - reconciled: z.nullable(z.boolean()).optional(), - amount: z.number().transform(v => new Decimal$(v)).optional(), - balance: z.number().transform(v => new Decimal$(v)).optional(), - transactionType: z.nullable(BankTransactionType$inboundSchema).optional(), -}); -/** @internal */ -export type BankTransactions$Outbound = { - id?: string | undefined; - date?: string | undefined; - description?: string | null | undefined; - counterparty?: string | null | undefined; - reference?: string | null | undefined; - reconciled?: boolean | null | undefined; - amount?: number | undefined; - balance?: number | undefined; - transactionType?: string | null | undefined; -}; - -/** @internal */ -export const BankTransactions$outboundSchema: z.ZodType< - BankTransactions$Outbound, - z.ZodTypeDef, - BankTransactions -> = z.object({ - id: z.string().optional(), - date: z.string().optional(), - description: z.nullable(z.string()).optional(), - counterparty: z.nullable(z.string()).optional(), - reference: z.nullable(z.string()).optional(), - reconciled: z.nullable(z.boolean()).optional(), - amount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - balance: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - transactionType: z.nullable(BankTransactionType$outboundSchema).optional(), -}); - -export function bankTransactionsToJSON( - bankTransactions: BankTransactions, -): string { - return JSON.stringify( - BankTransactions$outboundSchema.parse(bankTransactions), - ); -} -export function bankTransactionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankTransactions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankTransactions' from JSON`, - ); -} diff --git a/bank-feeds/src/sdk/models/shared/clientratelimitwebhook.ts b/bank-feeds/src/sdk/models/shared/clientratelimitwebhook.ts index cdc40c0b8..42860ac6a 100644 --- a/bank-feeds/src/sdk/models/shared/clientratelimitwebhook.ts +++ b/bank-feeds/src/sdk/models/shared/clientratelimitwebhook.ts @@ -1,96 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ClientRateLimitWebhookPayload } from './clientratelimitwebhookpayload'; import { - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayload$inboundSchema, - ClientRateLimitWebhookPayload$Outbound, - ClientRateLimitWebhookPayload$outboundSchema, -} from "./clientratelimitwebhookpayload.js"; + ClientRateLimitWebhookPayloadFromJSON, + ClientRateLimitWebhookPayloadFromJSONTyped, + ClientRateLimitWebhookPayloadToJSON, + ClientRateLimitWebhookPayloadToJSONTyped, +} from './clientratelimitwebhookpayload'; -export type ClientRateLimitWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload | undefined; -}; +/** + * + * @export + * @interface ClientRateLimitWebhook + */ +export interface ClientRateLimitWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + eventType?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + generatedDate?: string; + /** + * + * @type {ClientRateLimitWebhookPayload} + * @memberof ClientRateLimitWebhook + */ + payload?: ClientRateLimitWebhookPayload; +} + +/** + * Check if a given object implements the ClientRateLimitWebhook interface. + */ +export function instanceOfClientRateLimitWebhook(value: object): value is ClientRateLimitWebhook { + return true; +} -/** @internal */ -export const ClientRateLimitWebhook$inboundSchema: z.ZodType< - ClientRateLimitWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ClientRateLimitWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload$Outbound | undefined; -}; +export function ClientRateLimitWebhookFromJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhook$outboundSchema: z.ZodType< - ClientRateLimitWebhook$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$outboundSchema.optional(), -}); +export function ClientRateLimitWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ClientRateLimitWebhookPayloadFromJSON(json['payload']), + }; +} -export function clientRateLimitWebhookToJSON( - clientRateLimitWebhook: ClientRateLimitWebhook, -): string { - return JSON.stringify( - ClientRateLimitWebhook$outboundSchema.parse(clientRateLimitWebhook), - ); +export function ClientRateLimitWebhookToJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookToJSONTyped(json, false); } -export function clientRateLimitWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhook' from JSON`, - ); + +export function ClientRateLimitWebhookToJSONTyped(value?: ClientRateLimitWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ClientRateLimitWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/bank-feeds/src/sdk/models/shared/clientratelimitwebhookpayload.ts b/bank-feeds/src/sdk/models/shared/clientratelimitwebhookpayload.ts index 72605d624..3d93880e5 100644 --- a/bank-feeds/src/sdk/models/shared/clientratelimitwebhookpayload.ts +++ b/bank-feeds/src/sdk/models/shared/clientratelimitwebhookpayload.ts @@ -1,88 +1,138 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ClientRateLimitWebhookPayload + */ +export interface ClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; +} -export type ClientRateLimitWebhookPayload = { - /** - * The number of available requests per day. - */ - dailyQuota?: number | undefined; - /** - * Total number of requests remaining for your client. - */ - quotaRemaining?: number | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - expiryDate?: string | undefined; -}; +/** + * Check if a given object implements the ClientRateLimitWebhookPayload interface. + */ +export function instanceOfClientRateLimitWebhookPayload(value: object): value is ClientRateLimitWebhookPayload { + return true; +} -/** @internal */ -export const ClientRateLimitWebhookPayload$inboundSchema: z.ZodType< - ClientRateLimitWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); -/** @internal */ -export type ClientRateLimitWebhookPayload$Outbound = { - dailyQuota?: number | undefined; - quotaRemaining?: number | undefined; - expiryDate?: string | undefined; -}; +export function ClientRateLimitWebhookPayloadFromJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhookPayload$outboundSchema: z.ZodType< - ClientRateLimitWebhookPayload$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhookPayload -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); +export function ClientRateLimitWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhookPayload { + if (json == null) { + return json; + } + return { + + 'dailyQuota': json['dailyQuota'] == null ? undefined : json['dailyQuota'], + 'quotaRemaining': json['quotaRemaining'] == null ? undefined : json['quotaRemaining'], + 'expiryDate': json['expiryDate'] == null ? undefined : json['expiryDate'], + }; +} -export function clientRateLimitWebhookPayloadToJSON( - clientRateLimitWebhookPayload: ClientRateLimitWebhookPayload, -): string { - return JSON.stringify( - ClientRateLimitWebhookPayload$outboundSchema.parse( - clientRateLimitWebhookPayload, - ), - ); +export function ClientRateLimitWebhookPayloadToJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadToJSONTyped(json, false); } -export function clientRateLimitWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhookPayload' from JSON`, - ); + +export function ClientRateLimitWebhookPayloadToJSONTyped(value?: ClientRateLimitWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dailyQuota': value['dailyQuota'], + 'quotaRemaining': value['quotaRemaining'], + 'expiryDate': value['expiryDate'], + }; +} + + +export interface ClientRateLimitWebhookClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; } diff --git a/bank-feeds/src/sdk/models/shared/companies.ts b/bank-feeds/src/sdk/models/shared/companies.ts index 0f308542e..74838e3ed 100644 --- a/bank-feeds/src/sdk/models/shared/companies.ts +++ b/bank-feeds/src/sdk/models/shared/companies.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Company, Company$inboundSchema } from "./company.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Companies = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Companies$inboundSchema: z.ZodType< - Companies, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Company$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function companiesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Companies$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Companies' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Company } from './company'; +import { + CompanyFromJSON, + CompanyFromJSONTyped, + CompanyToJSON, + CompanyToJSONTyped, +} from './company'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Companies + */ +export interface Companies { + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; +} + +/** + * Check if a given object implements the Companies interface. + */ +export function instanceOfCompanies(value: object): value is Companies { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function CompaniesFromJSON(json: any): Companies { + return CompaniesFromJSONTyped(json, false); +} + +export function CompaniesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Companies { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CompanyFromJSON)), + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + }; +} + +export function CompaniesToJSON(json: any): Companies { + return CompaniesToJSONTyped(json, false); +} + +export function CompaniesToJSONTyped(value?: Companies | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CompanyToJSON)), + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + }; +} + + +export interface CompaniesListResponseCompanies { + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; +} + +export interface ListCompaniesResponseCompanies { + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; } diff --git a/bank-feeds/src/sdk/models/shared/company.ts b/bank-feeds/src/sdk/models/shared/company.ts index 945f5eb66..100f881b5 100644 --- a/bank-feeds/src/sdk/models/shared/company.ts +++ b/bank-feeds/src/sdk/models/shared/company.ts @@ -1,131 +1,1432 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, -} from "./companyreference.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; /** - * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - * - * @remarks - * + * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + * * Typically each company is one of your customers. - * + * * When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + * @export + * @interface Company + */ +export interface Company { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +/** + * Check if a given object implements the Company interface. */ -export type Company = { - /** - * Unique identifier for your SMB in Codat. - */ - id: string; - /** - * The name of the company - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. - */ - redirect: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSync?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - created?: string | undefined; - /** - * Name of user that created the company in Codat. - */ - createdByUserName?: string | null | undefined; - /** - * An array of products that are currently enabled for the company. - */ - products?: Array | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; - referenceParentCompany?: CompanyReference | undefined; - /** - * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. - */ - referenceSubsidiaryCompanies?: Array | undefined; - dataConnections?: Array | undefined; -}; - -/** @internal */ -export const Company$inboundSchema: z.ZodType = - z.object({ - id: z.string(), - name: z.string(), - description: z.string().optional(), - redirect: z.string(), - lastSync: z.string().optional(), - created: z.string().optional(), - createdByUserName: z.nullable(z.string()).optional(), - products: z.array(z.string()).optional(), - tags: z.record(z.string()).optional(), - referenceParentCompany: CompanyReference$inboundSchema.optional(), - referenceSubsidiaryCompanies: z.array(CompanyReference$inboundSchema) - .optional(), - dataConnections: z.array(Connection$inboundSchema).optional(), - }); - -export function companyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Company$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Company' from JSON`, - ); +export function instanceOfCompany(value: object): value is Company { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyFromJSON(json: any): Company { + return CompanyFromJSONTyped(json, false); +} + +export function CompanyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Company { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + 'dataConnections': json['dataConnections'] == null ? undefined : ((json['dataConnections'] as Array).map(ConnectionFromJSON)), + }; +} + +export function CompanyToJSON(json: any): Company { + return CompanyToJSONTyped(json, false); +} + +export function CompanyToJSONTyped(value?: Company | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + 'dataConnections': value['dataConnections'] == null ? undefined : ((value['dataConnections'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface CompaniesCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompaniesListResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyCreateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyGetResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyReplaceResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyUpdateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CreateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface GetCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ListCompaniesResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ReplaceCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface UpdateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; } diff --git a/bank-feeds/src/sdk/models/shared/companyaccesstoken.ts b/bank-feeds/src/sdk/models/shared/companyaccesstoken.ts index 456b27496..957425ce3 100644 --- a/bank-feeds/src/sdk/models/shared/companyaccesstoken.ts +++ b/bank-feeds/src/sdk/models/shared/companyaccesstoken.ts @@ -1,47 +1,126 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Details of the access token provisioned for a company. + * @export + * @interface CompanyAccessToken + */ +export interface CompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; +} + +/** + * Check if a given object implements the CompanyAccessToken interface. */ -export type CompanyAccessToken = { - /** - * The number of seconds until the access token expires. - */ - expiresIn: number; - /** - * The access token for the company. - */ - accessToken: string; - /** - * The type of token. - */ - tokenType: string; -}; - -/** @internal */ -export const CompanyAccessToken$inboundSchema: z.ZodType< - CompanyAccessToken, - z.ZodTypeDef, - unknown -> = z.object({ - expiresIn: z.number().int(), - accessToken: z.string(), - tokenType: z.string(), -}); - -export function companyAccessTokenFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyAccessToken$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyAccessToken' from JSON`, - ); +export function instanceOfCompanyAccessToken(value: object): value is CompanyAccessToken { + if (!('expiresIn' in value) || value['expiresIn'] === undefined) return false; + if (!('accessToken' in value) || value['accessToken'] === undefined) return false; + if (!('tokenType' in value) || value['tokenType'] === undefined) return false; + return true; +} + +export function CompanyAccessTokenFromJSON(json: any): CompanyAccessToken { + return CompanyAccessTokenFromJSONTyped(json, false); +} + +export function CompanyAccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyAccessToken { + if (json == null) { + return json; + } + return { + + 'expiresIn': json['expiresIn'], + 'accessToken': json['accessToken'], + 'tokenType': json['tokenType'], + }; +} + +export function CompanyAccessTokenToJSON(json: any): CompanyAccessToken { + return CompanyAccessTokenToJSONTyped(json, false); +} + +export function CompanyAccessTokenToJSONTyped(value?: CompanyAccessToken | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'expiresIn': value['expiresIn'], + 'accessToken': value['accessToken'], + 'tokenType': value['tokenType'], + }; +} + + +export interface CompanyAccessTokenGetResponseCompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; +} + +export interface GetCompanyAccessTokenResponseCompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; } diff --git a/bank-feeds/src/sdk/models/shared/companyinformation.ts b/bank-feeds/src/sdk/models/shared/companyinformation.ts index 9efea464c..b284608b5 100644 --- a/bank-feeds/src/sdk/models/shared/companyinformation.ts +++ b/bank-feeds/src/sdk/models/shared/companyinformation.ts @@ -1,57 +1,163 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Information about the company from the underlying accounting software. + * @export + * @interface CompanyInformation + */ +export interface CompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string; + /** + * Currency set in the accounting software of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string; + /** + * Accounting software subscription type such as Trial, Demo, Standard. + * @type {string} + * @memberof CompanyInformation + */ + planType?: string | null; + /** + * Boolean showing if the organisation has multicurrency enabled. + * @type {boolean} + * @memberof CompanyInformation + */ + multicurrencyEnabled?: boolean; + /** + * Array of enabled currencies for the linked company. + * @type {Array} + * @memberof CompanyInformation + */ + currencies?: Array | null; +} + +/** + * Check if a given object implements the CompanyInformation interface. */ -export type CompanyInformation = { - /** - * Name of the linked company. - */ - companyName?: string | undefined; - /** - * Currency set in the accounting software of the linked company. - */ - baseCurrency?: string | undefined; - /** - * Accounting software subscription type such as Trial, Demo, Standard. - */ - planType?: string | null | undefined; - /** - * Boolean showing if the organisation has multicurrency enabled. - */ - multicurrencyEnabled?: boolean | undefined; - /** - * Array of enabled currencies for the linked company. - */ - currencies?: Array | null | undefined; -}; - -/** @internal */ -export const CompanyInformation$inboundSchema: z.ZodType< - CompanyInformation, - z.ZodTypeDef, - unknown -> = z.object({ - companyName: z.string().optional(), - baseCurrency: z.string().optional(), - planType: z.nullable(z.string()).optional(), - multicurrencyEnabled: z.boolean().optional(), - currencies: z.nullable(z.array(z.string())).optional(), -}); - -export function companyInformationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyInformation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyInformation' from JSON`, - ); +export function instanceOfCompanyInformation(value: object): value is CompanyInformation { + return true; +} + +export function CompanyInformationFromJSON(json: any): CompanyInformation { + return CompanyInformationFromJSONTyped(json, false); +} + +export function CompanyInformationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyInformation { + if (json == null) { + return json; + } + return { + + 'companyName': json['companyName'] == null ? undefined : json['companyName'], + 'baseCurrency': json['baseCurrency'] == null ? undefined : json['baseCurrency'], + 'planType': json['planType'] == null ? undefined : json['planType'], + 'multicurrencyEnabled': json['multicurrencyEnabled'] == null ? undefined : json['multicurrencyEnabled'], + 'currencies': json['currencies'] == null ? undefined : json['currencies'], + }; +} + +export function CompanyInformationToJSON(json: any): CompanyInformation { + return CompanyInformationToJSONTyped(json, false); +} + +export function CompanyInformationToJSONTyped(value?: CompanyInformation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyName': value['companyName'], + 'baseCurrency': value['baseCurrency'], + 'planType': value['planType'], + 'multicurrencyEnabled': value['multicurrencyEnabled'], + 'currencies': value['currencies'], + }; +} + + +export interface CompanyInformationGetResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string; + /** + * Currency set in the accounting software of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string; + /** + * Accounting software subscription type such as Trial, Demo, Standard. + * @type {string} + * @memberof CompanyInformation + */ + planType?: string | null; + /** + * Boolean showing if the organisation has multicurrency enabled. + * @type {boolean} + * @memberof CompanyInformation + */ + multicurrencyEnabled?: boolean; + /** + * Array of enabled currencies for the linked company. + * @type {Array} + * @memberof CompanyInformation + */ + currencies?: Array | null; +} + +export interface GetCompanyInformationResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string; + /** + * Currency set in the accounting software of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string; + /** + * Accounting software subscription type such as Trial, Demo, Standard. + * @type {string} + * @memberof CompanyInformation + */ + planType?: string | null; + /** + * Boolean showing if the organisation has multicurrency enabled. + * @type {boolean} + * @memberof CompanyInformation + */ + multicurrencyEnabled?: boolean; + /** + * Array of enabled currencies for the linked company. + * @type {Array} + * @memberof CompanyInformation + */ + currencies?: Array | null; } diff --git a/bank-feeds/src/sdk/models/shared/companyreference.ts b/bank-feeds/src/sdk/models/shared/companyreference.ts index e40af5e26..b63591d6f 100644 --- a/bank-feeds/src/sdk/models/shared/companyreference.ts +++ b/bank-feeds/src/sdk/models/shared/companyreference.ts @@ -1,131 +1,501 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReferenceLinks } from './companyreferencelinks'; +import { + CompanyReferenceLinksFromJSON, + CompanyReferenceLinksFromJSONTyped, + CompanyReferenceLinksToJSON, + CompanyReferenceLinksToJSONTyped, +} from './companyreferencelinks'; + +/** + * + * @export + * @interface CompanyReference + */ +export interface CompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} /** - * A collection of links for the company. + * Check if a given object implements the CompanyReference interface. */ -export type CompanyReferenceLinks = { - /** - * Link to the company page in the portal. - */ - portal?: string | undefined; -}; - -export type CompanyReference = { - /** - * Unique identifier for your SMB in Codat. - */ - id?: string | undefined; - /** - * The name of the company - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of links for the company. - */ - links?: CompanyReferenceLinks | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$inboundSchema: z.ZodType< - CompanyReferenceLinks, - z.ZodTypeDef, - unknown -> = z.object({ - portal: z.string().optional(), -}); -/** @internal */ -export type CompanyReferenceLinks$Outbound = { - portal?: string | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$outboundSchema: z.ZodType< - CompanyReferenceLinks$Outbound, - z.ZodTypeDef, - CompanyReferenceLinks -> = z.object({ - portal: z.string().optional(), -}); - -export function companyReferenceLinksToJSON( - companyReferenceLinks: CompanyReferenceLinks, -): string { - return JSON.stringify( - CompanyReferenceLinks$outboundSchema.parse(companyReferenceLinks), - ); -} -export function companyReferenceLinksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReferenceLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReferenceLinks' from JSON`, - ); -} - -/** @internal */ -export const CompanyReference$inboundSchema: z.ZodType< - CompanyReference, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$inboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); -/** @internal */ -export type CompanyReference$Outbound = { - id?: string | undefined; - name?: string | undefined; - description?: string | undefined; - links?: CompanyReferenceLinks$Outbound | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReference$outboundSchema: z.ZodType< - CompanyReference$Outbound, - z.ZodTypeDef, - CompanyReference -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$outboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyReferenceToJSON( - companyReference: CompanyReference, -): string { - return JSON.stringify( - CompanyReference$outboundSchema.parse(companyReference), - ); -} -export function companyReferenceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReference$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReference' from JSON`, - ); +export function instanceOfCompanyReference(value: object): value is CompanyReference { + return true; +} + +export function CompanyReferenceFromJSON(json: any): CompanyReference { + return CompanyReferenceFromJSONTyped(json, false); +} + +export function CompanyReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'links': json['links'] == null ? undefined : CompanyReferenceLinksFromJSON(json['links']), + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyReferenceToJSON(json: any): CompanyReference { + return CompanyReferenceToJSONTyped(json, false); +} + +export function CompanyReferenceToJSONTyped(value?: CompanyReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'links': CompanyReferenceLinksToJSON(value['links']), + 'tags': value['tags'], + }; +} + + +export interface CompaniesCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCreateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyGetResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyUpdateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface GetCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface SourceAccountStatusChangedWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface SourceAccountWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; } diff --git a/bank-feeds/src/sdk/models/shared/companyreferencelinks.ts b/bank-feeds/src/sdk/models/shared/companyreferencelinks.ts new file mode 100644 index 000000000..55e0d2438 --- /dev/null +++ b/bank-feeds/src/sdk/models/shared/companyreferencelinks.ts @@ -0,0 +1,164 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * A collection of links for the company. + * @export + * @interface CompanyReferenceLinks + */ +export interface CompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +/** + * Check if a given object implements the CompanyReferenceLinks interface. + */ +export function instanceOfCompanyReferenceLinks(value: object): value is CompanyReferenceLinks { + return true; +} + +export function CompanyReferenceLinksFromJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksFromJSONTyped(json, false); +} + +export function CompanyReferenceLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReferenceLinks { + if (json == null) { + return json; + } + return { + + 'portal': json['portal'] == null ? undefined : json['portal'], + }; +} + +export function CompanyReferenceLinksToJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksToJSONTyped(json, false); +} + +export function CompanyReferenceLinksToJSONTyped(value?: CompanyReferenceLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'portal': value['portal'], + }; +} + + +export interface CompanyCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyCreateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyGetResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyReplaceResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyUpdateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CreateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface GetCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface ReplaceCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface SourceAccountStatusChangedWebhookCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface SourceAccountWebhookCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface UpdateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} diff --git a/bank-feeds/src/sdk/models/shared/companyrequestbody.ts b/bank-feeds/src/sdk/models/shared/companyrequestbody.ts index 5e438635a..8d00fcc6c 100644 --- a/bank-feeds/src/sdk/models/shared/companyrequestbody.ts +++ b/bank-feeds/src/sdk/models/shared/companyrequestbody.ts @@ -1,46 +1,208 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyRequestBody = { - /** - * Name of company being connected. - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyRequestBody$Outbound = { - name: string; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyRequestBody$outboundSchema: z.ZodType< - CompanyRequestBody$Outbound, - z.ZodTypeDef, - CompanyRequestBody -> = z.object({ - name: z.string(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyRequestBodyToJSON( - companyRequestBody: CompanyRequestBody, -): string { - return JSON.stringify( - CompanyRequestBody$outboundSchema.parse(companyRequestBody), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyRequestBody + */ +export interface CompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyRequestBody interface. + */ +export function instanceOfCompanyRequestBody(value: object): value is CompanyRequestBody { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CompanyRequestBodyFromJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyFromJSONTyped(json, false); +} + +export function CompanyRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyRequestBody { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyRequestBodyToJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyToJSONTyped(json, false); +} + +export function CompanyRequestBodyToJSONTyped(value?: CompanyRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyCreateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; } diff --git a/bank-feeds/src/sdk/models/shared/companyupdaterequest.ts b/bank-feeds/src/sdk/models/shared/companyupdaterequest.ts index 442b7a78c..770ec7b85 100644 --- a/bank-feeds/src/sdk/models/shared/companyupdaterequest.ts +++ b/bank-feeds/src/sdk/models/shared/companyupdaterequest.ts @@ -1,46 +1,144 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyUpdateRequest = { - /** - * Name of company being connected. - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyUpdateRequest$Outbound = { - name?: string | undefined; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyUpdateRequest$outboundSchema: z.ZodType< - CompanyUpdateRequest$Outbound, - z.ZodTypeDef, - CompanyUpdateRequest -> = z.object({ - name: z.string().optional(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyUpdateRequestToJSON( - companyUpdateRequest: CompanyUpdateRequest, -): string { - return JSON.stringify( - CompanyUpdateRequest$outboundSchema.parse(companyUpdateRequest), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyUpdateRequest + */ +export interface CompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyUpdateRequest interface. + */ +export function instanceOfCompanyUpdateRequest(value: object): value is CompanyUpdateRequest { + return true; +} + +export function CompanyUpdateRequestFromJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestFromJSONTyped(json, false); +} + +export function CompanyUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyUpdateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyUpdateRequestToJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestToJSONTyped(json, false); +} + +export function CompanyUpdateRequestToJSONTyped(value?: CompanyUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyUpdateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyCompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; } diff --git a/bank-feeds/src/sdk/models/shared/connection.ts b/bank-feeds/src/sdk/models/shared/connection.ts index 832a913ba..62b9da6fb 100644 --- a/bank-feeds/src/sdk/models/shared/connection.ts +++ b/bank-feeds/src/sdk/models/shared/connection.ts @@ -1,164 +1,2257 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { SourceType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import type { DataConnectionStatus } from './dataconnectionstatus'; import { - DataConnectionError, - DataConnectionError$inboundSchema, -} from "./dataconnectionerror.js"; + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './dataconnectionstatus'; +import type { DataConnectionError } from './dataconnectionerror'; import { - DataConnectionStatus, - DataConnectionStatus$inboundSchema, -} from "./dataconnectionstatus.js"; - -/** - * The type of platform of the connection. - */ -export const SourceType = { - Accounting: "Accounting", - Banking: "Banking", - BankFeed: "BankFeed", - Commerce: "Commerce", - Expense: "Expense", - Other: "Other", - Unknown: "Unknown", -} as const; -/** - * The type of platform of the connection. - */ -export type SourceType = ClosedEnum; + DataConnectionErrorFromJSON, + DataConnectionErrorFromJSONTyped, + DataConnectionErrorToJSON, + DataConnectionErrorToJSONTyped, +} from './dataconnectionerror'; /** - * A connection represents a [company's](https://docs.codat.io/bank-feeds-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - * - * @remarks - * + * A connection represents a [company's](https://docs.codat.io/bank-feeds-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + * * A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - * + * * - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. * - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. * - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. * Any combination of accounting, banking, and commerce data connections is allowed. - * + * * Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + * @export + * @interface Connection + */ +export interface Connection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + + +/** + * @export */ -export type Connection = { - /** - * Unique identifier for a company's data connection. - */ - id: string; - /** - * A Codat ID representing the integration. - */ - integrationId: string; - /** - * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. - */ - integrationKey?: string | undefined; - /** - * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. - */ - sourceId: string; - /** - * The type of platform of the connection. - */ - sourceType: SourceType; - /** - * Name of integration connected to company. - */ - platformName: string; - /** - * The link URL your customers can use to authorize access to their business application. - */ - linkUrl: string; - /** - * The current authorization status of the data connection. - */ - status: DataConnectionStatus; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSync?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - created: string; - dataConnectionErrors?: Array | null | undefined; - connectionInfo?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const SourceType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(SourceType); - -/** @internal */ -export const Connection$inboundSchema: z.ZodType< - Connection, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - integrationId: z.string(), - integrationKey: z.string().optional(), - sourceId: z.string(), - sourceType: SourceType$inboundSchema, - platformName: z.string(), - linkUrl: z.string(), - status: DataConnectionStatus$inboundSchema, - lastSync: z.string().optional(), - created: z.string(), - dataConnectionErrors: z.nullable(z.array(DataConnectionError$inboundSchema)) - .optional(), - connectionInfo: z.nullable(z.record(z.any())).optional(), -}); - -export function connectionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connection$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connection' from JSON`, - ); +export const ConnectionSourceTypeEnum = { + Accounting: 'Accounting', + Banking: 'Banking', + BankFeed: 'BankFeed', + Commerce: 'Commerce', + Expense: 'Expense', + Other: 'Other', + Unknown: 'Unknown' +} as const; +export type ConnectionSourceTypeEnum = typeof ConnectionSourceTypeEnum[keyof typeof ConnectionSourceTypeEnum]; + + +/** + * Check if a given object implements the Connection interface. + */ +export function instanceOfConnection(value: object): value is Connection { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('integrationId' in value) || value['integrationId'] === undefined) return false; + if (!('sourceId' in value) || value['sourceId'] === undefined) return false; + if (!('sourceType' in value) || value['sourceType'] === undefined) return false; + if (!('platformName' in value) || value['platformName'] === undefined) return false; + if (!('linkUrl' in value) || value['linkUrl'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('created' in value) || value['created'] === undefined) return false; + return true; +} + +export function ConnectionFromJSON(json: any): Connection { + return ConnectionFromJSONTyped(json, false); +} + +export function ConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connection { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'integrationId': json['integrationId'], + 'integrationKey': json['integrationKey'] == null ? undefined : json['integrationKey'], + 'sourceId': json['sourceId'], + 'sourceType': json['sourceType'], + 'platformName': json['platformName'], + 'linkUrl': json['linkUrl'], + 'status': DataConnectionStatusFromJSON(json['status']), + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'], + 'dataConnectionErrors': json['dataConnectionErrors'] == null ? undefined : ((json['dataConnectionErrors'] as Array).map(DataConnectionErrorFromJSON)), + 'connectionInfo': json['connectionInfo'] == null ? undefined : json['connectionInfo'], + }; +} + +export function ConnectionToJSON(json: any): Connection { + return ConnectionToJSONTyped(json, false); +} + +export function ConnectionToJSONTyped(value?: Connection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'integrationId': value['integrationId'], + 'integrationKey': value['integrationKey'], + 'sourceId': value['sourceId'], + 'sourceType': value['sourceType'], + 'platformName': value['platformName'], + 'linkUrl': value['linkUrl'], + 'status': DataConnectionStatusToJSON(value['status']), + 'lastSync': value['lastSync'], + 'created': value['created'], + 'dataConnectionErrors': value['dataConnectionErrors'] == null ? undefined : ((value['dataConnectionErrors'] as Array).map(DataConnectionErrorToJSON)), + 'connectionInfo': value['connectionInfo'], + }; +} + + +export interface CompanyConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyReplaceResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyUpdateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionUnlinkResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsListResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ListConnectionsResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ReplaceCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UnlinkConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UpdateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + lastSync?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; } diff --git a/bank-feeds/src/sdk/models/shared/connections.ts b/bank-feeds/src/sdk/models/shared/connections.ts index 1278d54c3..9dfe726c4 100644 --- a/bank-feeds/src/sdk/models/shared/connections.ts +++ b/bank-feeds/src/sdk/models/shared/connections.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Connections = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Connections$inboundSchema: z.ZodType< - Connections, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Connection$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function connectionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connections$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connections' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Connections + */ +export interface Connections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +/** + * Check if a given object implements the Connections interface. + */ +export function instanceOfConnections(value: object): value is Connections { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function ConnectionsFromJSON(json: any): Connections { + return ConnectionsFromJSONTyped(json, false); +} + +export function ConnectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connections { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(ConnectionFromJSON)), + }; +} + +export function ConnectionsToJSON(json: any): Connections { + return ConnectionsToJSONTyped(json, false); +} + +export function ConnectionsToJSONTyped(value?: Connections | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface ConnectionsListResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +export interface ListConnectionsResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; } diff --git a/bank-feeds/src/sdk/models/shared/createbanktransactions.ts b/bank-feeds/src/sdk/models/shared/createbanktransactions.ts index 4755c3ab9..03603a413 100644 --- a/bank-feeds/src/sdk/models/shared/createbanktransactions.ts +++ b/bank-feeds/src/sdk/models/shared/createbanktransactions.ts @@ -1,64 +1,189 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { BankTransactions } from '../BankTransaction'; +import { mapValues } from '../../../runtime'; +import type { BankTransaction } from '../BankTransaction'; import { - BankTransactions, - BankTransactions$inboundSchema, - BankTransactions$Outbound, - BankTransactions$outboundSchema, -} from "./banktransactions.js"; - -export type CreateBankTransactions = { - /** - * Unique identifier for a bank account. - */ - accountId: string; - transactions: Array; -}; - -/** @internal */ -export const CreateBankTransactions$inboundSchema: z.ZodType< - CreateBankTransactions, - z.ZodTypeDef, - unknown -> = z.object({ - accountId: z.string(), - transactions: z.array(BankTransactions$inboundSchema), -}); -/** @internal */ -export type CreateBankTransactions$Outbound = { - accountId: string; - transactions: Array; -}; - -/** @internal */ -export const CreateBankTransactions$outboundSchema: z.ZodType< - CreateBankTransactions$Outbound, - z.ZodTypeDef, - CreateBankTransactions -> = z.object({ - accountId: z.string(), - transactions: z.array(BankTransactions$outboundSchema), -}); - -export function createBankTransactionsToJSON( - createBankTransactions: CreateBankTransactions, -): string { - return JSON.stringify( - CreateBankTransactions$outboundSchema.parse(createBankTransactions), - ); + BankTransactionFromJSON, + BankTransactionFromJSONTyped, + BankTransactionToJSON, + BankTransactionToJSONTyped, +} from '../BankTransaction'; + +/** + * + * @export + * @interface CreateBankTransactions + */ +export interface CreateBankTransactions { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +/** + * Check if a given object implements the CreateBankTransactions interface. + */ +export function instanceOfCreateBankTransactions(value: object): value is CreateBankTransactions { + if (!('accountId' in value) || value['accountId'] === undefined) return false; + if (!('transactions' in value) || value['transactions'] === undefined) return false; + return true; +} + +export function CreateBankTransactionsFromJSON(json: any): CreateBankTransactions { + return CreateBankTransactionsFromJSONTyped(json, false); +} + +export function CreateBankTransactionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBankTransactions { + if (json == null) { + return json; + } + return { + + 'accountId': json['accountId'], + 'transactions': ((json['transactions'] as Array).map(BankTransactionFromJSON)), + }; +} + +export function CreateBankTransactionsToJSON(json: any): CreateBankTransactions { + return CreateBankTransactionsToJSONTyped(json, false); +} + +export function CreateBankTransactionsToJSONTyped(value?: CreateBankTransactions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountId': value['accountId'], + 'transactions': ((value['transactions'] as Array).map(BankTransactionToJSON)), + }; } -export function createBankTransactionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateBankTransactions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateBankTransactions' from JSON`, - ); + + +export interface BankAccountTransactionsCreate { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface BankTransactionsCreateRequestBody { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface BankTransactionsCreateResponseCreateBankTransactions { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface CreateBankTransactionResponseCreateBankTransactions { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface CreateBankTransactionsCreateBankTransactions { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface CreateBankTransactionsRequestBody { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; +} + +export interface CreateBankTransactionsResponseCreateBankTransactions { + /** + * Unique identifier for a bank account. + * @type {string} + * @memberof CreateBankTransactions + */ + accountId: string; + /** + * + * @type {Array} + * @memberof CreateBankTransactions + */ + transactions: Array; } diff --git a/bank-feeds/src/sdk/models/shared/createbanktransactionsresponse.ts b/bank-feeds/src/sdk/models/shared/createbanktransactionsresponse.ts index be2265e72..d6c14a507 100644 --- a/bank-feeds/src/sdk/models/shared/createbanktransactionsresponse.ts +++ b/bank-feeds/src/sdk/models/shared/createbanktransactionsresponse.ts @@ -1,148 +1,870 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - CreateBankTransactions, - CreateBankTransactions$inboundSchema, -} from "./createbanktransactions.js"; -import { DataType, DataType$inboundSchema } from "./datatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { CreateBankTransactions } from './createbanktransactions'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + CreateBankTransactionsFromJSON, + CreateBankTransactionsFromJSONTyped, + CreateBankTransactionsToJSON, + CreateBankTransactionsToJSONTyped, +} from './createbanktransactions'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; - -export type CreateBankTransactionsResponse = { - data?: CreateBankTransactions | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; - -/** @internal */ -export const CreateBankTransactionsResponse$inboundSchema: z.ZodType< - CreateBankTransactionsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: CreateBankTransactions$inboundSchema.optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: DataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); - -export function createBankTransactionsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateBankTransactionsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateBankTransactionsResponse' from JSON`, - ); + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { DataType } from './datatype'; +import { + DataTypeFromJSON, + DataTypeFromJSONTyped, + DataTypeToJSON, + DataTypeToJSONTyped, +} from './datatype'; +import type { PushOperationChange } from './pushoperationchange'; +import { + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; + +/** + * + * @export + * @interface CreateBankTransactionsResponse + */ +export interface CreateBankTransactionsResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; +} + + + +/** + * Check if a given object implements the CreateBankTransactionsResponse interface. + */ +export function instanceOfCreateBankTransactionsResponse(value: object): value is CreateBankTransactionsResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function CreateBankTransactionsResponseFromJSON(json: any): CreateBankTransactionsResponse { + return CreateBankTransactionsResponseFromJSONTyped(json, false); +} + +export function CreateBankTransactionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBankTransactionsResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : DataTypeFromJSON(json['dataType']), + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : CreateBankTransactionsFromJSON(json['data']), + }; +} + +export function CreateBankTransactionsResponseToJSON(json: any): CreateBankTransactionsResponse { + return CreateBankTransactionsResponseToJSONTyped(json, false); +} + +export function CreateBankTransactionsResponseToJSONTyped(value?: CreateBankTransactionsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': DataTypeToJSON(value['dataType']), + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': CreateBankTransactionsToJSON(value['data']), + }; +} + + +export interface BankTransactionsCreateResponseCreateBankTransactionResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; +} + +export interface BankTransactionsCreateResponseCreateBankTransactionsResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; +} + +export interface CreateBankTransactionResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; +} + +export interface CreateBankTransactionsResponseCreateBankTransactionResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; +} + +export interface CreateBankTransactionsResponseCreateBankTransactionsResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankTransactionsResponse + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof CreateBankTransactionsResponse + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankTransactionsResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankTransactionsResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankTransactionsResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankTransactionsResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankTransactionsResponse + */ + statusCode: number; + /** + * + * @type {CreateBankTransactions} + * @memberof CreateBankTransactionsResponse + */ + data?: CreateBankTransactions; } diff --git a/bank-feeds/src/sdk/models/shared/dataconnectionerror.ts b/bank-feeds/src/sdk/models/shared/dataconnectionerror.ts index 1cb816d0f..46b174010 100644 --- a/bank-feeds/src/sdk/models/shared/dataconnectionerror.ts +++ b/bank-feeds/src/sdk/models/shared/dataconnectionerror.ts @@ -1,112 +1,678 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { ErrorStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DataConnectionError */ +export interface DataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * @export */ -export const ErrorStatus = { - Active: "Active", - Resolved: "Resolved", +export const DataConnectionErrorStatusEnum = { + Active: 'Active', + Resolved: 'Resolved' } as const; +export type DataConnectionErrorStatusEnum = typeof DataConnectionErrorStatusEnum[keyof typeof DataConnectionErrorStatusEnum]; + + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * Check if a given object implements the DataConnectionError interface. */ -export type ErrorStatus = ClosedEnum; - -export type DataConnectionError = { - /** - * The HTTP status code returned by the source platform when the error occurred. - */ - statusCode?: string | undefined; - /** - * A non-numeric status code/text returned by the source platform when the error occurred. - */ - statusText?: string | undefined; - /** - * A message about a error returned by Codat. - */ - errorMessage?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - erroredOnUtc?: string | undefined; - /** - * The current status of a transient error. Null statuses indicate that the error is not transient. - */ - status?: ErrorStatus | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - resolvedOnUtc?: string | undefined; -}; - -/** @internal */ -export const ErrorStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ErrorStatus); - -/** @internal */ -export const DataConnectionError$inboundSchema: z.ZodType< - DataConnectionError, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.string().optional(), - statusText: z.string().optional(), - errorMessage: z.string().optional(), - erroredOnUtc: z.string().optional(), - status: z.nullable(ErrorStatus$inboundSchema).optional(), - resolvedOnUtc: z.string().optional(), -}); - -export function dataConnectionErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataConnectionError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataConnectionError' from JSON`, - ); +export function instanceOfDataConnectionError(value: object): value is DataConnectionError { + return true; +} + +export function DataConnectionErrorFromJSON(json: any): DataConnectionError { + return DataConnectionErrorFromJSONTyped(json, false); +} + +export function DataConnectionErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionError { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'statusText': json['statusText'] == null ? undefined : json['statusText'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'erroredOnUtc': json['erroredOnUtc'] == null ? undefined : json['erroredOnUtc'], + 'status': json['status'] == null ? undefined : json['status'], + 'resolvedOnUtc': json['resolvedOnUtc'] == null ? undefined : json['resolvedOnUtc'], + }; +} + +export function DataConnectionErrorToJSON(json: any): DataConnectionError { + return DataConnectionErrorToJSONTyped(json, false); +} + +export function DataConnectionErrorToJSONTyped(value?: DataConnectionError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'statusText': value['statusText'], + 'errorMessage': value['errorMessage'], + 'erroredOnUtc': value['erroredOnUtc'], + 'status': value['status'], + 'resolvedOnUtc': value['resolvedOnUtc'], + }; +} + + +export interface ConnectionCreateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionGetResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionUnlinkResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface CreateConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface GetConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface UnlinkConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; } diff --git a/bank-feeds/src/sdk/models/shared/dataconnectionstatus.ts b/bank-feeds/src/sdk/models/shared/dataconnectionstatus.ts index 88889c800..42a89ba8d 100644 --- a/bank-feeds/src/sdk/models/shared/dataconnectionstatus.ts +++ b/bank-feeds/src/sdk/models/shared/dataconnectionstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current authorization status of the data connection. + * @export */ export const DataConnectionStatus = { - PendingAuth: "PendingAuth", - Linked: "Linked", - Unlinked: "Unlinked", - Deauthorized: "Deauthorized", + PendingAuth: 'PendingAuth', + Linked: 'Linked', + Unlinked: 'Unlinked', + Deauthorized: 'Deauthorized' } as const; -/** - * The current authorization status of the data connection. - */ -export type DataConnectionStatus = ClosedEnum; - -/** @internal */ -export const DataConnectionStatus$inboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = z.nativeEnum(DataConnectionStatus); -/** @internal */ -export const DataConnectionStatus$outboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = DataConnectionStatus$inboundSchema; +export type DataConnectionStatus = typeof DataConnectionStatus[keyof typeof DataConnectionStatus]; + + +export function instanceOfDataConnectionStatus(value: any): boolean { + for (const key in DataConnectionStatus) { + if (Object.prototype.hasOwnProperty.call(DataConnectionStatus, key)) { + if (DataConnectionStatus[key as keyof typeof DataConnectionStatus] === value) { + return true; + } + } + } + return false; +} + +export function DataConnectionStatusFromJSON(json: any): DataConnectionStatus { + return DataConnectionStatusFromJSONTyped(json, false); +} + +export function DataConnectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return json as DataConnectionStatus; +} + +export function DataConnectionStatusToJSON(value?: DataConnectionStatus | null): any { + return value as any; +} + +export function DataConnectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return value as DataConnectionStatus; +} + diff --git a/bank-feeds/src/sdk/models/shared/datatype.ts b/bank-feeds/src/sdk/models/shared/datatype.ts index d2a4952ef..4de7a8ec3 100644 --- a/bank-feeds/src/sdk/models/shared/datatype.ts +++ b/bank-feeds/src/sdk/models/shared/datatype.ts @@ -1,63 +1,98 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ + +import type { BankAccounts } from './bankaccounts'; +import type { Company } from './company'; +import type { Items } from '../Items'; +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Available data types + * @export */ export const DataType = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' } as const; -/** - * Available data types - */ -export type DataType = ClosedEnum; +export type DataType = typeof DataType[keyof typeof DataType]; + + +export function instanceOfDataType(value: any): boolean { + for (const key in DataType) { + if (Object.prototype.hasOwnProperty.call(DataType, key)) { + if (DataType[key as keyof typeof DataType] === value) { + return true; + } + } + } + return false; +} + +export function DataTypeFromJSON(json: any): DataType { + return DataTypeFromJSONTyped(json, false); +} + +export function DataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataType { + return json as DataType; +} + +export function DataTypeToJSON(value?: DataType | null): any { + return value as any; +} + +export function DataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DataType { + return value as DataType; +} -/** @internal */ -export const DataType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataType); diff --git a/bank-feeds/src/sdk/models/shared/errorvalidation.ts b/bank-feeds/src/sdk/models/shared/errorvalidation.ts index dc97b86b1..2a7b439fb 100644 --- a/bank-feeds/src/sdk/models/shared/errorvalidation.ts +++ b/bank-feeds/src/sdk/models/shared/errorvalidation.ts @@ -1,40 +1,96 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ErrorValidationItem } from './errorvalidationitem'; import { - ErrorValidationItem, - ErrorValidationItem$inboundSchema, -} from "./errorvalidationitem.js"; + ErrorValidationItemFromJSON, + ErrorValidationItemFromJSONTyped, + ErrorValidationItemToJSON, + ErrorValidationItemToJSONTyped, +} from './errorvalidationitem'; /** * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + * @export + * @interface ErrorValidation + */ +export interface ErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the ErrorValidation interface. */ -export type ErrorValidation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const ErrorValidation$inboundSchema: z.ZodType< - ErrorValidation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), -}); - -export function errorValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidation' from JSON`, - ); +export function instanceOfErrorValidation(value: object): value is ErrorValidation { + return true; +} + +export function ErrorValidationFromJSON(json: any): ErrorValidation { + return ErrorValidationFromJSONTyped(json, false); +} + +export function ErrorValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ErrorValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ErrorValidationItemFromJSON)), + }; +} + +export function ErrorValidationToJSON(json: any): ErrorValidation { + return ErrorValidationToJSONTyped(json, false); +} + +export function ErrorValidationToJSONTyped(value?: ErrorValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ErrorValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ErrorValidationItemToJSON)), + }; +} + + +export interface ErrorMessageErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; } diff --git a/bank-feeds/src/sdk/models/shared/errorvalidationitem.ts b/bank-feeds/src/sdk/models/shared/errorvalidationitem.ts index cd21ec230..3e1ce7c74 100644 --- a/bank-feeds/src/sdk/models/shared/errorvalidationitem.ts +++ b/bank-feeds/src/sdk/models/shared/errorvalidationitem.ts @@ -1,44 +1,102 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ErrorValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ErrorValidationItem$inboundSchema: z.ZodType< - ErrorValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function errorValidationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ErrorValidationItem + */ +export interface ErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ErrorValidationItem interface. + */ +export function instanceOfErrorValidationItem(value: object): value is ErrorValidationItem { + return true; +} + +export function ErrorValidationItemFromJSON(json: any): ErrorValidationItem { + return ErrorValidationItemFromJSONTyped(json, false); +} + +export function ErrorValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidationItem { + if (json == null) { + return json; + } + return { + + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ErrorValidationItemToJSON(json: any): ErrorValidationItem { + return ErrorValidationItemToJSONTyped(json, false); +} + +export function ErrorValidationItemToJSONTyped(value?: ErrorValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface ErrorMessageErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/generateotpresponse.ts b/bank-feeds/src/sdk/models/shared/generateotpresponse.ts index 82654e5b3..7e9a46042 100644 --- a/bank-feeds/src/sdk/models/shared/generateotpresponse.ts +++ b/bank-feeds/src/sdk/models/shared/generateotpresponse.ts @@ -1,60 +1,266 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Response containing a one-time password and its expiry time. + * @export + * @interface GenerateOtpResponse */ -export type GenerateOtpResponse = { - /** - * The one-time password. - */ - otp: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - expiry: string; -}; - -/** @internal */ -export const GenerateOtpResponse$inboundSchema: z.ZodType< - GenerateOtpResponse, - z.ZodTypeDef, - unknown -> = z.object({ - otp: z.string(), - expiry: z.string(), -}); - -export function generateOtpResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GenerateOtpResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GenerateOtpResponse' from JSON`, - ); +export interface GenerateOtpResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; +} + +/** + * Check if a given object implements the GenerateOtpResponse interface. + */ +export function instanceOfGenerateOtpResponse(value: object): value is GenerateOtpResponse { + if (!('otp' in value) || value['otp'] === undefined) return false; + if (!('expiry' in value) || value['expiry'] === undefined) return false; + return true; +} + +export function GenerateOtpResponseFromJSON(json: any): GenerateOtpResponse { + return GenerateOtpResponseFromJSONTyped(json, false); +} + +export function GenerateOtpResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenerateOtpResponse { + if (json == null) { + return json; + } + return { + + ...json, + 'otp': json['otp'], + 'expiry': json['expiry'], + }; +} + +export function GenerateOtpResponseToJSON(json: any): GenerateOtpResponse { + return GenerateOtpResponseToJSONTyped(json, false); +} + +export function GenerateOtpResponseToJSONTyped(value?: GenerateOtpResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'otp': value['otp'], + 'expiry': value['expiry'], + }; +} + + +export interface GenerateOtpResponseGenerateOtpResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; +} + +export interface GenerateOtpResponseOTPResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; +} + +export interface OTPResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; +} + +export interface OtpGenerateResponseGenerateOtpResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; +} + +export interface OtpGenerateResponseOTPResponse { + [key: string]: any | any; + /** + * The one-time password. + * @type {string} + * @memberof GenerateOtpResponse + */ + otp: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof GenerateOtpResponse + */ + expiry: string; } diff --git a/bank-feeds/src/sdk/models/shared/halref.ts b/bank-feeds/src/sdk/models/shared/halref.ts index 921d594fb..481f73a8c 100644 --- a/bank-feeds/src/sdk/models/shared/halref.ts +++ b/bank-feeds/src/sdk/models/shared/halref.ts @@ -1,31 +1,191 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type HalRef = { - /** - * Uri hypertext reference. - */ - href?: string | undefined; -}; - -/** @internal */ -export const HalRef$inboundSchema: z.ZodType = z - .object({ - href: z.string().optional(), - }); - -export function halRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => HalRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'HalRef' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface HalRef + */ +export interface HalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +/** + * Check if a given object implements the HalRef interface. + */ +export function instanceOfHalRef(value: object): value is HalRef { + return true; +} + +export function HalRefFromJSON(json: any): HalRef { + return HalRefFromJSONTyped(json, false); +} + +export function HalRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): HalRef { + if (json == null) { + return json; + } + return { + + 'href': json['href'] == null ? undefined : json['href'], + }; +} + +export function HalRefToJSON(json: any): HalRef { + return HalRefToJSONTyped(json, false); +} + +export function HalRefToJSONTyped(value?: HalRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'href': value['href'], + }; +} + + +export interface AccountingBankAccountsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface BankAccountsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface BankAccountsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompaniesHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompaniesListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CreateOperationsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListBankAccountsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCompaniesResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListConnectionsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCreateOperationsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PushOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; } diff --git a/bank-feeds/src/sdk/models/shared/index.ts b/bank-feeds/src/sdk/models/shared/index.ts index 7f0f1fd50..bd1d9045a 100644 --- a/bank-feeds/src/sdk/models/shared/index.ts +++ b/bank-feeds/src/sdk/models/shared/index.ts @@ -1,66 +1,81 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./accountinfo.js"; -export * from "./accounttype.js"; -export * from "./bankaccountcreateresponse.js"; -export * from "./bankaccountcredentials.js"; -export * from "./bankaccountprototype.js"; -export * from "./bankaccounts.js"; -export * from "./bankaccountstatus.js"; -export * from "./bankfeedaccountmapping.js"; -export * from "./bankfeedaccountmappingresponse.js"; -export * from "./bankfeedmapping.js"; -export * from "./banktransactions.js"; -export * from "./clientratelimitwebhook.js"; -export * from "./clientratelimitwebhookpayload.js"; -export * from "./companies.js"; -export * from "./company.js"; -export * from "./companyaccesstoken.js"; -export * from "./companyinformation.js"; -export * from "./companyreference.js"; -export * from "./companyrequestbody.js"; -export * from "./companyupdaterequest.js"; -export * from "./connection.js"; -export * from "./connections.js"; -export * from "./createbanktransactions.js"; -export * from "./createbanktransactionsresponse.js"; -export * from "./dataconnectionerror.js"; -export * from "./dataconnectionstatus.js"; -export * from "./datatype.js"; -export * from "./errorvalidation.js"; -export * from "./errorvalidationitem.js"; -export * from "./generateotpresponse.js"; -export * from "./halref.js"; -export * from "./links.js"; -export * from "./pushchangetype.js"; -export * from "./pushfieldvalidation.js"; -export * from "./pushoperation.js"; -export * from "./pushoperationchange.js"; -export * from "./pushoperationref.js"; -export * from "./pushoperations.js"; -export * from "./pushoperationstatus.js"; -export * from "./pushoption.js"; -export * from "./pushoptionchoice.js"; -export * from "./pushoptionproperty.js"; -export * from "./pushoptiontype.js"; -export * from "./pushvalidationinfo.js"; -export * from "./routinginfo.js"; -export * from "./security.js"; -export * from "./sourceaccount.js"; -export * from "./sourceaccountbatchcreateresponse.js"; -export * from "./sourceaccountbatchcreateresult.js"; -export * from "./sourceaccountbatcherrorresponse.js"; -export * from "./sourceaccountprototype.js"; -export * from "./sourceaccountv2.js"; -export * from "./sourceaccountv2batchcreateresponse.js"; -export * from "./sourceaccountv2batchcreateresult.js"; -export * from "./sourceaccountv2prototype.js"; -export * from "./sourceaccountwebhook.js"; -export * from "./sourceaccountwebhookpayload.js"; -export * from "./startscheduledsyncresult.js"; -export * from "./syncstatusresult.js"; -export * from "./targetaccountoption.js"; -export * from "./validation.js"; -export * from "./validationitem.js"; +export * from './accountinfo'; +export * from './accountingbankaccount'; +export * from './bankaccountcreateresponse'; +export * from './bankaccountcredentials'; +export * from './bankaccountprototype'; +export * from './bankaccountstatus'; +export * from './bankaccounts'; +export * from './bankfeedaccountmapping'; +export * from './bankfeedaccountmappingresponse'; +export * from './bankfeedmapping'; +export * from './clientratelimitwebhook'; +export * from './clientratelimitwebhookpayload'; +export * from './companies'; +export * from './company'; +export * from './companyaccesstoken'; +export * from './companyinformation'; +export * from './companyreference'; +export * from './companyreferencelinks'; +export * from './companyrequestbody'; +export * from './companyupdaterequest'; +export * from './connection'; +export * from './connections'; +export * from './createbanktransactions'; +export * from './createbanktransactionsresponse'; +export * from './dataconnectionerror'; +export * from './dataconnectionstatus'; +export * from './datatype'; +export * from './errorvalidation'; +export * from './errorvalidationitem'; +export * from './generateotpresponse'; +export * from './halref'; +export * from './links'; +export * from './metadata'; +export * from './pushchangetype'; +export * from './pushfieldvalidation'; +export * from './pushoperation'; +export * from './pushoperationchange'; +export * from './pushoperationref'; +export * from './pushoperationstatus'; +export * from './pushoperations'; +export * from './pushoption'; +export * from './pushoptionchoice'; +export * from './pushoptionproperty'; +export * from './pushoptiontype'; +export * from './pushvalidationinfo'; +export * from './routinginfo'; +export * from './sourceaccount'; +export * from './sourceaccountbatchcreateresponse'; +export * from './sourceaccountbatchcreateresult'; +export * from './sourceaccountbatcherrorresponse'; +export * from './sourceaccountprototype'; +export * from './sourceaccountv2'; +export * from './sourceaccountv2batchcreateresponse'; +export * from './sourceaccountv2batchcreateresult'; +export * from './sourceaccountv2prototype'; +export * from './sourceaccountwebhook'; +export * from './sourceaccountwebhookpayload'; +export * from './startscheduledsyncresult'; +export * from './supplementaldata'; +export * from './syncstatusresult'; +export * from './targetaccountoption'; +export * from './validation'; +export * from './validationitem'; +export { AccountType } from '../_speakeasy_enums'; +export { BankAccountCreateResponseBankAccountType } from '../_speakeasy_enums'; +export { BankAccountType } from '../_speakeasy_enums'; +export { BankAccountsBankAccountType } from '../_speakeasy_enums'; +export { BankTransactionType } from '../_speakeasy_enums'; +export { BankTransactions } from '../BankTransaction'; +export { ErrorStatus } from '../_speakeasy_enums'; +export { Result } from '../SourceAccountBatchErrorResponseResult'; +export { SourceAccountStatus } from '../_speakeasy_enums'; +export { SourceAccountV2AccountType } from '../_speakeasy_enums'; +export { SourceAccountWebhookPayloadSourceAccount } from '../_speakeasy_hoisted'; +export { SourceType } from '../_speakeasy_enums'; +export { Status } from '../_speakeasy_enums'; +export { Type } from '../_speakeasy_enums'; +export type { Security } from '../../../lib/sdkconfig'; diff --git a/bank-feeds/src/sdk/models/shared/links.ts b/bank-feeds/src/sdk/models/shared/links.ts index 751d7d00e..9190f4b5f 100644 --- a/bank-feeds/src/sdk/models/shared/links.ts +++ b/bank-feeds/src/sdk/models/shared/links.ts @@ -1,35 +1,477 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { HalRef, HalRef$inboundSchema } from "./halref.js"; - -export type Links = { - self: HalRef; - current: HalRef; - next?: HalRef | undefined; - previous?: HalRef | undefined; -}; - -/** @internal */ -export const Links$inboundSchema: z.ZodType = z - .object({ - self: HalRef$inboundSchema, - current: HalRef$inboundSchema, - next: HalRef$inboundSchema.optional(), - previous: HalRef$inboundSchema.optional(), - }); - -export function linksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Links$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Links' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { HalRef } from './halref'; +import { + HalRefFromJSON, + HalRefFromJSONTyped, + HalRefToJSON, + HalRefToJSONTyped, +} from './halref'; + +/** + * + * @export + * @interface Links + */ +export interface Links { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +/** + * Check if a given object implements the Links interface. + */ +export function instanceOfLinks(value: object): value is Links { + if (!('self' in value) || value['self'] === undefined) return false; + if (!('current' in value) || value['current'] === undefined) return false; + return true; +} + +export function LinksFromJSON(json: any): Links { + return LinksFromJSONTyped(json, false); +} + +export function LinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Links { + if (json == null) { + return json; + } + return { + + 'self': HalRefFromJSON(json['self']), + 'current': HalRefFromJSON(json['current']), + 'next': json['next'] == null ? undefined : HalRefFromJSON(json['next']), + 'previous': json['previous'] == null ? undefined : HalRefFromJSON(json['previous']), + }; +} + +export function LinksToJSON(json: any): Links { + return LinksToJSONTyped(json, false); +} + +export function LinksToJSONTyped(value?: Links | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'self': HalRefToJSON(value['self']), + 'current': HalRefToJSON(value['current']), + 'next': HalRefToJSON(value['next']), + 'previous': HalRefToJSON(value['previous']), + }; +} + + +export interface AccountingBankAccountsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface BankAccountsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface BankAccountsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompaniesLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompaniesListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CreateOperationsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListBankAccountsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCompaniesResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListConnectionsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCreateOperationsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PushOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; } diff --git a/bank-feeds/src/sdk/models/shared/metadata.ts b/bank-feeds/src/sdk/models/shared/metadata.ts new file mode 100644 index 000000000..481994118 --- /dev/null +++ b/bank-feeds/src/sdk/models/shared/metadata.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface Metadata + */ +export interface Metadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +/** + * Check if a given object implements the Metadata interface. + */ +export function instanceOfMetadata(value: object): value is Metadata { + return true; +} + +export function MetadataFromJSON(json: any): Metadata { + return MetadataFromJSONTyped(json, false); +} + +export function MetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): Metadata { + if (json == null) { + return json; + } + return { + + 'isDeleted': json['isDeleted'] == null ? undefined : json['isDeleted'], + }; +} + +export function MetadataToJSON(json: any): Metadata { + return MetadataToJSONTyped(json, false); +} + +export function MetadataToJSONTyped(value?: Metadata | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'isDeleted': value['isDeleted'], + }; +} + + +export interface AccountingBankAccountsMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface BankAccountCreateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface BankAccountsMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CreateBankAccountResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} diff --git a/bank-feeds/src/sdk/models/shared/pushchangetype.ts b/bank-feeds/src/sdk/models/shared/pushchangetype.ts index 42040ea23..718ae35de 100644 --- a/bank-feeds/src/sdk/models/shared/pushchangetype.ts +++ b/bank-feeds/src/sdk/models/shared/pushchangetype.ts @@ -1,26 +1,56 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of change being applied to record in third party platform. + * @export */ export const PushChangeType = { - Unknown: "Unknown", - Created: "Created", - Modified: "Modified", - Deleted: "Deleted", - AttachmentUploaded: "AttachmentUploaded", + Unknown: 'Unknown', + Created: 'Created', + Modified: 'Modified', + Deleted: 'Deleted', + AttachmentUploaded: 'AttachmentUploaded' } as const; -/** - * Type of change being applied to record in third party platform. - */ -export type PushChangeType = ClosedEnum; +export type PushChangeType = typeof PushChangeType[keyof typeof PushChangeType]; + + +export function instanceOfPushChangeType(value: any): boolean { + for (const key in PushChangeType) { + if (Object.prototype.hasOwnProperty.call(PushChangeType, key)) { + if (PushChangeType[key as keyof typeof PushChangeType] === value) { + return true; + } + } + } + return false; +} + +export function PushChangeTypeFromJSON(json: any): PushChangeType { + return PushChangeTypeFromJSONTyped(json, false); +} + +export function PushChangeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushChangeType { + return json as PushChangeType; +} + +export function PushChangeTypeToJSON(value?: PushChangeType | null): any { + return value as any; +} + +export function PushChangeTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushChangeType { + return value as PushChangeType; +} -/** @internal */ -export const PushChangeType$inboundSchema: z.ZodNativeEnum< - typeof PushChangeType -> = z.nativeEnum(PushChangeType); diff --git a/bank-feeds/src/sdk/models/shared/pushfieldvalidation.ts b/bank-feeds/src/sdk/models/shared/pushfieldvalidation.ts index 15fc3a0f5..165e73319 100644 --- a/bank-feeds/src/sdk/models/shared/pushfieldvalidation.ts +++ b/bank-feeds/src/sdk/models/shared/pushfieldvalidation.ts @@ -1,44 +1,107 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type PushFieldValidation = { - /** - * Field name that resulted in the validation issue. - */ - field?: string | undefined; - /** - * Details on the validation issue. - */ - details: string; - /** - * Unique reference identifier for the validation issue. - */ - ref?: string | null | undefined; -}; - -/** @internal */ -export const PushFieldValidation$inboundSchema: z.ZodType< - PushFieldValidation, - z.ZodTypeDef, - unknown -> = z.object({ - field: z.string().optional(), - details: z.string(), - ref: z.nullable(z.string()).optional(), -}); - -export function pushFieldValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushFieldValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushFieldValidation' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PushFieldValidation + */ +export interface PushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; +} + +/** + * Check if a given object implements the PushFieldValidation interface. + */ +export function instanceOfPushFieldValidation(value: object): value is PushFieldValidation { + if (!('details' in value) || value['details'] === undefined) return false; + return true; +} + +export function PushFieldValidationFromJSON(json: any): PushFieldValidation { + return PushFieldValidationFromJSONTyped(json, false); +} + +export function PushFieldValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushFieldValidation { + if (json == null) { + return json; + } + return { + + ...json, + 'field': json['field'] == null ? undefined : json['field'], + 'details': json['details'], + 'ref': json['ref'] == null ? undefined : json['ref'], + }; +} + +export function PushFieldValidationToJSON(json: any): PushFieldValidation { + return PushFieldValidationToJSONTyped(json, false); +} + +export function PushFieldValidationToJSONTyped(value?: PushFieldValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'field': value['field'], + 'details': value['details'], + 'ref': value['ref'], + }; +} + + +export interface PushOptionPushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/pushoperation.ts b/bank-feeds/src/sdk/models/shared/pushoperation.ts index 470b4a2d4..b98316095 100644 --- a/bank-feeds/src/sdk/models/shared/pushoperation.ts +++ b/bank-feeds/src/sdk/models/shared/pushoperation.ts @@ -1,142 +1,1415 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { DataType, DataType$inboundSchema } from "./datatype.js"; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; - -export type PushOperation = { - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; - -/** @internal */ -export const PushOperation$inboundSchema: z.ZodType< - PushOperation, - z.ZodTypeDef, - unknown -> = z.object({ - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: DataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); - -export function pushOperationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperation' from JSON`, - ); + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { DataType } from './datatype'; +import { + DataTypeFromJSON, + DataTypeFromJSONTyped, + DataTypeToJSON, + DataTypeToJSONTyped, +} from './datatype'; +import type { PushOperationChange } from './pushoperationchange'; +import { + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; + +/** + * + * @export + * @interface PushOperation + */ +export interface PushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + + + +/** + * Check if a given object implements the PushOperation interface. + */ +export function instanceOfPushOperation(value: object): value is PushOperation { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function PushOperationFromJSON(json: any): PushOperation { + return PushOperationFromJSONTyped(json, false); +} + +export function PushOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperation { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : DataTypeFromJSON(json['dataType']), + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + }; +} + +export function PushOperationToJSON(json: any): PushOperation { + return PushOperationToJSONTyped(json, false); +} + +export function PushOperationToJSONTyped(value?: PushOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': DataTypeToJSON(value['dataType']), + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + }; +} + + +export interface BankAccountCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface BankTransactionsCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateBankAccountResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateBankTransactionResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateBankTransactionsResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateOperationGetResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateOperationsListResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface GetCreateOperationResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface ListCreateOperationsResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationsPushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * The type of data being pushed, eg invoices, customers. + * @type {DataType} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; } diff --git a/bank-feeds/src/sdk/models/shared/pushoperationchange.ts b/bank-feeds/src/sdk/models/shared/pushoperationchange.ts index 5d771700a..abc4fcc46 100644 --- a/bank-feeds/src/sdk/models/shared/pushoperationchange.ts +++ b/bank-feeds/src/sdk/models/shared/pushoperationchange.ts @@ -1,49 +1,266 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushChangeType } from './pushchangetype'; import { - PushChangeType, - PushChangeType$inboundSchema, -} from "./pushchangetype.js"; + PushChangeTypeFromJSON, + PushChangeTypeFromJSONTyped, + PushChangeTypeToJSON, + PushChangeTypeToJSONTyped, +} from './pushchangetype'; +import type { PushOperationRef } from './pushoperationref'; import { - PushOperationRef, - PushOperationRef$inboundSchema, -} from "./pushoperationref.js"; - -export type PushOperationChange = { - /** - * Type of change being applied to record in third party platform. - */ - type?: PushChangeType | undefined; - recordRef?: PushOperationRef | undefined; - /** - * Unique identifier for the attachment created otherwise null. - */ - attachmentId?: string | null | undefined; -}; - -/** @internal */ -export const PushOperationChange$inboundSchema: z.ZodType< - PushOperationChange, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushChangeType$inboundSchema.optional(), - recordRef: PushOperationRef$inboundSchema.optional(), - attachmentId: z.nullable(z.string()).optional(), -}); - -export function pushOperationChangeFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationChange$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationChange' from JSON`, - ); + PushOperationRefFromJSON, + PushOperationRefFromJSONTyped, + PushOperationRefToJSON, + PushOperationRefToJSONTyped, +} from './pushoperationref'; + +/** + * + * @export + * @interface PushOperationChange + */ +export interface PushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + + + +/** + * Check if a given object implements the PushOperationChange interface. + */ +export function instanceOfPushOperationChange(value: object): value is PushOperationChange { + return true; +} + +export function PushOperationChangeFromJSON(json: any): PushOperationChange { + return PushOperationChangeFromJSONTyped(json, false); +} + +export function PushOperationChangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationChange { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : PushChangeTypeFromJSON(json['type']), + 'recordRef': json['recordRef'] == null ? undefined : PushOperationRefFromJSON(json['recordRef']), + 'attachmentId': json['attachmentId'] == null ? undefined : json['attachmentId'], + }; +} + +export function PushOperationChangeToJSON(json: any): PushOperationChange { + return PushOperationChangeToJSONTyped(json, false); +} + +export function PushOperationChangeToJSONTyped(value?: PushOperationChange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushChangeTypeToJSON(value['type']), + 'recordRef': PushOperationRefToJSON(value['recordRef']), + 'attachmentId': value['attachmentId'], + }; +} + + +export interface BankAccountCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface BankTransactionsCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateBankAccountResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateBankTransactionResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateBankTransactionsResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateOperationGetResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface GetCreateOperationResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface PushOperationPushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/pushoperationref.ts b/bank-feeds/src/sdk/models/shared/pushoperationref.ts index 9f851e4ba..ec505ce35 100644 --- a/bank-feeds/src/sdk/models/shared/pushoperationref.ts +++ b/bank-feeds/src/sdk/models/shared/pushoperationref.ts @@ -1,40 +1,134 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { DataType, DataType$inboundSchema } from "./datatype.js"; - -export type PushOperationRef = { - /** - * Unique identifier for a push operation. - */ - id?: string | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; -}; - -/** @internal */ -export const PushOperationRef$inboundSchema: z.ZodType< - PushOperationRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - dataType: DataType$inboundSchema.optional(), -}); - -export function pushOperationRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationRef' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { DataType } from './datatype'; +import { + DataTypeFromJSON, + DataTypeFromJSONTyped, + DataTypeToJSON, + DataTypeToJSONTyped, +} from './datatype'; + +/** + * + * @export + * @interface PushOperationRef + */ +export interface PushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * + * @type {DataType} + * @memberof PushOperationRef + */ + dataType?: DataType; +} + + + +/** + * Check if a given object implements the PushOperationRef interface. + */ +export function instanceOfPushOperationRef(value: object): value is PushOperationRef { + return true; +} + +export function PushOperationRefFromJSON(json: any): PushOperationRef { + return PushOperationRefFromJSONTyped(json, false); +} + +export function PushOperationRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationRef { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : DataTypeFromJSON(json['dataType']), + }; +} + +export function PushOperationRefToJSON(json: any): PushOperationRef { + return PushOperationRefToJSONTyped(json, false); +} + +export function PushOperationRefToJSONTyped(value?: PushOperationRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'dataType': DataTypeToJSON(value['dataType']), + }; +} + + +export interface CreateBankTransactionResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * + * @type {DataType} + * @memberof PushOperationRef + */ + dataType?: DataType; +} + +export interface CreateBankTransactionsResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * + * @type {DataType} + * @memberof PushOperationRef + */ + dataType?: DataType; +} + +export interface PushOperationPushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * + * @type {DataType} + * @memberof PushOperationRef + */ + dataType?: DataType; } diff --git a/bank-feeds/src/sdk/models/shared/pushoperations.ts b/bank-feeds/src/sdk/models/shared/pushoperations.ts index 35c08c726..94a4537b9 100644 --- a/bank-feeds/src/sdk/models/shared/pushoperations.ts +++ b/bank-feeds/src/sdk/models/shared/pushoperations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { PushOperation, PushOperation$inboundSchema } from "./pushoperation.js"; - -export type PushOperations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const PushOperations$inboundSchema: z.ZodType< - PushOperations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(PushOperation$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function pushOperationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; +import type { PushOperation } from './pushoperation'; +import { + PushOperationFromJSON, + PushOperationFromJSONTyped, + PushOperationToJSON, + PushOperationToJSONTyped, +} from './pushoperation'; + +/** + * + * @export + * @interface PushOperations + */ +export interface PushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PushOperations interface. + */ +export function instanceOfPushOperations(value: object): value is PushOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PushOperationsFromJSON(json: any): PushOperations { + return PushOperationsFromJSONTyped(json, false); +} + +export function PushOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PushOperationFromJSON)), + }; +} + +export function PushOperationsToJSON(json: any): PushOperations { + return PushOperationsToJSONTyped(json, false); +} + +export function PushOperationsToJSONTyped(value?: PushOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PushOperationToJSON)), + }; +} + + +export interface CreateOperationsListResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +export interface ListCreateOperationsResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; } diff --git a/bank-feeds/src/sdk/models/shared/pushoperationstatus.ts b/bank-feeds/src/sdk/models/shared/pushoperationstatus.ts index 133e3b65f..f3d59ca5f 100644 --- a/bank-feeds/src/sdk/models/shared/pushoperationstatus.ts +++ b/bank-feeds/src/sdk/models/shared/pushoperationstatus.ts @@ -1,25 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the push operation. + * @export */ export const PushOperationStatus = { - Pending: "Pending", - Failed: "Failed", - Success: "Success", - TimedOut: "TimedOut", + Pending: 'Pending', + Failed: 'Failed', + Success: 'Success', + TimedOut: 'TimedOut' } as const; -/** - * The current status of the push operation. - */ -export type PushOperationStatus = ClosedEnum; +export type PushOperationStatus = typeof PushOperationStatus[keyof typeof PushOperationStatus]; + + +export function instanceOfPushOperationStatus(value: any): boolean { + for (const key in PushOperationStatus) { + if (Object.prototype.hasOwnProperty.call(PushOperationStatus, key)) { + if (PushOperationStatus[key as keyof typeof PushOperationStatus] === value) { + return true; + } + } + } + return false; +} + +export function PushOperationStatusFromJSON(json: any): PushOperationStatus { + return PushOperationStatusFromJSONTyped(json, false); +} + +export function PushOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationStatus { + return json as PushOperationStatus; +} + +export function PushOperationStatusToJSON(value?: PushOperationStatus | null): any { + return value as any; +} + +export function PushOperationStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOperationStatus { + return value as PushOperationStatus; +} -/** @internal */ -export const PushOperationStatus$inboundSchema: z.ZodNativeEnum< - typeof PushOperationStatus -> = z.nativeEnum(PushOperationStatus); diff --git a/bank-feeds/src/sdk/models/shared/pushoption.ts b/bank-feeds/src/sdk/models/shared/pushoption.ts index af6a0a0a3..369651c23 100644 --- a/bank-feeds/src/sdk/models/shared/pushoption.ts +++ b/bank-feeds/src/sdk/models/shared/pushoption.ts @@ -1,71 +1,327 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionProperty, - PushOptionProperty$inboundSchema, -} from "./pushoptionproperty.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; +import type { PushOptionProperty } from './pushoptionproperty'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushOptionPropertyFromJSON, + PushOptionPropertyFromJSONTyped, + PushOptionPropertyToJSON, + PushOptionPropertyToJSONTyped, +} from './pushoptionproperty'; -export type PushOption = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOption + */ +export interface PushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOption interface. + */ +export function instanceOfPushOption(value: object): value is PushOption { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} + +export function PushOptionFromJSON(json: any): PushOption { + return PushOptionFromJSONTyped(json, false); +} + +export function PushOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOption { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} -/** @internal */ -export const PushOption$inboundSchema: z.ZodType< - PushOption, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string().optional(), - required: z.boolean(), - properties: z.nullable(z.record(PushOptionProperty$inboundSchema)).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionToJSON(json: any): PushOption { + return PushOptionToJSONTyped(json, false); +} + +export function PushOptionToJSONTyped(value?: PushOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + + +export interface CreateBankAccountsModelGetResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + +export interface CreateBankTransactionsModelGetResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + +export interface GetCreateBankAccountsModelResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} -export function pushOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOption' from JSON`, - ); +export interface GetCreateBankTransactionsModelResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; } diff --git a/bank-feeds/src/sdk/models/shared/pushoptionchoice.ts b/bank-feeds/src/sdk/models/shared/pushoptionchoice.ts index 315b39f91..0ba9d674f 100644 --- a/bank-feeds/src/sdk/models/shared/pushoptionchoice.ts +++ b/bank-feeds/src/sdk/models/shared/pushoptionchoice.ts @@ -1,58 +1,272 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; - -export type PushOptionChoice = { - /** - * Allowed value for field. - */ - value?: string | undefined; - /** - * The option type. - */ - type?: PushOptionType | undefined; - /** - * The property's display name. - */ - displayName?: string | undefined; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required?: boolean | undefined; -}; - -/** @internal */ -export const PushOptionChoice$inboundSchema: z.ZodType< - PushOptionChoice, - z.ZodTypeDef, - unknown -> = z.object({ - value: z.string().optional(), - type: PushOptionType$inboundSchema.optional(), - displayName: z.string().optional(), - description: z.string().optional(), - required: z.boolean().optional(), -}); - -export function pushOptionChoiceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionChoice$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionChoice' from JSON`, - ); + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; + +/** + * + * @export + * @interface PushOptionChoice + */ +export interface PushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + + + +/** + * Check if a given object implements the PushOptionChoice interface. + */ +export function instanceOfPushOptionChoice(value: object): value is PushOptionChoice { + return true; +} + +export function PushOptionChoiceFromJSON(json: any): PushOptionChoice { + return PushOptionChoiceFromJSONTyped(json, false); +} + +export function PushOptionChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionChoice { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : json['value'], + 'type': json['type'] == null ? undefined : PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'] == null ? undefined : json['required'], + }; +} + +export function PushOptionChoiceToJSON(json: any): PushOptionChoice { + return PushOptionChoiceToJSONTyped(json, false); +} + +export function PushOptionChoiceToJSONTyped(value?: PushOptionChoice | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'], + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + }; +} + + +export interface CreateBankAccountsModelGetResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface CreateBankTransactionsModelGetResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface GetCreateBankAccountsModelResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface GetCreateBankTransactionsModelResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface PushOptionPushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; } diff --git a/bank-feeds/src/sdk/models/shared/pushoptionproperty.ts b/bank-feeds/src/sdk/models/shared/pushoptionproperty.ts index 0100bc7b6..da3db51e0 100644 --- a/bank-feeds/src/sdk/models/shared/pushoptionproperty.ts +++ b/bank-feeds/src/sdk/models/shared/pushoptionproperty.ts @@ -1,69 +1,141 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; -export type PushOptionProperty = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description: string; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOptionProperty + */ +export interface PushOptionProperty { + /** + * + * @type {PushOptionType} + * @memberof PushOptionProperty + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionProperty + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionProperty + */ + description: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionProperty + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOptionProperty + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOptionProperty + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOptionProperty + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOptionProperty interface. + */ +export function instanceOfPushOptionProperty(value: object): value is PushOptionProperty { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} -/** @internal */ -export const PushOptionProperty$inboundSchema: z.ZodType< - PushOptionProperty, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string(), - required: z.boolean(), - properties: z.nullable( - z.record(z.lazy(() => PushOptionProperty$inboundSchema)), - ).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionPropertyFromJSON(json: any): PushOptionProperty { + return PushOptionPropertyFromJSONTyped(json, false); +} + +export function PushOptionPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionProperty { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} -export function pushOptionPropertyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionProperty$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionProperty' from JSON`, - ); +export function PushOptionPropertyToJSON(json: any): PushOptionProperty { + return PushOptionPropertyToJSONTyped(json, false); } + +export function PushOptionPropertyToJSONTyped(value?: PushOptionProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + diff --git a/bank-feeds/src/sdk/models/shared/pushoptiontype.ts b/bank-feeds/src/sdk/models/shared/pushoptiontype.ts index 298c02e2e..4d2abb662 100644 --- a/bank-feeds/src/sdk/models/shared/pushoptiontype.ts +++ b/bank-feeds/src/sdk/models/shared/pushoptiontype.ts @@ -1,29 +1,59 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The option type. + * @export */ export const PushOptionType = { - Array: "Array", - Object: "Object", - String: "String", - Number: "Number", - Boolean: "Boolean", - DateTime: "DateTime", - File: "File", - MultiPart: "MultiPart", + Array: 'Array', + Object: 'Object', + String: 'String', + Number: 'Number', + Boolean: 'Boolean', + DateTime: 'DateTime', + File: 'File', + MultiPart: 'MultiPart' } as const; -/** - * The option type. - */ -export type PushOptionType = ClosedEnum; +export type PushOptionType = typeof PushOptionType[keyof typeof PushOptionType]; + + +export function instanceOfPushOptionType(value: any): boolean { + for (const key in PushOptionType) { + if (Object.prototype.hasOwnProperty.call(PushOptionType, key)) { + if (PushOptionType[key as keyof typeof PushOptionType] === value) { + return true; + } + } + } + return false; +} + +export function PushOptionTypeFromJSON(json: any): PushOptionType { + return PushOptionTypeFromJSONTyped(json, false); +} + +export function PushOptionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionType { + return json as PushOptionType; +} + +export function PushOptionTypeToJSON(value?: PushOptionType | null): any { + return value as any; +} + +export function PushOptionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOptionType { + return value as PushOptionType; +} -/** @internal */ -export const PushOptionType$inboundSchema: z.ZodNativeEnum< - typeof PushOptionType -> = z.nativeEnum(PushOptionType); diff --git a/bank-feeds/src/sdk/models/shared/pushvalidationinfo.ts b/bank-feeds/src/sdk/models/shared/pushvalidationinfo.ts index 3479adce1..9ed5abc61 100644 --- a/bank-feeds/src/sdk/models/shared/pushvalidationinfo.ts +++ b/bank-feeds/src/sdk/models/shared/pushvalidationinfo.ts @@ -1,38 +1,164 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushFieldValidation } from './pushfieldvalidation'; import { - PushFieldValidation, - PushFieldValidation$inboundSchema, -} from "./pushfieldvalidation.js"; - -export type PushValidationInfo = { - warnings?: Array | null | undefined; - information?: Array | null | undefined; -}; - -/** @internal */ -export const PushValidationInfo$inboundSchema: z.ZodType< - PushValidationInfo, - z.ZodTypeDef, - unknown -> = z.object({ - warnings: z.nullable(z.array(PushFieldValidation$inboundSchema)).optional(), - information: z.nullable(z.array(PushFieldValidation$inboundSchema)) - .optional(), -}); - -export function pushValidationInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushValidationInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushValidationInfo' from JSON`, - ); + PushFieldValidationFromJSON, + PushFieldValidationFromJSONTyped, + PushFieldValidationToJSON, + PushFieldValidationToJSONTyped, +} from './pushfieldvalidation'; + +/** + * + * @export + * @interface PushValidationInfo + */ +export interface PushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +/** + * Check if a given object implements the PushValidationInfo interface. + */ +export function instanceOfPushValidationInfo(value: object): value is PushValidationInfo { + return true; +} + +export function PushValidationInfoFromJSON(json: any): PushValidationInfo { + return PushValidationInfoFromJSONTyped(json, false); +} + +export function PushValidationInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushValidationInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(PushFieldValidationFromJSON)), + 'information': json['information'] == null ? undefined : ((json['information'] as Array).map(PushFieldValidationFromJSON)), + }; +} + +export function PushValidationInfoToJSON(json: any): PushValidationInfo { + return PushValidationInfoToJSONTyped(json, false); +} + +export function PushValidationInfoToJSONTyped(value?: PushValidationInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(PushFieldValidationToJSON)), + 'information': value['information'] == null ? undefined : ((value['information'] as Array).map(PushFieldValidationToJSON)), + }; +} + + +export interface CreateBankAccountsModelGetResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface CreateBankTransactionsModelGetResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface GetCreateBankAccountsModelResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface GetCreateBankTransactionsModelResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface PushOptionPushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; } diff --git a/bank-feeds/src/sdk/models/shared/routinginfo.ts b/bank-feeds/src/sdk/models/shared/routinginfo.ts index 14fc38575..a7d9618e2 100644 --- a/bank-feeds/src/sdk/models/shared/routinginfo.ts +++ b/bank-feeds/src/sdk/models/shared/routinginfo.ts @@ -1,92 +1,261 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import type { Type } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; /** - * The type of routing number. + * Routing information for the bank. This does not include account number. + * @export + * @interface RoutingInfo */ -export const Type = { - Rtn: "rtn", - Aba: "aba", - Swift: "swift", - Bsb: "bsb", - Iban: "iban", - Nz2: "nz2", - Trno: "trno", - Sortcode: "sortcode", - Blz: "blz", - Ifsc: "ifsc", - Bankcode: "bankcode", - Apca: "apca", - Clabe: "clabe", -} as const; +export interface RoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + + /** - * The type of routing number. + * @export */ -export type Type = ClosedEnum; +export const RoutingInfoTypeEnum = { + Rtn: 'rtn', + Aba: 'aba', + Swift: 'swift', + Bsb: 'bsb', + Iban: 'iban', + Nz2: 'nz2', + Trno: 'trno', + Sortcode: 'sortcode', + Blz: 'blz', + Ifsc: 'ifsc', + Bankcode: 'bankcode', + Apca: 'apca', + Clabe: 'clabe' +} as const; +export type RoutingInfoTypeEnum = typeof RoutingInfoTypeEnum[keyof typeof RoutingInfoTypeEnum]; + /** - * Routing information for the bank. This does not include account number. + * Check if a given object implements the RoutingInfo interface. */ -export type RoutingInfo = { - /** - * The numeric identifier of the routing number - */ - bankCode?: string | null | undefined; - /** - * The type of routing number. - */ - type?: Type | null | undefined; -}; - -/** @internal */ -export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( - Type, -); -/** @internal */ -export const Type$outboundSchema: z.ZodNativeEnum = - Type$inboundSchema; - -/** @internal */ -export const RoutingInfo$inboundSchema: z.ZodType< - RoutingInfo, - z.ZodTypeDef, - unknown -> = z.object({ - bankCode: z.nullable(z.string()).optional(), - type: z.nullable(Type$inboundSchema.default("bankcode")), -}); -/** @internal */ -export type RoutingInfo$Outbound = { - bankCode?: string | null | undefined; - type: string | null; -}; - -/** @internal */ -export const RoutingInfo$outboundSchema: z.ZodType< - RoutingInfo$Outbound, - z.ZodTypeDef, - RoutingInfo -> = z.object({ - bankCode: z.nullable(z.string()).optional(), - type: z.nullable(Type$outboundSchema.default("bankcode")), -}); - -export function routingInfoToJSON(routingInfo: RoutingInfo): string { - return JSON.stringify(RoutingInfo$outboundSchema.parse(routingInfo)); -} -export function routingInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => RoutingInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RoutingInfo' from JSON`, - ); +export function instanceOfRoutingInfo(value: object): value is RoutingInfo { + return true; +} + +export function RoutingInfoFromJSON(json: any): RoutingInfo { + return RoutingInfoFromJSONTyped(json, false); +} + +export function RoutingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoutingInfo { + if (json == null) { + return json; + } + return { + + 'bankCode': json['bankCode'] == null ? undefined : json['bankCode'], + 'type': json['type'] == null ? undefined : json['type'], + }; +} + +export function RoutingInfoToJSON(json: any): RoutingInfo { + return RoutingInfoToJSONTyped(json, false); +} + +export function RoutingInfoToJSONTyped(value?: RoutingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'bankCode': value['bankCode'], + 'type': value['type'], + }; +} + + +export interface BatchSourceAccountV2CreationResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface CreateBatchSourceAccountRequestBodyRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface CreateSourceAccountRequestBodyRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface CreateSourceAccountResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface ListSourceAccountsResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountCreateResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountStatusChangedWebhookRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountV2BatchCreateResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountV2RoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountWebhookRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; +} + +export interface SourceAccountsListResponseRoutingInfo { + /** + * The numeric identifier of the routing number + * @type {string} + * @memberof RoutingInfo + */ + bankCode?: string | null; + /** + * The type of routing number. + * @type {string} + * @memberof RoutingInfo + */ + type?: Type | null; } diff --git a/bank-feeds/src/sdk/models/shared/security.ts b/bank-feeds/src/sdk/models/shared/security.ts deleted file mode 100644 index 675eaa582..000000000 --- a/bank-feeds/src/sdk/models/shared/security.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type Security = { - authHeader: string; -}; - -/** @internal */ -export type Security$Outbound = { - auth_header: string; -}; - -/** @internal */ -export const Security$outboundSchema: z.ZodType< - Security$Outbound, - z.ZodTypeDef, - Security -> = z.object({ - authHeader: z.string(), -}).transform((v) => { - return remap$(v, { - authHeader: "auth_header", - }); -}); - -export function securityToJSON(security: Security): string { - return JSON.stringify(Security$outboundSchema.parse(security)); -} diff --git a/bank-feeds/src/sdk/models/shared/sourceaccount.ts b/bank-feeds/src/sdk/models/shared/sourceaccount.ts index a37867959..5eb9d953c 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccount.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccount.ts @@ -1,190 +1,3061 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import type { SourceAccountStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; /** - * Status of the source account. + * The target bank account in a supported accounting software for ingestion into a bank feed. + * @export + * @interface SourceAccount */ -export const SourceAccountStatus = { - Pending: "pending", - Connected: "connected", - Connecting: "connecting", - Disconnected: "disconnected", - Unknown: "unknown", -} as const; +export interface SourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + + /** - * Status of the source account. + * @export */ -export type SourceAccountStatus = ClosedEnum; +export const SourceAccountStatusEnum = { + Pending: 'pending', + Connected: 'connected', + Connecting: 'connecting', + Disconnected: 'disconnected', + Unknown: 'unknown' +} as const; +export type SourceAccountStatusEnum = typeof SourceAccountStatusEnum[keyof typeof SourceAccountStatusEnum]; + /** - * The target bank account in a supported accounting software for ingestion into a bank feed. + * Check if a given object implements the SourceAccount interface. */ -export type SourceAccount = { - /** - * Unique ID for the bank account. - */ - id: string; - /** - * The bank account name. - */ - accountName?: string | null | undefined; - /** - * The type of bank account e.g. Credit. - */ - accountType?: string | null | undefined; - /** - * The account number. - */ - accountNumber?: string | null | undefined; - /** - * The sort code. - */ - sortCode?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * The latest balance for the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - modifiedDate?: string | undefined; - /** - * Status of the source account. - */ - status?: SourceAccountStatus | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - feedStartDate?: string | undefined; -}; - -/** @internal */ -export const SourceAccountStatus$inboundSchema: z.ZodNativeEnum< - typeof SourceAccountStatus -> = z.nativeEnum(SourceAccountStatus); -/** @internal */ -export const SourceAccountStatus$outboundSchema: z.ZodNativeEnum< - typeof SourceAccountStatus -> = SourceAccountStatus$inboundSchema; - -/** @internal */ -export const SourceAccount$inboundSchema: z.ZodType< - SourceAccount, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - accountName: z.nullable(z.string()).optional(), - accountType: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - modifiedDate: z.string().optional(), - status: z.nullable(SourceAccountStatus$inboundSchema).optional(), - feedStartDate: z.string().optional(), -}); -/** @internal */ -export type SourceAccount$Outbound = { - id: string; - accountName?: string | null | undefined; - accountType?: string | null | undefined; - accountNumber?: string | null | undefined; - sortCode?: string | null | undefined; - currency?: string | undefined; - balance?: number | null | undefined; - modifiedDate?: string | undefined; - status?: string | null | undefined; - feedStartDate?: string | undefined; -}; - -/** @internal */ -export const SourceAccount$outboundSchema: z.ZodType< - SourceAccount$Outbound, - z.ZodTypeDef, - SourceAccount -> = z.object({ - id: z.string(), - accountName: z.nullable(z.string()).optional(), - accountType: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - modifiedDate: z.string().optional(), - status: z.nullable(SourceAccountStatus$outboundSchema).optional(), - feedStartDate: z.string().optional(), -}); - -export function sourceAccountToJSON(sourceAccount: SourceAccount): string { - return JSON.stringify(SourceAccount$outboundSchema.parse(sourceAccount)); -} -export function sourceAccountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccount$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccount' from JSON`, - ); +export function instanceOfSourceAccount(value: object): value is SourceAccount { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function SourceAccountFromJSON(json: any): SourceAccount { + return SourceAccountFromJSONTyped(json, false); +} + +export function SourceAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccount { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'status': json['status'] == null ? undefined : json['status'], + 'feedStartDate': json['feedStartDate'] == null ? undefined : json['feedStartDate'], + }; +} + +export function SourceAccountToJSON(json: any): SourceAccount { + return SourceAccountToJSONTyped(json, false); +} + +export function SourceAccountToJSONTyped(value?: SourceAccount | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'accountNumber': value['accountNumber'], + 'sortCode': value['sortCode'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'modifiedDate': value['modifiedDate'], + 'status': value['status'], + 'feedStartDate': value['feedStartDate'], + }; +} + + +export interface BatchSourceAccountRequestCreationResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface BatchSourceAccountRequestCreationResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface CreateBatchSourceAccountRequestBodySourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface CreateSourceAccountRequestBodySourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface CreateSourceAccountResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface CreateSourceAccountResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface ListSourceAccountsResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface ListSourceAccountsResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountBatchCreateResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountBatchCreateResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountCreateResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountCreateResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountStatusChangedWebhookSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountStatusChangedWebhookSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountUpdateRequestBody { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountUpdateResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountUpdateResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountWebhookSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountWebhookSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountsListResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface SourceAccountsListResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface UpdateSourceAccountRequestBody { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface UpdateSourceAccountResponseSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface UpdateSourceAccountResponseSourceAccountV1 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; +} + +export interface UpdateSourceAccountSourceAccount { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccount + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccount + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccount + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccount + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccount + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccount + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccount + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccount + */ + status?: SourceAccountStatus | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccount + */ + feedStartDate?: string; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresponse.ts b/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresponse.ts index fa059a961..1e7375759 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresponse.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresponse.ts @@ -1,46 +1,171 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SourceAccountBatchCreateResult } from './sourceaccountbatchcreateresult'; import { - SourceAccountBatchCreateResult, - SourceAccountBatchCreateResult$inboundSchema, -} from "./sourceaccountbatchcreateresult.js"; + SourceAccountBatchCreateResultFromJSON, + SourceAccountBatchCreateResultFromJSONTyped, + SourceAccountBatchCreateResultToJSON, + SourceAccountBatchCreateResultToJSONTyped, +} from './sourceaccountbatchcreateresult'; /** * Account ID and resulting object of the batch `Create source account` request. + * @export + * @interface SourceAccountBatchCreateResponse */ -export type SourceAccountBatchCreateResponse = { - /** - * Unique ID for the source account. - */ - sourceAccountId?: string | undefined; - /** - * Status details and corresponding object of the `Create account` operation. - */ - result?: SourceAccountBatchCreateResult | undefined; -}; - -/** @internal */ -export const SourceAccountBatchCreateResponse$inboundSchema: z.ZodType< - SourceAccountBatchCreateResponse, - z.ZodTypeDef, - unknown -> = z.object({ - sourceAccountId: z.string().optional(), - result: SourceAccountBatchCreateResult$inboundSchema.optional(), -}); - -export function sourceAccountBatchCreateResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountBatchCreateResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountBatchCreateResponse' from JSON`, - ); +export interface SourceAccountBatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +/** + * Check if a given object implements the SourceAccountBatchCreateResponse interface. + */ +export function instanceOfSourceAccountBatchCreateResponse(value: object): value is SourceAccountBatchCreateResponse { + return true; +} + +export function SourceAccountBatchCreateResponseFromJSON(json: any): SourceAccountBatchCreateResponse { + return SourceAccountBatchCreateResponseFromJSONTyped(json, false); +} + +export function SourceAccountBatchCreateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountBatchCreateResponse { + if (json == null) { + return json; + } + return { + + 'sourceAccountId': json['sourceAccountId'] == null ? undefined : json['sourceAccountId'], + 'result': json['result'] == null ? undefined : SourceAccountBatchCreateResultFromJSON(json['result']), + }; +} + +export function SourceAccountBatchCreateResponseToJSON(json: any): SourceAccountBatchCreateResponse { + return SourceAccountBatchCreateResponseToJSONTyped(json, false); +} + +export function SourceAccountBatchCreateResponseToJSONTyped(value?: SourceAccountBatchCreateResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceAccountId': value['sourceAccountId'], + 'result': SourceAccountBatchCreateResultToJSON(value['result']), + }; +} + + +export interface BatchSourceAccountCreateResponseBatchSourceAccountRequestCreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +export interface BatchSourceAccountCreateResponseSourceAccountBatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +export interface BatchSourceAccountRequestCreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +export interface CreateBatchSourceAccountResponseBatchSourceAccountRequestCreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +export interface CreateBatchSourceAccountResponseSourceAccountBatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; +} + +export interface SourceAccountBatchCreateResponseBatchSourceAccountRequestCreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchCreateResult} + * @memberof SourceAccountBatchCreateResponse + */ + result?: SourceAccountBatchCreateResult; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresult.ts b/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresult.ts index 2f7666656..8fba6afa0 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresult.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountbatchcreateresult.ts @@ -1,48 +1,173 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { SourceAccount, SourceAccount$inboundSchema } from "./sourceaccount.js"; +import { mapValues } from '../../../runtime'; +import type { SourceAccount } from './sourceaccount'; +import { + SourceAccountFromJSON, + SourceAccountFromJSONTyped, + SourceAccountToJSON, + SourceAccountToJSONTyped, +} from './sourceaccount'; /** * Status details and corresponding object of the `Create account` operation. + * @export + * @interface SourceAccountBatchCreateResult + */ +export interface SourceAccountBatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountBatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountBatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccount} + * @memberof SourceAccountBatchCreateResult + */ + account?: SourceAccount; +} + +/** + * Check if a given object implements the SourceAccountBatchCreateResult interface. */ -export type SourceAccountBatchCreateResult = { - /** - * The HTTP status code for the creation of the source account - */ - statusCode?: number | undefined; - /** - * A brief description of the error. - */ - error?: string | null | undefined; - /** - * The target bank account in a supported accounting software for ingestion into a bank feed. - */ - account?: SourceAccount | undefined; -}; - -/** @internal */ -export const SourceAccountBatchCreateResult$inboundSchema: z.ZodType< - SourceAccountBatchCreateResult, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - error: z.nullable(z.string()).optional(), - account: SourceAccount$inboundSchema.optional(), -}); - -export function sourceAccountBatchCreateResultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountBatchCreateResult$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountBatchCreateResult' from JSON`, - ); +export function instanceOfSourceAccountBatchCreateResult(value: object): value is SourceAccountBatchCreateResult { + return true; +} + +export function SourceAccountBatchCreateResultFromJSON(json: any): SourceAccountBatchCreateResult { + return SourceAccountBatchCreateResultFromJSONTyped(json, false); +} + +export function SourceAccountBatchCreateResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountBatchCreateResult { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'error': json['error'] == null ? undefined : json['error'], + 'account': json['account'] == null ? undefined : SourceAccountFromJSON(json['account']), + }; +} + +export function SourceAccountBatchCreateResultToJSON(json: any): SourceAccountBatchCreateResult { + return SourceAccountBatchCreateResultToJSONTyped(json, false); +} + +export function SourceAccountBatchCreateResultToJSONTyped(value?: SourceAccountBatchCreateResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'error': value['error'], + 'account': SourceAccountToJSON(value['account']), + }; +} + + +export interface BatchSourceAccountCreateResponseSourceAccountBatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountBatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountBatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccount} + * @memberof SourceAccountBatchCreateResult + */ + account?: SourceAccount; +} + +export interface BatchSourceAccountRequestCreationResponseSourceAccountBatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountBatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountBatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccount} + * @memberof SourceAccountBatchCreateResult + */ + account?: SourceAccount; +} + +export interface CreateBatchSourceAccountResponseSourceAccountBatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountBatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountBatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccount} + * @memberof SourceAccountBatchCreateResult + */ + account?: SourceAccount; +} + +export interface SourceAccountBatchCreateResponseSourceAccountBatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountBatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountBatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccount} + * @memberof SourceAccountBatchCreateResult + */ + account?: SourceAccount; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountbatcherrorresponse.ts b/bank-feeds/src/sdk/models/shared/sourceaccountbatcherrorresponse.ts index 2d781c13a..ae2b2dce7 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountbatcherrorresponse.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountbatcherrorresponse.ts @@ -1,67 +1,172 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Result = { - /** - * The error status code for the attempted creation of the source account. - */ - statusCode?: string | undefined; - /** - * The error description for the attempted creation of the source account. - */ - error?: string | undefined; -}; +import type { Result } from '../SourceAccountBatchErrorResponseResult'; +import { mapValues } from '../../../runtime'; +import type { SourceAccountBatchErrorResponseResult } from '../SourceAccountBatchErrorResponseResult'; +import { + SourceAccountBatchErrorResponseResultFromJSON, + SourceAccountBatchErrorResponseResultFromJSONTyped, + SourceAccountBatchErrorResponseResultToJSON, + SourceAccountBatchErrorResponseResultToJSONTyped, +} from '../SourceAccountBatchErrorResponseResult'; /** * Describes the error that occured when trying to create the specified source account. + * @export + * @interface SourceAccountBatchErrorResponse + */ +export interface SourceAccountBatchErrorResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: Result; +} + +/** + * Check if a given object implements the SourceAccountBatchErrorResponse interface. */ -export type SourceAccountBatchErrorResponse = { - /** - * Unique ID for the source account. - */ - sourceAccountId?: string | undefined; - result?: Result | undefined; -}; +export function instanceOfSourceAccountBatchErrorResponse(value: object): value is SourceAccountBatchErrorResponse { + return true; +} + +export function SourceAccountBatchErrorResponseFromJSON(json: any): SourceAccountBatchErrorResponse { + return SourceAccountBatchErrorResponseFromJSONTyped(json, false); +} -/** @internal */ -export const Result$inboundSchema: z.ZodType = z - .object({ - statusCode: z.string().optional(), - error: z.string().optional(), - }); +export function SourceAccountBatchErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountBatchErrorResponse { + if (json == null) { + return json; + } + return { + + 'sourceAccountId': json['sourceAccountId'] == null ? undefined : json['sourceAccountId'], + 'result': json['result'] == null ? undefined : SourceAccountBatchErrorResponseResultFromJSON(json['result']), + }; +} -export function resultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Result$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Result' from JSON`, - ); +export function SourceAccountBatchErrorResponseToJSON(json: any): SourceAccountBatchErrorResponse { + return SourceAccountBatchErrorResponseToJSONTyped(json, false); } -/** @internal */ -export const SourceAccountBatchErrorResponse$inboundSchema: z.ZodType< - SourceAccountBatchErrorResponse, - z.ZodTypeDef, - unknown -> = z.object({ - sourceAccountId: z.string().optional(), - result: z.lazy(() => Result$inboundSchema).optional(), -}); +export function SourceAccountBatchErrorResponseToJSONTyped(value?: SourceAccountBatchErrorResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceAccountId': value['sourceAccountId'], + 'result': SourceAccountBatchErrorResponseResultToJSON(value['result']), + }; +} + + +export interface BatchSourceAccountCreateResponseBatchSourceAccountCreationError { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; +} + +export interface BatchSourceAccountCreateResponseSourceAccountBatchErrorResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; +} + +export interface BatchSourceAccountCreationError { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; +} + +export interface CreateBatchSourceAccountResponseBatchSourceAccountCreationError { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; +} + +export interface CreateBatchSourceAccountResponseSourceAccountBatchErrorResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; +} -export function sourceAccountBatchErrorResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountBatchErrorResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountBatchErrorResponse' from JSON`, - ); +export interface SourceAccountBatchErrorResponseBatchSourceAccountCreationError { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountBatchErrorResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountBatchErrorResponseResult} + * @memberof SourceAccountBatchErrorResponse + */ + result?: SourceAccountBatchErrorResponseResult; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountprototype.ts b/bank-feeds/src/sdk/models/shared/sourceaccountprototype.ts index 02e7f4042..6221a975c 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountprototype.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountprototype.ts @@ -1,107 +1,297 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +/** + * + * @export + * @interface SourceAccountPrototype + */ +export interface SourceAccountPrototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountPrototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountPrototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountPrototype + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountPrototype + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountPrototype + */ + modifiedDate?: string; +} + +/** + * Check if a given object implements the SourceAccountPrototype interface. + */ +export function instanceOfSourceAccountPrototype(value: object): value is SourceAccountPrototype { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function SourceAccountPrototypeFromJSON(json: any): SourceAccountPrototype { + return SourceAccountPrototypeFromJSONTyped(json, false); +} -export type SourceAccountPrototype = { - /** - * Unique ID for the bank account. - */ - id: string; - /** - * The bank account name. - */ - accountName?: string | null | undefined; - /** - * The type of bank account e.g. Credit. - */ - accountType?: string | null | undefined; - /** - * The account number. - */ - accountNumber?: string | null | undefined; - /** - * The sort code. - */ - sortCode?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * The latest balance for the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - modifiedDate?: string | undefined; -}; +export function SourceAccountPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountPrototype { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + }; +} + +export function SourceAccountPrototypeToJSON(json: any): SourceAccountPrototype { + return SourceAccountPrototypeToJSONTyped(json, false); +} -/** @internal */ -export type SourceAccountPrototype$Outbound = { - id: string; - accountName?: string | null | undefined; - accountType?: string | null | undefined; - accountNumber?: string | null | undefined; - sortCode?: string | null | undefined; - currency?: string | undefined; - balance?: number | null | undefined; - modifiedDate?: string | undefined; -}; +export function SourceAccountPrototypeToJSONTyped(value?: SourceAccountPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const SourceAccountPrototype$outboundSchema: z.ZodType< - SourceAccountPrototype$Outbound, - z.ZodTypeDef, - SourceAccountPrototype -> = z.object({ - id: z.string(), - accountName: z.nullable(z.string()).optional(), - accountType: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - modifiedDate: z.string().optional(), -}); + return { + + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'accountNumber': value['accountNumber'], + 'sortCode': value['sortCode'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'modifiedDate': value['modifiedDate'], + }; +} + + +export interface CreateBatchSourceAccountRequestBodySourceAccountPrototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountPrototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountPrototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountPrototype + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountPrototype + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountPrototype + */ + modifiedDate?: string; +} -export function sourceAccountPrototypeToJSON( - sourceAccountPrototype: SourceAccountPrototype, -): string { - return JSON.stringify( - SourceAccountPrototype$outboundSchema.parse(sourceAccountPrototype), - ); +export interface CreateSourceAccountRequestBodySourceAccountPrototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountPrototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountName?: string | null; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountType?: string | null; + /** + * The account number. + * @type {string} + * @memberof SourceAccountPrototype + */ + accountNumber?: string | null; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountPrototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountPrototype + */ + currency?: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountPrototype + */ + balance?: Decimal | number | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountPrototype + */ + modifiedDate?: string; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountv2.ts b/bank-feeds/src/sdk/models/shared/sourceaccountv2.ts index 22b689c08..7ac8dda17 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountv2.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountv2.ts @@ -1,224 +1,1263 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { SourceAccountV2AccountType } from '../_speakeasy_enums'; +import type { Status } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { AccountInfo } from './accountinfo'; import { - AccountInfo, - AccountInfo$inboundSchema, - AccountInfo$Outbound, - AccountInfo$outboundSchema, -} from "./accountinfo.js"; + AccountInfoFromJSON, + AccountInfoFromJSONTyped, + AccountInfoToJSON, + AccountInfoToJSONTyped, +} from './accountinfo'; +import type { RoutingInfo } from './routinginfo'; import { - RoutingInfo, - RoutingInfo$inboundSchema, - RoutingInfo$Outbound, - RoutingInfo$outboundSchema, -} from "./routinginfo.js"; + RoutingInfoFromJSON, + RoutingInfoFromJSONTyped, + RoutingInfoToJSON, + RoutingInfoToJSONTyped, +} from './routinginfo'; /** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - */ -export const SourceAccountV2AccountType = { - Checking: "checking", - Savings: "savings", - Loan: "loan", - CreditCard: "creditCard", - PrepaidCard: "prepaidCard", -} as const; -/** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * The target bank account in a supported accounting software for ingestion into a bank feed. + * @export + * @interface SourceAccountV2 */ -export type SourceAccountV2AccountType = ClosedEnum< - typeof SourceAccountV2AccountType ->; +export interface SourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + /** - * Status of the source account. + * @export */ -export const Status = { - Pending: "pending", - Connected: "connected", - Connecting: "connecting", - Disconnected: "disconnected", - Unknown: "unknown", +export const SourceAccountV2AccountTypeEnum = { + Checking: 'checking', + Savings: 'savings', + Loan: 'loan', + CreditCard: 'creditCard', + PrepaidCard: 'prepaidCard' } as const; +export type SourceAccountV2AccountTypeEnum = typeof SourceAccountV2AccountTypeEnum[keyof typeof SourceAccountV2AccountTypeEnum]; + /** - * Status of the source account. + * @export */ -export type Status = ClosedEnum; +export const SourceAccountV2StatusEnum = { + Pending: 'pending', + Connected: 'connected', + Connecting: 'connecting', + Disconnected: 'disconnected', + Unknown: 'unknown' +} as const; +export type SourceAccountV2StatusEnum = typeof SourceAccountV2StatusEnum[keyof typeof SourceAccountV2StatusEnum]; + /** - * The target bank account in a supported accounting software for ingestion into a bank feed. + * Check if a given object implements the SourceAccountV2 interface. */ -export type SourceAccountV2 = { - /** - * Unique ID for the bank account. - */ - id: string; - /** - * The bank account name. - */ - accountName: string; - /** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - */ - accountType: SourceAccountV2AccountType; - /** - * The account number. - */ - accountNumber: string; - /** - * The sort code. - */ - sortCode?: string | null | undefined; - /** - * Routing information for the bank. This does not include account number. - */ - routingInfo?: RoutingInfo | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency: string; - /** - * The latest balance for the bank account. - */ - balance: Decimal$ | number; - accountInfo?: AccountInfo | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - modifiedDate?: string | undefined; - /** - * Status of the source account. - */ - status?: Status | null | undefined; - /** - * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: - * - * @remarks - * ``` - * 2020-10-08 - * ``` - */ - feedStartDate?: string | null | undefined; -}; - -/** @internal */ -export const SourceAccountV2AccountType$inboundSchema: z.ZodNativeEnum< - typeof SourceAccountV2AccountType -> = z.nativeEnum(SourceAccountV2AccountType); -/** @internal */ -export const SourceAccountV2AccountType$outboundSchema: z.ZodNativeEnum< - typeof SourceAccountV2AccountType -> = SourceAccountV2AccountType$inboundSchema; - -/** @internal */ -export const Status$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Status); -/** @internal */ -export const Status$outboundSchema: z.ZodNativeEnum = - Status$inboundSchema; - -/** @internal */ -export const SourceAccountV2$inboundSchema: z.ZodType< - SourceAccountV2, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - accountName: z.string(), - accountType: SourceAccountV2AccountType$inboundSchema, - accountNumber: z.string(), - sortCode: z.nullable(z.string()).optional(), - routingInfo: RoutingInfo$inboundSchema.optional(), - currency: z.string(), - balance: z.number().transform(v => new Decimal$(v)), - accountInfo: z.nullable(AccountInfo$inboundSchema).optional(), - modifiedDate: z.string().optional(), - status: z.nullable(Status$inboundSchema).optional(), - feedStartDate: z.nullable(z.string()).optional(), -}); -/** @internal */ -export type SourceAccountV2$Outbound = { - id: string; - accountName: string; - accountType: string; - accountNumber: string; - sortCode?: string | null | undefined; - routingInfo?: RoutingInfo$Outbound | undefined; - currency: string; - balance: number; - accountInfo?: AccountInfo$Outbound | null | undefined; - modifiedDate?: string | undefined; - status?: string | null | undefined; - feedStartDate?: string | null | undefined; -}; - -/** @internal */ -export const SourceAccountV2$outboundSchema: z.ZodType< - SourceAccountV2$Outbound, - z.ZodTypeDef, - SourceAccountV2 -> = z.object({ - id: z.string(), - accountName: z.string(), - accountType: SourceAccountV2AccountType$outboundSchema, - accountNumber: z.string(), - sortCode: z.nullable(z.string()).optional(), - routingInfo: RoutingInfo$outboundSchema.optional(), - currency: z.string(), - balance: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - accountInfo: z.nullable(AccountInfo$outboundSchema).optional(), - modifiedDate: z.string().optional(), - status: z.nullable(Status$outboundSchema).optional(), - feedStartDate: z.nullable(z.string()).optional(), -}); - -export function sourceAccountV2ToJSON( - sourceAccountV2: SourceAccountV2, -): string { - return JSON.stringify(SourceAccountV2$outboundSchema.parse(sourceAccountV2)); -} -export function sourceAccountV2FromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountV2$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountV2' from JSON`, - ); +export function instanceOfSourceAccountV2(value: object): value is SourceAccountV2 { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('accountName' in value) || value['accountName'] === undefined) return false; + if (!('accountType' in value) || value['accountType'] === undefined) return false; + if (!('accountNumber' in value) || value['accountNumber'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + if (!('balance' in value) || value['balance'] === undefined) return false; + return true; +} + +export function SourceAccountV2FromJSON(json: any): SourceAccountV2 { + return SourceAccountV2FromJSONTyped(json, false); +} + +export function SourceAccountV2FromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountV2 { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'accountName': json['accountName'], + 'accountType': json['accountType'], + 'accountNumber': json['accountNumber'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'routingInfo': json['routingInfo'] == null ? undefined : RoutingInfoFromJSON(json['routingInfo']), + 'currency': json['currency'], + 'balance': json['balance'], + 'accountInfo': json['accountInfo'] == null ? undefined : AccountInfoFromJSON(json['accountInfo']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'status': json['status'] == null ? undefined : json['status'], + 'feedStartDate': json['feedStartDate'] == null ? undefined : json['feedStartDate'], + }; +} + +export function SourceAccountV2ToJSON(json: any): SourceAccountV2 { + return SourceAccountV2ToJSONTyped(json, false); +} + +export function SourceAccountV2ToJSONTyped(value?: SourceAccountV2 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'accountNumber': value['accountNumber'], + 'sortCode': value['sortCode'], + 'routingInfo': RoutingInfoToJSON(value['routingInfo']), + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'accountInfo': AccountInfoToJSON(value['accountInfo']), + 'modifiedDate': value['modifiedDate'], + 'status': value['status'], + 'feedStartDate': value['feedStartDate'], + }; +} + + +export interface BatchSourceAccountV2CreationResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface CreateBatchSourceAccountRequestBodySourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface CreateSourceAccountRequestBodySourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface CreateSourceAccountResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface ListSourceAccountsResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface SourceAccountCreateResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface SourceAccountStatusChangedWebhookSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface SourceAccountV2BatchCreateResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface SourceAccountWebhookSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; +} + +export interface SourceAccountsListResponseSourceAccountV2 { + [key: string]: any | any; + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2 + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2 + */ + accountName: string; + /** + * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. + * @type {string} + * @memberof SourceAccountV2 + */ + accountType: SourceAccountV2AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2 + */ + accountNumber: string; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2 + */ + sortCode?: string | null; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2 + */ + routingInfo?: RoutingInfo; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2 + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2 + */ + balance: Decimal | number; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2 + */ + accountInfo?: AccountInfo | null; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2 + */ + modifiedDate?: string; + /** + * Status of the source account. + * @type {string} + * @memberof SourceAccountV2 + */ + status?: Status | null; + /** + * In Codat's data model, dates are represented using the ISO 8601 standard. Date fields are formatted as strings; for example: + * ``` + * 2020-10-08 + * ``` + * @type {string} + * @memberof SourceAccountV2 + */ + feedStartDate?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts b/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts index 4dd9910be..c89584bb9 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresponse.ts @@ -1,47 +1,171 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SourceAccountV2BatchCreateResult } from './sourceaccountv2batchcreateresult'; import { - SourceAccountV2BatchCreateResult, - SourceAccountV2BatchCreateResult$inboundSchema, -} from "./sourceaccountv2batchcreateresult.js"; + SourceAccountV2BatchCreateResultFromJSON, + SourceAccountV2BatchCreateResultFromJSONTyped, + SourceAccountV2BatchCreateResultToJSON, + SourceAccountV2BatchCreateResultToJSONTyped, +} from './sourceaccountv2batchcreateresult'; /** * Account ID and resulting object of the batch `Create source account` request. + * @export + * @interface SourceAccountV2BatchCreateResponse */ -export type SourceAccountV2BatchCreateResponse = { - /** - * Unique ID for the source account. - */ - sourceAccountId?: string | undefined; - /** - * Status details and corresponding object of the `Create account` operation. - */ - result?: SourceAccountV2BatchCreateResult | undefined; -}; - -/** @internal */ -export const SourceAccountV2BatchCreateResponse$inboundSchema: z.ZodType< - SourceAccountV2BatchCreateResponse, - z.ZodTypeDef, - unknown -> = z.object({ - sourceAccountId: z.string().optional(), - result: SourceAccountV2BatchCreateResult$inboundSchema.optional(), -}); - -export function sourceAccountV2BatchCreateResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - SourceAccountV2BatchCreateResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountV2BatchCreateResponse' from JSON`, - ); +export interface SourceAccountV2BatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +/** + * Check if a given object implements the SourceAccountV2BatchCreateResponse interface. + */ +export function instanceOfSourceAccountV2BatchCreateResponse(value: object): value is SourceAccountV2BatchCreateResponse { + return true; +} + +export function SourceAccountV2BatchCreateResponseFromJSON(json: any): SourceAccountV2BatchCreateResponse { + return SourceAccountV2BatchCreateResponseFromJSONTyped(json, false); +} + +export function SourceAccountV2BatchCreateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountV2BatchCreateResponse { + if (json == null) { + return json; + } + return { + + 'sourceAccountId': json['sourceAccountId'] == null ? undefined : json['sourceAccountId'], + 'result': json['result'] == null ? undefined : SourceAccountV2BatchCreateResultFromJSON(json['result']), + }; +} + +export function SourceAccountV2BatchCreateResponseToJSON(json: any): SourceAccountV2BatchCreateResponse { + return SourceAccountV2BatchCreateResponseToJSONTyped(json, false); +} + +export function SourceAccountV2BatchCreateResponseToJSONTyped(value?: SourceAccountV2BatchCreateResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceAccountId': value['sourceAccountId'], + 'result': SourceAccountV2BatchCreateResultToJSON(value['result']), + }; +} + + +export interface BatchSourceAccountCreateResponseBatchSourceAccountV2CreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +export interface BatchSourceAccountCreateResponseSourceAccountV2BatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +export interface BatchSourceAccountV2CreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +export interface CreateBatchSourceAccountResponseBatchSourceAccountV2CreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +export interface CreateBatchSourceAccountResponseSourceAccountV2BatchCreateResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; +} + +export interface SourceAccountV2BatchCreateResponseBatchSourceAccountV2CreationResponse { + /** + * Unique ID for the source account. + * @type {string} + * @memberof SourceAccountV2BatchCreateResponse + */ + sourceAccountId?: string; + /** + * + * @type {SourceAccountV2BatchCreateResult} + * @memberof SourceAccountV2BatchCreateResponse + */ + result?: SourceAccountV2BatchCreateResult; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresult.ts b/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresult.ts index ab92e513a..e415666a4 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresult.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountv2batchcreateresult.ts @@ -1,51 +1,173 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SourceAccountV2 } from './sourceaccountv2'; import { - SourceAccountV2, - SourceAccountV2$inboundSchema, -} from "./sourceaccountv2.js"; + SourceAccountV2FromJSON, + SourceAccountV2FromJSONTyped, + SourceAccountV2ToJSON, + SourceAccountV2ToJSONTyped, +} from './sourceaccountv2'; /** * Status details and corresponding object of the `Create account` operation. + * @export + * @interface SourceAccountV2BatchCreateResult + */ +export interface SourceAccountV2BatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountV2BatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountV2BatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccountV2} + * @memberof SourceAccountV2BatchCreateResult + */ + account?: SourceAccountV2; +} + +/** + * Check if a given object implements the SourceAccountV2BatchCreateResult interface. */ -export type SourceAccountV2BatchCreateResult = { - /** - * The HTTP status code for the creation of the source account - */ - statusCode?: number | undefined; - /** - * A brief description of the error. - */ - error?: string | null | undefined; - /** - * The target bank account in a supported accounting software for ingestion into a bank feed. - */ - account?: SourceAccountV2 | undefined; -}; - -/** @internal */ -export const SourceAccountV2BatchCreateResult$inboundSchema: z.ZodType< - SourceAccountV2BatchCreateResult, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - error: z.nullable(z.string()).optional(), - account: SourceAccountV2$inboundSchema.optional(), -}); - -export function sourceAccountV2BatchCreateResultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountV2BatchCreateResult$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountV2BatchCreateResult' from JSON`, - ); +export function instanceOfSourceAccountV2BatchCreateResult(value: object): value is SourceAccountV2BatchCreateResult { + return true; +} + +export function SourceAccountV2BatchCreateResultFromJSON(json: any): SourceAccountV2BatchCreateResult { + return SourceAccountV2BatchCreateResultFromJSONTyped(json, false); +} + +export function SourceAccountV2BatchCreateResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountV2BatchCreateResult { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'error': json['error'] == null ? undefined : json['error'], + 'account': json['account'] == null ? undefined : SourceAccountV2FromJSON(json['account']), + }; +} + +export function SourceAccountV2BatchCreateResultToJSON(json: any): SourceAccountV2BatchCreateResult { + return SourceAccountV2BatchCreateResultToJSONTyped(json, false); +} + +export function SourceAccountV2BatchCreateResultToJSONTyped(value?: SourceAccountV2BatchCreateResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'error': value['error'], + 'account': SourceAccountV2ToJSON(value['account']), + }; +} + + +export interface BatchSourceAccountCreateResponseSourceAccountV2BatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountV2BatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountV2BatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccountV2} + * @memberof SourceAccountV2BatchCreateResult + */ + account?: SourceAccountV2; +} + +export interface BatchSourceAccountV2CreationResponseSourceAccountV2BatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountV2BatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountV2BatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccountV2} + * @memberof SourceAccountV2BatchCreateResult + */ + account?: SourceAccountV2; +} + +export interface CreateBatchSourceAccountResponseSourceAccountV2BatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountV2BatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountV2BatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccountV2} + * @memberof SourceAccountV2BatchCreateResult + */ + account?: SourceAccountV2; +} + +export interface SourceAccountV2BatchCreateResponseSourceAccountV2BatchCreateResult { + /** + * The HTTP status code for the creation of the source account + * @type {number} + * @memberof SourceAccountV2BatchCreateResult + */ + statusCode?: number; + /** + * A brief description of the error. + * @type {string} + * @memberof SourceAccountV2BatchCreateResult + */ + error?: string | null; + /** + * + * @type {SourceAccountV2} + * @memberof SourceAccountV2BatchCreateResult + */ + account?: SourceAccountV2; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountv2prototype.ts b/bank-feeds/src/sdk/models/shared/sourceaccountv2prototype.ts index 40ed03791..f9ebfca7c 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountv2prototype.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountv2prototype.ts @@ -1,125 +1,358 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import type { AccountType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { AccountInfo } from './accountinfo'; import { - AccountInfo, - AccountInfo$Outbound, - AccountInfo$outboundSchema, -} from "./accountinfo.js"; -import { AccountType, AccountType$outboundSchema } from "./accounttype.js"; + AccountInfoFromJSON, + AccountInfoFromJSONTyped, + AccountInfoToJSON, + AccountInfoToJSONTyped, +} from './accountinfo'; +import type { RoutingInfo } from './routinginfo'; import { - RoutingInfo, - RoutingInfo$Outbound, - RoutingInfo$outboundSchema, -} from "./routinginfo.js"; + RoutingInfoFromJSON, + RoutingInfoFromJSONTyped, + RoutingInfoToJSON, + RoutingInfoToJSONTyped, +} from './routinginfo'; -export type SourceAccountV2Prototype = { - /** - * Unique ID for the bank account. - */ - id: string; - /** - * The bank account name. - */ - accountName: string; - /** - * The type of bank account e.g. checking, savings, loan, creditCard, prepaidCard. - */ - accountType: AccountType; - /** - * The account number. - */ - accountNumber: string; - /** - * Routing information for the bank. This does not include account number. - */ - routingInfo?: RoutingInfo | undefined; - /** - * The sort code. - */ - sortCode?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency: string; - /** - * The latest balance for the bank account. - */ - balance: Decimal$ | number; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - modifiedDate?: string | undefined; - accountInfo?: AccountInfo | null | undefined; -}; +/** + * + * @export + * @interface SourceAccountV2Prototype + */ +export interface SourceAccountV2Prototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountName: string; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountType: AccountType; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountNumber: string; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2Prototype + */ + routingInfo?: RoutingInfo; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2Prototype + */ + balance: Decimal | number; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + modifiedDate?: string; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2Prototype + */ + accountInfo?: AccountInfo | null; +} + +/** + * Check if a given object implements the SourceAccountV2Prototype interface. + */ +export function instanceOfSourceAccountV2Prototype(value: object): value is SourceAccountV2Prototype { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('accountName' in value) || value['accountName'] === undefined) return false; + if (!('accountType' in value) || value['accountType'] === undefined) return false; + if (!('accountNumber' in value) || value['accountNumber'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + if (!('balance' in value) || value['balance'] === undefined) return false; + return true; +} + +export function SourceAccountV2PrototypeFromJSON(json: any): SourceAccountV2Prototype { + return SourceAccountV2PrototypeFromJSONTyped(json, false); +} -/** @internal */ -export type SourceAccountV2Prototype$Outbound = { - id: string; - accountName: string; - accountType: string; - accountNumber: string; - routingInfo?: RoutingInfo$Outbound | undefined; - sortCode?: string | null | undefined; - currency: string; - balance: number; - modifiedDate?: string | undefined; - accountInfo?: AccountInfo$Outbound | null | undefined; -}; +export function SourceAccountV2PrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountV2Prototype { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'accountName': json['accountName'], + 'accountType': json['accountType'], + 'accountNumber': json['accountNumber'], + 'routingInfo': json['routingInfo'] == null ? undefined : RoutingInfoFromJSON(json['routingInfo']), + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'currency': json['currency'], + 'balance': json['balance'], + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'accountInfo': json['accountInfo'] == null ? undefined : AccountInfoFromJSON(json['accountInfo']), + }; +} -/** @internal */ -export const SourceAccountV2Prototype$outboundSchema: z.ZodType< - SourceAccountV2Prototype$Outbound, - z.ZodTypeDef, - SourceAccountV2Prototype -> = z.object({ - id: z.string(), - accountName: z.string(), - accountType: AccountType$outboundSchema, - accountNumber: z.string(), - routingInfo: RoutingInfo$outboundSchema.optional(), - sortCode: z.nullable(z.string()).optional(), - currency: z.string(), - balance: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - modifiedDate: z.string().optional(), - accountInfo: z.nullable(AccountInfo$outboundSchema).optional(), -}); +export function SourceAccountV2PrototypeToJSON(json: any): SourceAccountV2Prototype { + return SourceAccountV2PrototypeToJSONTyped(json, false); +} + +export function SourceAccountV2PrototypeToJSONTyped(value?: SourceAccountV2Prototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'accountNumber': value['accountNumber'], + 'routingInfo': RoutingInfoToJSON(value['routingInfo']), + 'sortCode': value['sortCode'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'modifiedDate': value['modifiedDate'], + 'accountInfo': AccountInfoToJSON(value['accountInfo']), + }; +} + + +export interface CreateBatchSourceAccountRequestBodySourceAccountV2Prototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountName: string; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountType: string; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountNumber: string; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2Prototype + */ + routingInfo?: RoutingInfo; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2Prototype + */ + balance: Decimal | number; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + modifiedDate?: string; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2Prototype + */ + accountInfo?: AccountInfo | null; +} -export function sourceAccountV2PrototypeToJSON( - sourceAccountV2Prototype: SourceAccountV2Prototype, -): string { - return JSON.stringify( - SourceAccountV2Prototype$outboundSchema.parse(sourceAccountV2Prototype), - ); +export interface CreateSourceAccountRequestBodySourceAccountV2Prototype { + /** + * Unique ID for the bank account. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + id: string; + /** + * The bank account name. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountName: string; + /** + * The type of bank account e.g. Credit. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountType: string; + /** + * The account number. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + accountNumber: string; + /** + * + * @type {RoutingInfo} + * @memberof SourceAccountV2Prototype + */ + routingInfo?: RoutingInfo; + /** + * The sort code. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + sortCode?: string | null; + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + currency: string; + /** + * The latest balance for the bank account. + * @type {number} + * @memberof SourceAccountV2Prototype + */ + balance: Decimal | number; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountV2Prototype + */ + modifiedDate?: string; + /** + * + * @type {AccountInfo} + * @memberof SourceAccountV2Prototype + */ + accountInfo?: AccountInfo | null; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountwebhook.ts b/bank-feeds/src/sdk/models/shared/sourceaccountwebhook.ts index 60b37d13f..a2ed14e1c 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountwebhook.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountwebhook.ts @@ -1,96 +1,205 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SourceAccountWebhookPayload } from './sourceaccountwebhookpayload'; import { - SourceAccountWebhookPayload, - SourceAccountWebhookPayload$inboundSchema, - SourceAccountWebhookPayload$Outbound, - SourceAccountWebhookPayload$outboundSchema, -} from "./sourceaccountwebhookpayload.js"; + SourceAccountWebhookPayloadFromJSON, + SourceAccountWebhookPayloadFromJSONTyped, + SourceAccountWebhookPayloadToJSON, + SourceAccountWebhookPayloadToJSONTyped, +} from './sourceaccountwebhookpayload'; -export type SourceAccountWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - generatedDate?: string | undefined; - payload?: SourceAccountWebhookPayload | undefined; -}; +/** + * + * @export + * @interface SourceAccountWebhook + */ +export interface SourceAccountWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof SourceAccountWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof SourceAccountWebhook + */ + eventType?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountWebhook + */ + generatedDate?: string; + /** + * + * @type {SourceAccountWebhookPayload} + * @memberof SourceAccountWebhook + */ + payload?: SourceAccountWebhookPayload; +} + +/** + * Check if a given object implements the SourceAccountWebhook interface. + */ +export function instanceOfSourceAccountWebhook(value: object): value is SourceAccountWebhook { + return true; +} + +export function SourceAccountWebhookFromJSON(json: any): SourceAccountWebhook { + return SourceAccountWebhookFromJSONTyped(json, false); +} -/** @internal */ -export const SourceAccountWebhook$inboundSchema: z.ZodType< - SourceAccountWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: SourceAccountWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type SourceAccountWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: SourceAccountWebhookPayload$Outbound | undefined; -}; +export function SourceAccountWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : SourceAccountWebhookPayloadFromJSON(json['payload']), + }; +} + +export function SourceAccountWebhookToJSON(json: any): SourceAccountWebhook { + return SourceAccountWebhookToJSONTyped(json, false); +} -/** @internal */ -export const SourceAccountWebhook$outboundSchema: z.ZodType< - SourceAccountWebhook$Outbound, - z.ZodTypeDef, - SourceAccountWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: SourceAccountWebhookPayload$outboundSchema.optional(), -}); +export function SourceAccountWebhookToJSONTyped(value?: SourceAccountWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function sourceAccountWebhookToJSON( - sourceAccountWebhook: SourceAccountWebhook, -): string { - return JSON.stringify( - SourceAccountWebhook$outboundSchema.parse(sourceAccountWebhook), - ); + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': SourceAccountWebhookPayloadToJSON(value['payload']), + }; } -export function sourceAccountWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountWebhook' from JSON`, - ); + + +export interface SourceAccountStatusChangedWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof SourceAccountWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof SourceAccountWebhook + */ + eventType?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountWebhook + */ + generatedDate?: string; + /** + * + * @type {SourceAccountWebhookPayload} + * @memberof SourceAccountWebhook + */ + payload?: SourceAccountWebhookPayload; +} + +export interface SourceAccountWebhookSourceAccountStatusChangedWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof SourceAccountWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof SourceAccountWebhook + */ + eventType?: string; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + * @type {string} + * @memberof SourceAccountWebhook + */ + generatedDate?: string; + /** + * + * @type {SourceAccountWebhookPayload} + * @memberof SourceAccountWebhook + */ + payload?: SourceAccountWebhookPayload; } diff --git a/bank-feeds/src/sdk/models/shared/sourceaccountwebhookpayload.ts b/bank-feeds/src/sdk/models/shared/sourceaccountwebhookpayload.ts index dc27e1b29..4a64ad782 100644 --- a/bank-feeds/src/sdk/models/shared/sourceaccountwebhookpayload.ts +++ b/bank-feeds/src/sdk/models/shared/sourceaccountwebhookpayload.ts @@ -1,143 +1,160 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { SourceAccount } from './sourceaccount'; +import type { SourceAccountV2 } from './sourceaccountv2'; +import { mapValues } from '../../../runtime'; +import type { CreateSourceAccount200Response } from '../CreateSourceAccount200Response'; import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; + CreateSourceAccount200ResponseFromJSON, + CreateSourceAccount200ResponseFromJSONTyped, + CreateSourceAccount200ResponseToJSON, + CreateSourceAccount200ResponseToJSONTyped, +} from '../CreateSourceAccount200Response'; +import type { CompanyReference } from './companyreference'; import { - SourceAccount, - SourceAccount$inboundSchema, - SourceAccount$Outbound, - SourceAccount$outboundSchema, -} from "./sourceaccount.js"; -import { - SourceAccountV2, - SourceAccountV2$inboundSchema, - SourceAccountV2$Outbound, - SourceAccountV2$outboundSchema, -} from "./sourceaccountv2.js"; - -export type SourceAccountWebhookPayloadSourceAccount = - | SourceAccountV2 - | SourceAccount; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; -export type SourceAccountWebhookPayload = { - referenceCompany?: CompanyReference | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId?: string | undefined; - /** - * Unique identifier for a company's data connection. - */ - connectionId?: string | undefined; - sourceAccount?: SourceAccountV2 | SourceAccount | undefined; -}; +/** + * + * @export + * @interface SourceAccountWebhookPayload + */ +export interface SourceAccountWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof SourceAccountWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + companyId?: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + connectionId?: string; + /** + * + * @type {CreateSourceAccount200Response} + * @memberof SourceAccountWebhookPayload + */ + sourceAccount?: SourceAccountV2 | SourceAccount; +} -/** @internal */ -export const SourceAccountWebhookPayloadSourceAccount$inboundSchema: z.ZodType< - SourceAccountWebhookPayloadSourceAccount, - z.ZodTypeDef, - unknown -> = z.union([SourceAccountV2$inboundSchema, SourceAccount$inboundSchema]); -/** @internal */ -export type SourceAccountWebhookPayloadSourceAccount$Outbound = - | SourceAccountV2$Outbound - | SourceAccount$Outbound; +/** + * Check if a given object implements the SourceAccountWebhookPayload interface. + */ +export function instanceOfSourceAccountWebhookPayload(value: object): value is SourceAccountWebhookPayload { + return true; +} -/** @internal */ -export const SourceAccountWebhookPayloadSourceAccount$outboundSchema: z.ZodType< - SourceAccountWebhookPayloadSourceAccount$Outbound, - z.ZodTypeDef, - SourceAccountWebhookPayloadSourceAccount -> = z.union([SourceAccountV2$outboundSchema, SourceAccount$outboundSchema]); +export function SourceAccountWebhookPayloadFromJSON(json: any): SourceAccountWebhookPayload { + return SourceAccountWebhookPayloadFromJSONTyped(json, false); +} -export function sourceAccountWebhookPayloadSourceAccountToJSON( - sourceAccountWebhookPayloadSourceAccount: - SourceAccountWebhookPayloadSourceAccount, -): string { - return JSON.stringify( - SourceAccountWebhookPayloadSourceAccount$outboundSchema.parse( - sourceAccountWebhookPayloadSourceAccount, - ), - ); +export function SourceAccountWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAccountWebhookPayload { + if (json == null) { + return json; + } + return { + + 'referenceCompany': json['referenceCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceCompany']), + 'companyId': json['companyId'] == null ? undefined : json['companyId'], + 'connectionId': json['connectionId'] == null ? undefined : json['connectionId'], + 'sourceAccount': json['sourceAccount'] == null ? undefined : CreateSourceAccount200ResponseFromJSON(json['sourceAccount']), + }; } -export function sourceAccountWebhookPayloadSourceAccountFromJSON( - jsonString: string, -): SafeParseResult< - SourceAccountWebhookPayloadSourceAccount, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - SourceAccountWebhookPayloadSourceAccount$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'SourceAccountWebhookPayloadSourceAccount' from JSON`, - ); + +export function SourceAccountWebhookPayloadToJSON(json: any): SourceAccountWebhookPayload { + return SourceAccountWebhookPayloadToJSONTyped(json, false); } -/** @internal */ -export const SourceAccountWebhookPayload$inboundSchema: z.ZodType< - SourceAccountWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - referenceCompany: CompanyReference$inboundSchema.optional(), - companyId: z.string().optional(), - connectionId: z.string().optional(), - sourceAccount: z.union([ - SourceAccountV2$inboundSchema, - SourceAccount$inboundSchema, - ]).optional(), -}); -/** @internal */ -export type SourceAccountWebhookPayload$Outbound = { - referenceCompany?: CompanyReference$Outbound | undefined; - companyId?: string | undefined; - connectionId?: string | undefined; - sourceAccount?: SourceAccountV2$Outbound | SourceAccount$Outbound | undefined; -}; +export function SourceAccountWebhookPayloadToJSONTyped(value?: SourceAccountWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const SourceAccountWebhookPayload$outboundSchema: z.ZodType< - SourceAccountWebhookPayload$Outbound, - z.ZodTypeDef, - SourceAccountWebhookPayload -> = z.object({ - referenceCompany: CompanyReference$outboundSchema.optional(), - companyId: z.string().optional(), - connectionId: z.string().optional(), - sourceAccount: z.union([ - SourceAccountV2$outboundSchema, - SourceAccount$outboundSchema, - ]).optional(), -}); + return { + + 'referenceCompany': CompanyReferenceToJSON(value['referenceCompany']), + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'sourceAccount': CreateSourceAccount200ResponseToJSON(value['sourceAccount']), + }; +} -export function sourceAccountWebhookPayloadToJSON( - sourceAccountWebhookPayload: SourceAccountWebhookPayload, -): string { - return JSON.stringify( - SourceAccountWebhookPayload$outboundSchema.parse( - sourceAccountWebhookPayload, - ), - ); + +export interface SourceAccountStatusChangedWebhookSourceAccountWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof SourceAccountWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + companyId?: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + connectionId?: string; + /** + * + * @type {CreateSourceAccount200Response} + * @memberof SourceAccountWebhookPayload + */ + sourceAccount?: SourceAccountV2 | SourceAccount; } -export function sourceAccountWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SourceAccountWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SourceAccountWebhookPayload' from JSON`, - ); + +export interface SourceAccountWebhookSourceAccountWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof SourceAccountWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + companyId?: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof SourceAccountWebhookPayload + */ + connectionId?: string; + /** + * + * @type {CreateSourceAccount200Response} + * @memberof SourceAccountWebhookPayload + */ + sourceAccount?: SourceAccountV2 | SourceAccount; } diff --git a/bank-feeds/src/sdk/models/shared/startscheduledsyncresult.ts b/bank-feeds/src/sdk/models/shared/startscheduledsyncresult.ts index 33d6da3a6..a2a8b2767 100644 --- a/bank-feeds/src/sdk/models/shared/startscheduledsyncresult.ts +++ b/bank-feeds/src/sdk/models/shared/startscheduledsyncresult.ts @@ -1,37 +1,75 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Represents the result of an ad-hoc sync request. + * @export + * @interface StartScheduledSyncResult */ -export type StartScheduledSyncResult = { - /** - * The unique identifier for the created sync. - */ - syncId: string; -}; - -/** @internal */ -export const StartScheduledSyncResult$inboundSchema: z.ZodType< - StartScheduledSyncResult, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string(), -}); - -export function startScheduledSyncResultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => StartScheduledSyncResult$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'StartScheduledSyncResult' from JSON`, - ); +export interface StartScheduledSyncResult { + /** + * The unique identifier for the created sync. + * @type {string} + * @memberof StartScheduledSyncResult + */ + syncId: string; +} + +/** + * Check if a given object implements the StartScheduledSyncResult interface. + */ +export function instanceOfStartScheduledSyncResult(value: object): value is StartScheduledSyncResult { + if (!('syncId' in value) || value['syncId'] === undefined) return false; + return true; +} + +export function StartScheduledSyncResultFromJSON(json: any): StartScheduledSyncResult { + return StartScheduledSyncResultFromJSONTyped(json, false); +} + +export function StartScheduledSyncResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): StartScheduledSyncResult { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'], + }; +} + +export function StartScheduledSyncResultToJSON(json: any): StartScheduledSyncResult { + return StartScheduledSyncResultToJSONTyped(json, false); +} + +export function StartScheduledSyncResultToJSONTyped(value?: StartScheduledSyncResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface RunManagedBankFeedAdHocSyncResponseStartScheduledSyncResult { + /** + * The unique identifier for the created sync. + * @type {string} + * @memberof StartScheduledSyncResult + */ + syncId: string; } diff --git a/bank-feeds/src/sdk/models/shared/supplementaldata.ts b/bank-feeds/src/sdk/models/shared/supplementaldata.ts new file mode 100644 index 000000000..221e48fbd --- /dev/null +++ b/bank-feeds/src/sdk/models/shared/supplementaldata.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + * @export + * @interface SupplementalData + */ +export interface SupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +/** + * Check if a given object implements the SupplementalData interface. + */ +export function instanceOfSupplementalData(value: object): value is SupplementalData { + return true; +} + +export function SupplementalDataFromJSON(json: any): SupplementalData { + return SupplementalDataFromJSONTyped(json, false); +} + +export function SupplementalDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplementalData { + if (json == null) { + return json; + } + return { + + 'content': json['content'] == null ? undefined : json['content'], + }; +} + +export function SupplementalDataToJSON(json: any): SupplementalData { + return SupplementalDataToJSONTyped(json, false); +} + +export function SupplementalDataToJSONTyped(value?: SupplementalData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'content': value['content'], + }; +} + + +export interface AccountingBankAccountsSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface BankAccountCreateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface BankAccountsSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CreateBankAccountResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} diff --git a/bank-feeds/src/sdk/models/shared/syncstatusresult.ts b/bank-feeds/src/sdk/models/shared/syncstatusresult.ts index ee12fa169..dee194f71 100644 --- a/bank-feeds/src/sdk/models/shared/syncstatusresult.ts +++ b/bank-feeds/src/sdk/models/shared/syncstatusresult.ts @@ -1,110 +1,1049 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import { mapValues } from '../../../runtime'; /** * Represents the status of a managed bank feed sync. + * @export + * @interface SyncStatusResult */ -export type SyncStatusResult = { - /** - * The unique identifier for the sync. - */ - syncId: string; - /** - * The ID of the client associated with the company that owns the source bank account. - */ - clientId: string; - /** - * The ID of the company that owns the source bank account. - */ - companyId: string; - /** - * The name of the company that owns the source bank account. - */ - companyName: string; - /** - * The ID of the target accounting data connection. - */ - dataConnectionId: string; - /** - * The ID of the source bank account from which transactions are fetched. - */ - sourceAccountId: string; - /** - * The start of the sync period. - */ - periodStartUtc: Date; - /** - * The end of the sync period. - */ - periodEndUtc: Date; - /** - * The UTC timestamp when the sync started executing. - */ - executionStartUtc: Date; - /** - * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. - */ - status: string; - /** - * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). - */ - executionEndUtc?: Date | null | undefined; - /** - * Error message if the sync failed. - */ - errorMessage?: string | null | undefined; - /** - * Error code if the sync failed. - */ - errorCode?: string | null | undefined; - /** - * List of write operation keys associated with the sync, if the sync resulted in write attempts. - */ - pushOperationKeys?: Array | null | undefined; -}; - -/** @internal */ -export const SyncStatusResult$inboundSchema: z.ZodType< - SyncStatusResult, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string(), - clientId: z.string(), - companyId: z.string(), - companyName: z.string(), - dataConnectionId: z.string(), - sourceAccountId: z.string(), - periodStartUtc: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - periodEndUtc: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - executionStartUtc: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - status: z.string(), - executionEndUtc: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), - ).optional(), - errorMessage: z.nullable(z.string()).optional(), - errorCode: z.nullable(z.string()).optional(), - pushOperationKeys: z.nullable(z.array(z.string())).optional(), -}); - -export function syncStatusResultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SyncStatusResult$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SyncStatusResult' from JSON`, - ); +export interface SyncStatusResult { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +/** + * Check if a given object implements the SyncStatusResult interface. + */ +export function instanceOfSyncStatusResult(value: object): value is SyncStatusResult { + if (!('syncId' in value) || value['syncId'] === undefined) return false; + if (!('clientId' in value) || value['clientId'] === undefined) return false; + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('companyName' in value) || value['companyName'] === undefined) return false; + if (!('dataConnectionId' in value) || value['dataConnectionId'] === undefined) return false; + if (!('sourceAccountId' in value) || value['sourceAccountId'] === undefined) return false; + if (!('periodStartUtc' in value) || value['periodStartUtc'] === undefined) return false; + if (!('periodEndUtc' in value) || value['periodEndUtc'] === undefined) return false; + if (!('executionStartUtc' in value) || value['executionStartUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function SyncStatusResultFromJSON(json: any): SyncStatusResult { + return SyncStatusResultFromJSONTyped(json, false); +} + +export function SyncStatusResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncStatusResult { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'], + 'clientId': json['clientId'], + 'companyId': json['companyId'], + 'companyName': json['companyName'], + 'dataConnectionId': json['dataConnectionId'], + 'sourceAccountId': json['sourceAccountId'], + 'periodStartUtc': json['periodStartUtc'], + 'periodEndUtc': json['periodEndUtc'], + 'executionStartUtc': json['executionStartUtc'], + 'status': json['status'], + 'executionEndUtc': json['executionEndUtc'] == null ? undefined : json['executionEndUtc'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'errorCode': json['errorCode'] == null ? undefined : json['errorCode'], + 'pushOperationKeys': json['pushOperationKeys'] == null ? undefined : json['pushOperationKeys'], + }; +} + +export function SyncStatusResultToJSON(json: any): SyncStatusResult { + return SyncStatusResultToJSONTyped(json, false); +} + +export function SyncStatusResultToJSONTyped(value?: SyncStatusResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + 'clientId': value['clientId'], + 'companyId': value['companyId'], + 'companyName': value['companyName'], + 'dataConnectionId': value['dataConnectionId'], + 'sourceAccountId': value['sourceAccountId'], + 'periodStartUtc': value['periodStartUtc'], + 'periodEndUtc': value['periodEndUtc'], + 'executionStartUtc': value['executionStartUtc'], + 'status': value['status'], + 'executionEndUtc': value['executionEndUtc'], + 'errorMessage': value['errorMessage'], + 'errorCode': value['errorCode'], + 'pushOperationKeys': value['pushOperationKeys'], + }; +} + + +export interface GetLatestManagedBankFeedSyncResponseSyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface GetLatestManagedBankFeedSyncResponseSyncStatusResult { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface GetManagedBankFeedSyncResponseSyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface GetManagedBankFeedSyncResponseSyncStatusResult { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface LatestManagedBankFeedSyncGetResponseSyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface LatestManagedBankFeedSyncGetResponseSyncStatusResult { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface ManagedBankFeedSyncGetResponseSyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface ManagedBankFeedSyncGetResponseSyncStatusResult { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface SyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; +} + +export interface SyncStatusResultSyncStatus { + /** + * The unique identifier for the sync. + * @type {string} + * @memberof SyncStatusResult + */ + syncId: string; + /** + * The ID of the client associated with the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + clientId: string; + /** + * The ID of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyId: string; + /** + * The name of the company that owns the source bank account. + * @type {string} + * @memberof SyncStatusResult + */ + companyName: string; + /** + * The ID of the target accounting data connection. + * @type {string} + * @memberof SyncStatusResult + */ + dataConnectionId: string; + /** + * The ID of the source bank account from which transactions are fetched. + * @type {string} + * @memberof SyncStatusResult + */ + sourceAccountId: string; + /** + * The start of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodStartUtc: Date; + /** + * The end of the sync period. + * @type {string} + * @memberof SyncStatusResult + */ + periodEndUtc: Date; + /** + * The UTC timestamp when the sync started executing. + * @type {string} + * @memberof SyncStatusResult + */ + executionStartUtc: Date; + /** + * The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`. + * @type {string} + * @memberof SyncStatusResult + */ + status: string; + /** + * The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`). + * @type {string} + * @memberof SyncStatusResult + */ + executionEndUtc?: Date | null; + /** + * Error message if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorMessage?: string | null; + /** + * Error code if the sync failed. + * @type {string} + * @memberof SyncStatusResult + */ + errorCode?: string | null; + /** + * List of write operation keys associated with the sync, if the sync resulted in write attempts. + * @type {Array} + * @memberof SyncStatusResult + */ + pushOperationKeys?: Array | null; } diff --git a/bank-feeds/src/sdk/models/shared/targetaccountoption.ts b/bank-feeds/src/sdk/models/shared/targetaccountoption.ts index 4a5824cc9..85afb8fa0 100644 --- a/bank-feeds/src/sdk/models/shared/targetaccountoption.ts +++ b/bank-feeds/src/sdk/models/shared/targetaccountoption.ts @@ -1,55 +1,131 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type TargetAccountOption = { - /** - * Id of the target account. - */ - id?: string | undefined; - /** - * Name of the target account. - */ - name?: string | null | undefined; - /** - * The balance of the account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The sort code of the account. - */ - sortCode?: string | null | undefined; - /** - * The account number of the account. - */ - accountNumber?: string | null | undefined; -}; - -/** @internal */ -export const TargetAccountOption$inboundSchema: z.ZodType< - TargetAccountOption, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.nullable(z.string()).optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), -}); - -export function targetAccountOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TargetAccountOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TargetAccountOption' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +/** + * + * @export + * @interface TargetAccountOption + */ +export interface TargetAccountOption { + /** + * Id of the target account. + * @type {string} + * @memberof TargetAccountOption + */ + id?: string; + /** + * Name of the target account. + * @type {string} + * @memberof TargetAccountOption + */ + name?: string | null; + /** + * The balance of the account. + * @type {number} + * @memberof TargetAccountOption + */ + balance?: Decimal | number | null; + /** + * The sort code of the account. + * @type {string} + * @memberof TargetAccountOption + */ + sortCode?: string | null; + /** + * The account number of the account. + * @type {string} + * @memberof TargetAccountOption + */ + accountNumber?: string | null; +} + +/** + * Check if a given object implements the TargetAccountOption interface. + */ +export function instanceOfTargetAccountOption(value: object): value is TargetAccountOption { + return true; +} + +export function TargetAccountOptionFromJSON(json: any): TargetAccountOption { + return TargetAccountOptionFromJSONTyped(json, false); +} + +export function TargetAccountOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TargetAccountOption { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + }; +} + +export function TargetAccountOptionToJSON(json: any): TargetAccountOption { + return TargetAccountOptionToJSONTyped(json, false); +} + +export function TargetAccountOptionToJSONTyped(value?: TargetAccountOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'balance': fromDecimal(value['balance']), + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + }; +} + + +export interface BankFeedMappingTargetAccountOption { + /** + * Id of the target account. + * @type {string} + * @memberof TargetAccountOption + */ + id?: string; + /** + * Name of the target account. + * @type {string} + * @memberof TargetAccountOption + */ + name?: string | null; + /** + * The balance of the account. + * @type {number} + * @memberof TargetAccountOption + */ + balance?: Decimal | number | null; + /** + * The sort code of the account. + * @type {string} + * @memberof TargetAccountOption + */ + sortCode?: string | null; + /** + * The account number of the account. + * @type {string} + * @memberof TargetAccountOption + */ + accountNumber?: string | null; } diff --git a/bank-feeds/src/sdk/models/shared/validation.ts b/bank-feeds/src/sdk/models/shared/validation.ts index 3a6a92030..c5121f239 100644 --- a/bank-feeds/src/sdk/models/shared/validation.ts +++ b/bank-feeds/src/sdk/models/shared/validation.ts @@ -1,40 +1,216 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ValidationItem } from './validationitem'; import { - ValidationItem, - ValidationItem$inboundSchema, -} from "./validationitem.js"; + ValidationItemFromJSON, + ValidationItemFromJSONTyped, + ValidationItemToJSON, + ValidationItemToJSONTyped, +} from './validationitem'; /** * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + * @export + * @interface Validation + */ +export interface Validation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the Validation interface. */ -export type Validation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const Validation$inboundSchema: z.ZodType< - Validation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), -}); - -export function validationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Validation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Validation' from JSON`, - ); +export function instanceOfValidation(value: object): value is Validation { + return true; +} + +export function ValidationFromJSON(json: any): Validation { + return ValidationFromJSONTyped(json, false); +} + +export function ValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ValidationItemFromJSON)), + }; +} + +export function ValidationToJSON(json: any): Validation { + return ValidationToJSONTyped(json, false); +} + +export function ValidationToJSONTyped(value?: Validation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ValidationItemToJSON)), + }; +} + + +export interface BankAccountCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface BankTransactionsCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateBankAccountResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateBankTransactionResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateBankTransactionsResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateOperationGetResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface GetCreateOperationResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationsValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; } diff --git a/bank-feeds/src/sdk/models/shared/validationitem.ts b/bank-feeds/src/sdk/models/shared/validationitem.ts index ca354aa0b..fad94a938 100644 --- a/bank-feeds/src/sdk/models/shared/validationitem.ts +++ b/bank-feeds/src/sdk/models/shared/validationitem.ts @@ -1,44 +1,150 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Bank Feeds + * Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software. A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software. [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Source accounts | Provide and manage lists of source bank accounts. | | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company\'s connections, and see previous operations. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ValidationItem$inboundSchema: z.ZodType< - ValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function validationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ValidationItem + */ +export interface ValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ValidationItem interface. + */ +export function instanceOfValidationItem(value: object): value is ValidationItem { + return true; +} + +export function ValidationItemFromJSON(json: any): ValidationItem { + return ValidationItemFromJSONTyped(json, false); +} + +export function ValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationItem { + if (json == null) { + return json; + } + return { + + ...json, + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ValidationItemToJSON(json: any): ValidationItem { + return ValidationItemToJSONTyped(json, false); +} + +export function ValidationItemToJSONTyped(value?: ValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface CreateBankTransactionResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface CreateBankTransactionsResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface PushOperationValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; } diff --git a/bank-feeds/src/sdk/sdk.ts b/bank-feeds/src/sdk/sdk.ts index a088bc4f6..aac59d827 100644 --- a/bank-feeds/src/sdk/sdk.ts +++ b/bank-feeds/src/sdk/sdk.ts @@ -1,76 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { validateWebhook } from "../funcs/validateWebhook.js"; -import { ClientSDK } from "../lib/sdks.js"; -import { AccountMapping } from "./accountmapping.js"; -import { BankAccounts } from "./bankaccounts.js"; -import { Companies } from "./companies.js"; -import { CompanyInformation } from "./companyinformation.js"; -import { Connections } from "./connections.js"; -import { ManagedBankFeeds } from "./managedbankfeeds.js"; -import * as shared from "./models/shared/index.js"; -import { SourceAccounts } from "./sourceaccounts.js"; -import { Transactions } from "./transactions.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CodatBankFeeds extends ClientSDK { - private _companies?: Companies; - get companies(): Companies { - return (this._companies ??= new Companies(this._options)); - } - - private _connections?: Connections; - get connections(): Connections { - return (this._connections ??= new Connections(this._options)); - } - - private _bankAccounts?: BankAccounts; - get bankAccounts(): BankAccounts { - return (this._bankAccounts ??= new BankAccounts(this._options)); - } - - private _sourceAccounts?: SourceAccounts; - get sourceAccounts(): SourceAccounts { - return (this._sourceAccounts ??= new SourceAccounts(this._options)); - } - - private _accountMapping?: AccountMapping; - get accountMapping(): AccountMapping { - return (this._accountMapping ??= new AccountMapping(this._options)); - } - - private _companyInformation?: CompanyInformation; - get companyInformation(): CompanyInformation { - return (this._companyInformation ??= new CompanyInformation(this._options)); - } - - private _transactions?: Transactions; - get transactions(): Transactions { - return (this._transactions ??= new Transactions(this._options)); - } - - private _managedBankFeeds?: ManagedBankFeeds; - get managedBankFeeds(): ManagedBankFeeds { - return (this._managedBankFeeds ??= new ManagedBankFeeds(this._options)); - } - - async validateWebhook({ - request, - }: { - request: { - body: string; - headers: Record | Headers; - url: string; - method: string; - } | Request; - }): Promise< - shared.ClientRateLimitWebhook | undefined | shared.SourceAccountWebhook - > { - return unwrapAsync(validateWebhook( - this, - { request }, - )); - } -} +export * from "../sdk"; diff --git a/bank-feeds/src/sdk/sourceaccounts.ts b/bank-feeds/src/sdk/sourceaccounts.ts index 483b53a2d..881c38183 100644 --- a/bank-feeds/src/sdk/sourceaccounts.ts +++ b/bank-feeds/src/sdk/sourceaccounts.ts @@ -1,186 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { sourceAccountsCreate } from "../funcs/sourceAccountsCreate.js"; -import { sourceAccountsCreateBatch } from "../funcs/sourceAccountsCreateBatch.js"; -import { sourceAccountsDelete } from "../funcs/sourceAccountsDelete.js"; -import { sourceAccountsDeleteCredentials } from "../funcs/sourceAccountsDeleteCredentials.js"; -import { sourceAccountsGenerateCredentials } from "../funcs/sourceAccountsGenerateCredentials.js"; -import { sourceAccountsGenerateOtp } from "../funcs/sourceAccountsGenerateOtp.js"; -import { sourceAccountsList } from "../funcs/sourceAccountsList.js"; -import { sourceAccountsUpdate } from "../funcs/sourceAccountsUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class SourceAccounts extends ClientSDK { - /** - * Create source accounts - * - * @remarks - * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ - async createBatch( - request: operations.CreateBatchSourceAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsCreateBatch( - this, - request, - options, - )); - } - - /** - * Create single source account - * - * @remarks - * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ - async create( - request: operations.CreateSourceAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsCreate( - this, - request, - options, - )); - } - - /** - * List source accounts - * - * @remarks - * The _List source accounts_ endpoint returns a list of [source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) for a given company's connection. - * - * [Source accounts](https://docs.codat.io/bank-feeds-api#/schemas/BankFeedAccount) are the bank's bank account within Codat's domain from which transactions are synced into the accounting platform. - * - * > ### Versioning - * > If you are integrating the Bank Feeds solution with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. - */ - async list( - request: operations.ListSourceAccountsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsList( - this, - request, - options, - )); - } - - /** - * Update source account - * - * @remarks - * The _Update source account_ endpoint updates a single source account for a single data connection connected to a single company. - * - * ### Tips and pitfalls - * - * * This endpoint makes it possible to update the `accountName`, `status`, and `balance` fields. - * * The `status` field can only be updated to 'disconnected'. - * * The `balance` field can only be updated on accounts that are **not** 'connected'. - * * Updates made here apply exclusively to source accounts and will not affect target accounts in the accounting software. - */ - async update( - request: operations.UpdateSourceAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsUpdate( - this, - request, - options, - )); - } - - /** - * Delete source account - * - * @remarks - * The _Delete source account_ endpoint enables you to remove a source account. - * - * Removing a source account will also remove any mapping between the source bank feed bank accounts and the target bankfeed bank account. - */ - async delete( - request: operations.DeleteSourceAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsDelete( - this, - request, - options, - )); - } - - /** - * Generate source account credentials - * - * @remarks - * The _Generate bank account credentials_ endpoint can be used to generate credentials for QuickBooks Online to authenticate the Bank Feed in the QBO portal. Each time this endpoint is called, a new set of credentials will be generated. - * - * The old credentials will still be valid until the revoke credentials endpoint is used, which will revoke all credentials associated to the data connection. - * - * > **For QuickBooks Online only** - * > - * > Only call this endpoint when onboarding SMBs that use QuickBooks Online. - */ - async generateCredentials( - request: operations.GenerateCredentialsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsGenerateCredentials( - this, - request, - options, - )); - } - - /** - * Delete all source account credentials - * - * @remarks - * The _Delete Bank Account Credentials_ endpoint serves as a comprehensive mechanism for revoking all existing authorization credentials that a company employs to establish its Bank Feed connection. - * - * In cases where multiple credential sets have been generated, a single API call to this endpoint revokes all of them. - */ - async deleteCredentials( - request: operations.DeleteBankFeedCredentialsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsDeleteCredentials( - this, - request, - options, - )); - } - - /** - * Generate one-time password - * - * @remarks - * The *Generate OTP* endpoint generates a one-time password (OTP) for a bank feed connection. The OTP is returned along with an expiry time, after which it will no longer be valid. - * - * > **For Sage only** - * > - * > Only call this endpoint for connections to Sage. Calling it for other integrations will return an error. - */ - async generateOtp( - request: operations.GenerateOtpRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(sourceAccountsGenerateOtp( - this, - request, - options, - )); - } -} +export { SourceAccounts } from "../apis/SourceAccounts"; diff --git a/bank-feeds/src/sdk/transactions.ts b/bank-feeds/src/sdk/transactions.ts index f92b2dd18..f0f82a1af 100644 --- a/bank-feeds/src/sdk/transactions.ts +++ b/bank-feeds/src/sdk/transactions.ts @@ -1,103 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { transactionsCreate } from "../funcs/transactionsCreate.js"; -import { transactionsGetCreateModel } from "../funcs/transactionsGetCreateModel.js"; -import { transactionsGetCreateOperation } from "../funcs/transactionsGetCreateOperation.js"; -import { transactionsListCreateOperations } from "../funcs/transactionsListCreateOperations.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Transactions extends ClientSDK { - /** - * Create bank transactions - * - * @remarks - * The *Create bank transactions* endpoint creates new [bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company's connection. - * - * [Bank transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of monetary amounts that have moved in and out of an SMB's bank account. - * - * **Integration-specific behavior** - * - * The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. - * Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. - */ - async create( - request: operations.CreateBankTransactionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transactionsCreate( - this, - request, - options, - )); - } - - /** - * Get create bank transactions model - * - * @remarks - * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. - * - * [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ - async getCreateModel( - request: operations.GetCreateBankTransactionsModelRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transactionsGetCreateModel( - this, - request, - options, - )); - } - - /** - * Get create operation - * - * @remarks - * The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - * - * For bank feeds, your push operations will only relate to the `bankTransactions` data type. - */ - async getCreateOperation( - request: operations.GetCreateOperationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transactionsGetCreateOperation( - this, - request, - options, - )); - } - - /** - * List create operations - * - * @remarks - * The **List create operations** endpoint returns a list of [write operations](/using-the-api/push) performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - * - * For bank feeds, use this endpoint to view write operations related to the `bankTransactions` data type. - */ - async listCreateOperations( - request: operations.ListCreateOperationsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transactionsListCreateOperations( - this, - request, - options, - )); - } -} +export { Transactions } from "../apis/Transactions"; diff --git a/bank-feeds/src/sdk/types/async.ts b/bank-feeds/src/sdk/types/async.ts index 689dba5de..208661e87 100644 --- a/bank-feeds/src/sdk/types/async.ts +++ b/bank-feeds/src/sdk/types/async.ts @@ -1,68 +1,51 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; + | { status: "complete"; request: Request; response: Response } + | { status: "request-error"; request: Request; response?: undefined } + | { status: "invalid"; request?: undefined; response?: undefined }; -export class APIPromise implements Promise { - readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; +export class APIPromise { + private readonly inner: Promise; - readonly [Symbol.toStringTag] = "APIPromise"; + constructor(inner: Promise) { + this.inner = inner; + } - constructor(p: [T, APICall] | Promise<[T, APICall]>) { - this.#promise = p instanceof Promise ? p : Promise.resolve(p); - this.#unwrapped = - p instanceof Promise - ? this.#promise.then(([value]) => value) - : Promise.resolve(p[0]); - } + then( + onfulfilled?: ((value: T) => R1 | PromiseLike) | null, + onrejected?: ((reason: unknown) => R2 | PromiseLike) | null, + ): Promise { + return this.inner.then(onfulfilled, onrejected); + } - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this.#promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } + catch(onrejected?: ((reason: unknown) => R | PromiseLike) | null): Promise { + return this.inner.catch(onrejected); + } - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this.#unwrapped.catch(onrejected); - } + finally(onfinally?: (() => void) | null): Promise { + return this.inner.then( + (value) => { + if (onfinally) { + onfinally(); + } + return value; + }, + (reason) => { + if (onfinally) { + onfinally(); + } + throw reason; + }, + ); + } - finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); - } + $inspect(): Promise { + return this.inner; + } - $inspect(): Promise<[T, APICall]> { - return this.#promise; - } + get [Symbol.toStringTag](): string { + return "APIPromise"; + } } diff --git a/bank-feeds/src/sdk/types/blobs.ts b/bank-feeds/src/sdk/types/blobs.ts deleted file mode 100644 index cce2892d4..000000000 --- a/bank-feeds/src/sdk/types/blobs.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export const blobLikeSchema: z.ZodType = z.custom< - Blob ->(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, -}); - -export function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const name = val[Symbol.toStringTag]; - if (typeof name !== "string") { - return false; - } - if (name !== "Blob" && name !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} diff --git a/bank-feeds/src/sdk/types/constdatetime.ts b/bank-feeds/src/sdk/types/constdatetime.ts deleted file mode 100644 index fe62144ea..000000000 --- a/bank-feeds/src/sdk/types/constdatetime.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function constDateTime( - val: string, -): z.ZodType { - return z.custom((v) => { - return ( - typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() - ); - }, `Value must be equivalent to ${val}`); -} diff --git a/bank-feeds/src/sdk/types/decimal.ts b/bank-feeds/src/sdk/types/decimal.ts index a7895d555..5dcba30f5 100644 --- a/bank-feeds/src/sdk/types/decimal.ts +++ b/bank-feeds/src/sdk/types/decimal.ts @@ -1,5 +1,3 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - +/* tslint:disable */ +/* eslint-disable */ export * from "decimal.js"; diff --git a/bank-feeds/src/sdk/types/enums.ts b/bank-feeds/src/sdk/types/enums.ts deleted file mode 100644 index aba0ffd2a..000000000 --- a/bank-feeds/src/sdk/types/enums.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { Unrecognized, unrecognized } from "./unrecognized.js"; - -export type ClosedEnum>> = - T[keyof T]; -export type OpenEnum>> = - | T[keyof T] - | Unrecognized; - -export function inboundSchema>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - const options = Object.values(enumObj); - return z.union([ - ...options.map(x => z.literal(x)), - z.string().transform(x => unrecognized(x)), - ] as any); -} - -export function inboundSchemaInt>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - // For numeric enums, Object.values returns both numbers and string keys - const options = Object.values(enumObj).filter(v => typeof v === "number"); - return z.union([ - ...options.map(x => z.literal(x)), - z.number().int().transform(x => unrecognized(x)), - ] as any); -} - -export function outboundSchema>( - _: T, -): z.ZodType> { - return z.string() as any; -} - -export function outboundSchemaInt>( - _: T, -): z.ZodType> { - return z.number().int() as any; -} diff --git a/bank-feeds/src/sdk/types/fp.ts b/bank-feeds/src/sdk/types/fp.ts index ccbe51eac..84eb7e4f3 100644 --- a/bank-feeds/src/sdk/types/fp.ts +++ b/bank-feeds/src/sdk/types/fp.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * A monad that captures the result of a function call or an error if it was not - * successful. Railway programming, enabled by this type, can be a nicer - * alternative to traditional exception throwing because it allows functions to - * declare all _known_ errors with static types and then check for them - * exhaustively in application code. Thrown exception have a type of `unknown` - * and break out of regular control flow of programs making them harder to - * inspect and more verbose work with due to try-catch blocks. - */ -export type Result = - | { ok: true; value: T; error?: never } - | { ok: false; value?: never; error: E }; +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; -export function OK(value: V): Result { - return { ok: true, value }; +export function OK(value: T): Result { + return { ok: true, value }; } export function ERR(error: E): Result { - return { ok: false, error }; + return { ok: false, error }; } -/** - * unwrap is a convenience function for extracting a value from a result or - * throwing if there was an error. - */ export function unwrap(r: Result): T { - if (!r.ok) { + if (r.ok) { + return r.value; + } throw r.error; - } - return r.value; } -/** - * unwrapAsync is a convenience function for resolving a value from a Promise - * of a result or rejecting if an error occurred. - */ -export async function unwrapAsync( - pr: Promise>, -): Promise { - const r = await pr; - if (!r.ok) { - throw r.error; - } - - return r.value; +export async function unwrapAsync(pr: Promise>): Promise { + return unwrap(await pr); } diff --git a/bank-feeds/src/sdk/types/index.ts b/bank-feeds/src/sdk/types/index.ts index 19a7bd013..43093a397 100644 --- a/bank-feeds/src/sdk/types/index.ts +++ b/bank-feeds/src/sdk/types/index.ts @@ -1,13 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export { Decimal } from "./decimal.js"; -export type { ClosedEnum, OpenEnum } from "./enums.js"; -export type { Result } from "./fp.js"; -export type { PageIterator, Paginator } from "./operations.js"; -export { createPageIterator } from "./operations.js"; -export { RFCDate } from "./rfcdate.js"; -export * from "./unrecognized.js"; -export type { WebhookRecipient } from "./webhooks.js"; +export * from './rfcdate'; +export * from './async'; +export * from './decimal'; +export * from './fp'; +export * from './operations'; diff --git a/bank-feeds/src/sdk/types/operations.ts b/bank-feeds/src/sdk/types/operations.ts index beb81e10f..b6d42c45c 100644 --- a/bank-feeds/src/sdk/types/operations.ts +++ b/bank-feeds/src/sdk/types/operations.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ import { Result } from "./fp.js"; @@ -101,5 +100,3 @@ function unwrapPaginator( }); }; } - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/bank-feeds/src/sdk/types/rfcdate.ts b/bank-feeds/src/sdk/types/rfcdate.ts index c79b3f53a..03939e51e 100644 --- a/bank-feeds/src/sdk/types/rfcdate.ts +++ b/bank-feeds/src/sdk/types/rfcdate.ts @@ -1,54 +1,22 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; +/* tslint:disable */ +/* eslint-disable */ export class RFCDate { - private serialized: string; - - /** - * Creates a new RFCDate instance using today's date. - */ - static today(): RFCDate { - return new RFCDate(new Date()); - } + private date: string; - /** - * Creates a new RFCDate instance using the provided input. - * If a string is used then in must be in the format YYYY-MM-DD. - * - * @param date A Date object or a date string in YYYY-MM-DD format - * @example - * new RFCDate("2022-01-01") - * @example - * new RFCDate(new Date()) - */ - constructor(date: Date | string) { - if (typeof date === "string" && !dateRE.test(date)) { - throw new RangeError( - "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, - ); + constructor(date: Date | string) { + this.date = date instanceof Date ? date.toISOString().slice(0, 10) : date; } - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + date); + static today(): RFCDate { + return new RFCDate(new Date()); } - this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); - if (!dateRE.test(this.serialized)) { - throw new TypeError( - `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, - ); + toJSON(): string { + return this.date; } - } - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } + toString(): string { + return this.date; + } } diff --git a/bank-feeds/src/sdk/types/streams.ts b/bank-feeds/src/sdk/types/streams.ts deleted file mode 100644 index a0163e7a9..000000000 --- a/bank-feeds/src/sdk/types/streams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -} diff --git a/bank-feeds/src/sdk/types/unrecognized.ts b/bank-feeds/src/sdk/types/unrecognized.ts deleted file mode 100644 index b7a2a13f3..000000000 --- a/bank-feeds/src/sdk/types/unrecognized.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -declare const __brand: unique symbol; -export type Unrecognized = T & { [__brand]: "unrecognized" }; - -function unrecognized(value: T): Unrecognized { - globalCount++; - return value as Unrecognized; -} - -let globalCount = 0; -let refCount = 0; -export function startCountingUnrecognized() { - refCount++; - const start = globalCount; - return { - /** - * Ends counting and returns the delta. - * @param delta - If provided, only this amount is added to the parent counter - * (used for nested unions where we only want to record the winning option's count). - * If not provided, records all counts since start(). - */ - end: (delta?: number) => { - const count = globalCount - start; - // Reset globalCount back to start, then add only the specified delta - globalCount = start + (delta ?? count); - if (--refCount === 0) globalCount = 0; - return count; - }, - }; -} - -export { unrecognized }; diff --git a/bank-feeds/src/sdk/types/webhooks.ts b/bank-feeds/src/sdk/types/webhooks.ts deleted file mode 100644 index 9510d20c0..000000000 --- a/bank-feeds/src/sdk/types/webhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type WebhookRecipient = { - url: string; -}; diff --git a/bank-feeds/tsconfig.esm.json b/bank-feeds/tsconfig.esm.json new file mode 100644 index 000000000..b98a6d38d --- /dev/null +++ b/bank-feeds/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "include": ["src"], + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/bank-feeds/tsconfig.json b/bank-feeds/tsconfig.json index 76110f883..ffd54239f 100644 --- a/bank-feeds/tsconfig.json +++ b/bank-feeds/tsconfig.json @@ -1,41 +1,17 @@ { + "include": ["src"], "compilerOptions": { - "incremental": false, - "target": "ES2020", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "jsx": "react-jsx", - - "module": "Node16", - "moduleResolution": "Node16", - - "allowJs": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "rootDir": "src", - "outDir": ".", - - - // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json - "strict": true, - "allowUnusedLabels": false, - "allowUnreachableCode": false, - "exactOptionalPropertyTypes": true, - "useUnknownInCatchVariables": true, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": true, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "isolatedModules": true, - "checkJs": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "target": "es2018", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, - "include": ["src"], - "exclude": ["node_modules", "src/__tests__"] + "exclude": [ + "dist", + "node_modules" + ] }