From 9ee708e5dbc7d663edb7a5469ae966d4fe36d072 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 22 Sep 2023 00:38:11 +0000 Subject: [PATCH 1/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.89.0 --- .gitattributes | 2 + .gitignore | 1 + README.md | 252 +++--- RELEASES.md | 12 +- USAGE.md | 19 +- accounts.go | 150 +++- balances.go | 94 +- clients.go | 233 +++-- .../operations/activateconfigrequest.md | 8 + .../operations/activateconfigresponse.md | 11 + .../addmetadataontransactionrequest.md | 10 + .../addmetadataontransactionresponse.md | 11 + .../operations/addmetadatatoaccountrequest.md | 10 + .../addmetadatatoaccountresponse.md | 11 + .../operations/addscopetoclientrequest.md | 9 + .../operations/addscopetoclientresponse.md | 10 + .../operations/addtransientscoperequest.md | 9 + .../operations/addtransientscoperesponse.md | 10 + .../operations/changeconfigsecretrequest.md | 9 + .../operations/changeconfigsecretresponse.md | 11 + docs/models/operations/confirmholdrequest.md | 9 + docs/models/operations/confirmholdresponse.md | 11 + .../connectorsstripetransferresponse.md | 11 + .../operations/countaccountsmetadata.md | 9 + .../models/operations/countaccountsrequest.md | 10 + .../operations/countaccountsresponse.md | 12 + .../operations/counttransactionsmetadata.md | 9 + .../operations/counttransactionsrequest.md | 17 + .../operations/counttransactionsresponse.md | 12 + .../models/operations/createbalancerequest.md | 9 + .../operations/createbalanceresponse.md | 12 + .../models/operations/createclientresponse.md | 11 + docs/models/operations/createscoperesponse.md | 11 + docs/models/operations/createsecretrequest.md | 9 + .../models/operations/createsecretresponse.md | 11 + .../operations/createtransactionrequest.md | 10 + .../operations/createtransactionresponse.md | 12 + .../operations/createtransactionsrequest.md | 9 + .../operations/createtransactionsresponse.md | 12 + .../models/operations/createwalletresponse.md | 12 + .../operations/createworkflowresponse.md | 12 + docs/models/operations/creditwalletrequest.md | 9 + .../models/operations/creditwalletresponse.md | 11 + .../operations/deactivateconfigrequest.md | 8 + .../operations/deactivateconfigresponse.md | 11 + docs/models/operations/debitwalletrequest.md | 9 + docs/models/operations/debitwalletresponse.md | 12 + docs/models/operations/deleteclientrequest.md | 8 + .../models/operations/deleteclientresponse.md | 10 + docs/models/operations/deleteconfigrequest.md | 8 + .../models/operations/deleteconfigresponse.md | 10 + .../deletescopefromclientrequest.md | 9 + .../deletescopefromclientresponse.md | 10 + docs/models/operations/deletescoperequest.md | 8 + docs/models/operations/deletescoperesponse.md | 10 + docs/models/operations/deletesecretrequest.md | 9 + .../models/operations/deletesecretresponse.md | 10 + .../operations/deletetransientscoperequest.md | 9 + .../deletetransientscoperesponse.md | 10 + docs/models/operations/getaccountrequest.md | 9 + docs/models/operations/getaccountresponse.md | 12 + docs/models/operations/getbalancerequest.md | 9 + docs/models/operations/getbalanceresponse.md | 12 + .../getbalancesaggregatedrequest.md | 9 + .../getbalancesaggregatedresponse.md | 12 + docs/models/operations/getbalancesrequest.md | 12 + docs/models/operations/getbalancesresponse.md | 12 + .../operations/getconnectortaskrequest.md | 9 + .../operations/getconnectortaskresponse.md | 11 + docs/models/operations/getflowrequest.md | 8 + docs/models/operations/getflowresponse.md | 12 + docs/models/operations/getholdrequest.md | 8 + docs/models/operations/getholdresponse.md | 12 + docs/models/operations/getholdsmetadata.md | 9 + docs/models/operations/getholdsrequest.md | 11 + docs/models/operations/getholdsresponse.md | 12 + docs/models/operations/getinforesponse.md | 12 + .../models/operations/getledgerinforequest.md | 8 + .../operations/getledgerinforesponse.md | 12 + .../operations/getmanyconfigsrequest.md | 9 + .../operations/getmanyconfigsresponse.md | 11 + docs/models/operations/getmappingrequest.md | 8 + docs/models/operations/getmappingresponse.md | 12 + docs/models/operations/getpaymentrequest.md | 8 + docs/models/operations/getpaymentresponse.md | 11 + .../operations/getserverinforesponse.md | 11 + .../operations/gettransactionrequest.md | 9 + .../operations/gettransactionresponse.md | 12 + .../operations/gettransactionsrequest.md | 10 + .../operations/gettransactionsresponse.md | 12 + docs/models/operations/getwalletrequest.md | 8 + docs/models/operations/getwalletresponse.md | 12 + .../getworkflowoccurrencerequest.md | 9 + .../getworkflowoccurrenceresponse.md | 12 + .../models/operations/insertconfigresponse.md | 12 + .../operations/installconnectorrequest.md | 9 + .../operations/installconnectorresponse.md | 10 + .../operations/listaccountsbalanceoperator.md | 16 + .../models/operations/listaccountsmetadata.md | 9 + docs/models/operations/listaccountsrequest.md | 18 + .../models/operations/listaccountsresponse.md | 12 + .../operations/listallconnectorsresponse.md | 11 + docs/models/operations/listbalancesrequest.md | 8 + .../models/operations/listbalancesresponse.md | 11 + docs/models/operations/listclientsresponse.md | 11 + .../listconfigsavailableconnectorsresponse.md | 11 + .../operations/listconnectortasksrequest.md | 10 + .../operations/listconnectortasksresponse.md | 11 + docs/models/operations/listflowsresponse.md | 12 + docs/models/operations/listlogsrequest.md | 17 + docs/models/operations/listlogsresponse.md | 12 + docs/models/operations/listpaymentsrequest.md | 10 + .../models/operations/listpaymentsresponse.md | 11 + docs/models/operations/listrunsrequest.md | 8 + docs/models/operations/listrunsresponse.md | 12 + docs/models/operations/listscopesresponse.md | 11 + .../operations/listtransactionsmetadata.md | 9 + .../operations/listtransactionsrequest.md | 22 + .../operations/listtransactionsresponse.md | 12 + docs/models/operations/listusersresponse.md | 11 + docs/models/operations/listwalletsmetadata.md | 9 + docs/models/operations/listwalletsrequest.md | 11 + docs/models/operations/listwalletsresponse.md | 11 + .../orchestrationgetserverinforesponse.md | 12 + .../paymentsgetserverinforesponse.md | 11 + .../operations/paymentslistaccountsrequest.md | 10 + .../paymentslistaccountsresponse.md | 11 + docs/models/operations/readclientrequest.md | 8 + docs/models/operations/readclientresponse.md | 11 + .../operations/readconnectorconfigrequest.md | 8 + .../operations/readconnectorconfigresponse.md | 11 + docs/models/operations/readscoperequest.md | 8 + docs/models/operations/readscoperesponse.md | 11 + docs/models/operations/readstatsrequest.md | 8 + docs/models/operations/readstatsresponse.md | 12 + docs/models/operations/readuserrequest.md | 8 + docs/models/operations/readuserresponse.md | 11 + .../operations/resetconnectorrequest.md | 8 + .../operations/resetconnectorresponse.md | 10 + .../operations/reverttransactionrequest.md | 9 + .../operations/reverttransactionresponse.md | 12 + docs/models/operations/runscriptrequest.md | 10 + docs/models/operations/runscriptresponse.md | 11 + docs/models/operations/runworkflowrequest.md | 10 + docs/models/operations/runworkflowresponse.md | 12 + .../operations/searchgetserverinforesponse.md | 11 + docs/models/operations/searchresponse.md | 11 + docs/models/operations/testconfigrequest.md | 8 + docs/models/operations/testconfigresponse.md | 11 + .../operations/uninstallconnectorrequest.md | 8 + .../operations/uninstallconnectorresponse.md | 10 + docs/models/operations/updateclientrequest.md | 9 + .../models/operations/updateclientresponse.md | 11 + .../models/operations/updatemappingrequest.md | 9 + .../operations/updatemappingresponse.md | 12 + docs/models/operations/updatescoperequest.md | 9 + docs/models/operations/updatescoperesponse.md | 11 + docs/models/operations/updatewalletrequest.md | 9 + .../operations/updatewalletrequestbody.md | 8 + .../models/operations/updatewalletresponse.md | 11 + docs/models/operations/voidholdrequest.md | 8 + docs/models/operations/voidholdresponse.md | 11 + .../walletsgetserverinforesponse.md | 12 + docs/models/shared/account.md | 10 + docs/models/shared/accountmetadata.md | 7 + docs/models/shared/accountresponse.md | 8 + docs/models/shared/accountscursor.md | 8 + docs/models/shared/accountscursorcursor.md | 12 + docs/models/shared/accountscursorresponse.md | 8 + .../shared/accountscursorresponsecursor.md | 12 + .../shared/accountwithvolumesandbalances.md | 12 + .../accountwithvolumesandbalancesmetadata.md | 7 + .../shared/aggregatebalancesresponse.md | 8 + docs/models/shared/assetholder.md | 8 + docs/models/shared/attempt.md | 17 + docs/models/shared/attemptresponse.md | 8 + docs/models/shared/balance.md | 8 + docs/models/shared/balancescursorresponse.md | 8 + .../shared/balancescursorresponsecursor.md | 12 + docs/models/shared/balancewithassets.md | 9 + docs/models/shared/bankingcircleconfig.md | 11 + docs/models/shared/client.md | 17 + docs/models/shared/clientsecret.md | 11 + docs/models/shared/config.md | 8 + docs/models/shared/configchangesecret.md | 8 + docs/models/shared/configinfo.md | 10 + docs/models/shared/configinforesponse.md | 8 + docs/models/shared/configresponse.md | 8 + docs/models/shared/configsresponse.md | 8 + docs/models/shared/configsresponsecursor.md | 12 + docs/models/shared/configuser.md | 10 + docs/models/shared/confirmholdrequest.md | 9 + docs/models/shared/connector.md | 13 + docs/models/shared/connectorconfig.md | 41 + docs/models/shared/connectorconfigresponse.md | 8 + .../shared/connectorsconfigsresponse.md | 8 + .../shared/connectorsconfigsresponsedata.md | 8 + .../connectorsconfigsresponsedataconnector.md | 8 + ...nnectorsconfigsresponsedataconnectorkey.md | 9 + docs/models/shared/connectorsresponse.md | 8 + docs/models/shared/connectorsresponsedata.md | 9 + docs/models/shared/contract.md | 9 + docs/models/shared/contractexpr.md | 7 + docs/models/shared/createbalancerequest.md | 8 + docs/models/shared/createbalanceresponse.md | 8 + docs/models/shared/createclientrequest.md | 14 + docs/models/shared/createclientresponse.md | 8 + docs/models/shared/createscoperequest.md | 9 + docs/models/shared/createscoperesponse.md | 8 + docs/models/shared/createsecretrequest.md | 9 + docs/models/shared/createsecretresponse.md | 8 + docs/models/shared/createwalletrequest.md | 9 + docs/models/shared/createwalletresponse.md | 8 + docs/models/shared/createworkflowrequest.md | 8 + docs/models/shared/createworkflowresponse.md | 8 + docs/models/shared/creditwalletrequest.md | 12 + docs/models/shared/currencycloudconfig.md | 11 + docs/models/shared/debitwalletrequest.md | 13 + docs/models/shared/debitwalletresponse.md | 8 + docs/models/shared/dummypayconfig.md | 10 + docs/models/shared/error.md | 9 + docs/models/shared/errorresponse.md | 10 + docs/models/shared/errorsenum.md | 14 + docs/models/shared/expandeddebithold.md | 14 + docs/models/shared/getbalanceresponse.md | 8 + docs/models/shared/getholdresponse.md | 8 + docs/models/shared/getholdsresponse.md | 8 + docs/models/shared/getholdsresponsecursor.md | 12 + docs/models/shared/gettransactionsresponse.md | 8 + .../shared/gettransactionsresponsecursor.md | 12 + docs/models/shared/getwalletresponse.md | 8 + .../shared/getworkflowoccurrenceresponse.md | 8 + docs/models/shared/getworkflowresponse.md | 8 + docs/models/shared/hold.md | 12 + docs/models/shared/ledgeraccountsubject.md | 9 + docs/models/shared/ledgerinfo.md | 9 + docs/models/shared/ledgerinforesponse.md | 8 + docs/models/shared/ledgerinfostorage.md | 8 + docs/models/shared/ledgerstorage.md | 9 + docs/models/shared/listbalancesresponse.md | 8 + .../shared/listbalancesresponsecursor.md | 12 + docs/models/shared/listclientsresponse.md | 8 + docs/models/shared/listrunsresponse.md | 8 + docs/models/shared/listrunsresponsecursor.md | 12 + docs/models/shared/listscopesresponse.md | 8 + docs/models/shared/listusersresponse.md | 8 + docs/models/shared/listwalletsresponse.md | 8 + .../shared/listwalletsresponsecursor.md | 12 + docs/models/shared/listworkflowsresponse.md | 8 + docs/models/shared/log.md | 12 + docs/models/shared/logdata.md | 7 + docs/models/shared/logscursorresponse.md | 8 + .../models/shared/logscursorresponsecursor.md | 12 + docs/models/shared/logtype.md | 9 + docs/models/shared/mapping.md | 8 + docs/models/shared/mappingresponse.md | 8 + docs/models/shared/migrationinfo.md | 11 + docs/models/shared/migrationinfostate.md | 9 + docs/models/shared/modulrconfig.md | 10 + docs/models/shared/monetary.md | 9 + docs/models/shared/payment.md | 20 + docs/models/shared/paymentadjustment.md | 12 + docs/models/shared/paymentadjustmentraw.md | 7 + docs/models/shared/paymentmetadata.md | 10 + .../models/shared/paymentmetadatachangelog.md | 9 + docs/models/shared/paymentraw.md | 7 + docs/models/shared/paymentresponse.md | 8 + docs/models/shared/paymentsaccount.md | 12 + docs/models/shared/paymentsaccounttype.md | 9 + docs/models/shared/paymentscheme.md | 25 + docs/models/shared/paymentscursor.md | 8 + docs/models/shared/paymentscursorcursor.md | 12 + docs/models/shared/paymentstatus.md | 11 + docs/models/shared/paymenttype.md | 11 + docs/models/shared/posting.md | 11 + docs/models/shared/posttransaction.md | 12 + docs/models/shared/posttransactionscript.md | 9 + .../shared/posttransactionscriptvars.md | 7 + docs/models/shared/query.md | 15 + docs/models/shared/readclientresponse.md | 8 + docs/models/shared/readscoperesponse.md | 8 + docs/models/shared/readuserresponse.md | 8 + docs/models/shared/response.md | 9 + docs/models/shared/responsecursor.md | 13 + docs/models/shared/responsecursordata.md | 7 + docs/models/shared/responsecursortotal.md | 9 + docs/models/shared/responsedata.md | 9 + docs/models/shared/runworkflowresponse.md | 8 + docs/models/shared/scope.md | 11 + docs/models/shared/script.md | 11 + docs/models/shared/scriptresponse.md | 11 + docs/models/shared/scriptvars.md | 7 + docs/models/shared/secret.md | 12 + docs/models/shared/security.md | 8 + docs/models/shared/serverinfo.md | 8 + docs/models/shared/stagestatus.md | 12 + docs/models/shared/stats.md | 9 + docs/models/shared/statsresponse.md | 8 + docs/models/shared/stripeconfig.md | 10 + docs/models/shared/stripetransferrequest.md | 11 + .../shared/stripetransferrequestmetadata.md | 11 + docs/models/shared/stripetransferresponse.md | 7 + docs/models/shared/subject.md | 17 + docs/models/shared/taskbankingcircle.md | 15 + .../shared/taskbankingcircledescriptor.md | 9 + docs/models/shared/taskbankingcirclestate.md | 7 + docs/models/shared/taskcurrencycloud.md | 15 + .../shared/taskcurrencyclouddescriptor.md | 8 + docs/models/shared/taskcurrencycloudstate.md | 7 + docs/models/shared/taskdummypay.md | 15 + docs/models/shared/taskdummypaydescriptor.md | 10 + docs/models/shared/taskdummypaystate.md | 7 + docs/models/shared/taskmodulr.md | 15 + docs/models/shared/taskmodulrdescriptor.md | 10 + docs/models/shared/taskmodulrstate.md | 7 + docs/models/shared/taskresponse.md | 8 + docs/models/shared/taskresponsedata.md | 41 + docs/models/shared/taskscursor.md | 8 + docs/models/shared/taskscursorcursor.md | 12 + docs/models/shared/taskscursorcursordata.md | 41 + docs/models/shared/taskstripe.md | 15 + docs/models/shared/taskstripedescriptor.md | 10 + docs/models/shared/taskstripestate.md | 7 + docs/models/shared/taskwise.md | 15 + docs/models/shared/taskwisedescriptor.md | 10 + docs/models/shared/taskwisestate.md | 7 + docs/models/shared/transaction.md | 14 + docs/models/shared/transactiondata.md | 11 + docs/models/shared/transactionresponse.md | 8 + docs/models/shared/transactions.md | 8 + .../shared/transactionscursorresponse.md | 8 + .../transactionscursorresponsecursor.md | 12 + docs/models/shared/transactionsresponse.md | 8 + docs/models/shared/updateclientrequest.md | 14 + docs/models/shared/updateclientresponse.md | 8 + docs/models/shared/updatescoperequest.md | 9 + docs/models/shared/updatescoperesponse.md | 8 + docs/models/shared/user.md | 10 + docs/models/shared/volume.md | 10 + docs/models/shared/wallet.md | 12 + docs/models/shared/walletserrorresponse.md | 9 + docs/models/shared/walletstransaction.md | 14 + docs/models/shared/walletsubject.md | 10 + docs/models/shared/walletsvolume.md | 10 + docs/models/shared/walletwithbalances.md | 13 + .../shared/walletwithbalancesbalances.md | 8 + docs/models/shared/webhooksconfig.md | 14 + docs/models/shared/wiseconfig.md | 8 + docs/models/shared/workflow.md | 11 + docs/models/shared/workflowconfig.md | 8 + docs/models/shared/workflowoccurrence.md | 12 + docs/sdks/accounts/README.md | 233 +++++ docs/sdks/balances/README.md | 117 +++ docs/sdks/clients/README.md | 507 +++++++++++ docs/sdks/formance/README.md | 163 ++++ docs/sdks/ledger/README.md | 60 ++ docs/sdks/logs/README.md | 70 ++ docs/sdks/mapping/README.md | 120 +++ docs/sdks/orchestration/README.md | 372 ++++++++ docs/sdks/payments/README.md | 640 ++++++++++++++ docs/sdks/scopes/README.md | 378 ++++++++ docs/sdks/script/README.md | 79 ++ docs/sdks/search/README.md | 72 ++ docs/sdks/server/README.md | 56 ++ docs/sdks/stats/README.md | 61 ++ docs/sdks/transactions/README.md | 451 ++++++++++ docs/sdks/users/README.md | 108 +++ docs/sdks/wallets/README.md | 834 ++++++++++++++++++ docs/sdks/webhooks/README.md | 392 ++++++++ files.gen | 388 +++++++- formance.go | 433 ++++----- gen.yaml | 18 +- go.mod | 3 + go.sum | 6 + ledger.go | 59 +- logs.go | 59 +- mapping.go | 96 +- orchestration.go | 260 ++++-- payments.go | 303 +++++-- pkg/models/operations/activateconfig.go | 39 + .../operations/addmetadataontransaction.go | 61 +- pkg/models/operations/addmetadatatoaccount.go | 65 +- pkg/models/operations/addscopetoclient.go | 41 +- pkg/models/operations/addtransientscope.go | 41 +- pkg/models/operations/changeconfigsecret.go | 48 +- pkg/models/operations/confirmhold.go | 51 +- .../operations/connectorsstripetransfer.go | 40 +- pkg/models/operations/countaccounts.go | 74 +- pkg/models/operations/counttransactions.go | 170 +++- pkg/models/operations/createbalance.go | 57 +- pkg/models/operations/createclient.go | 33 +- pkg/models/operations/createscope.go | 33 +- pkg/models/operations/createsecret.go | 50 +- pkg/models/operations/createtransaction.go | 78 +- pkg/models/operations/createtransactions.go | 64 +- pkg/models/operations/createwallet.go | 41 +- pkg/models/operations/createworkflow.go | 47 +- pkg/models/operations/creditwallet.go | 51 +- pkg/models/operations/deactivateconfig.go | 39 + pkg/models/operations/debitwallet.go | 61 +- pkg/models/operations/deleteclient.go | 31 + pkg/models/operations/deleteconfig.go | 31 + pkg/models/operations/deletescope.go | 31 + .../operations/deletescopefromclient.go | 41 +- pkg/models/operations/deletesecret.go | 39 + pkg/models/operations/deletetransientscope.go | 41 +- pkg/models/operations/getaccount.go | 67 +- pkg/models/operations/getbalance.go | 61 +- pkg/models/operations/getbalances.go | 102 ++- .../operations/getbalancesaggregated.go | 63 +- pkg/models/operations/getconnectortask.go | 57 +- pkg/models/operations/getflow.go | 51 +- pkg/models/operations/gethold.go | 55 +- pkg/models/operations/getholds.go | 107 ++- pkg/models/operations/getinfo.go | 45 +- pkg/models/operations/getledgerinfo.go | 53 +- pkg/models/operations/getmanyconfigs.go | 49 +- pkg/models/operations/getmapping.go | 51 +- pkg/models/operations/getpayment.go | 41 +- pkg/models/operations/getserverinfo.go | 31 + pkg/models/operations/gettransaction.go | 65 +- pkg/models/operations/gettransactions.go | 87 +- pkg/models/operations/getwallet.go | 54 +- .../operations/getworkflowoccurrence.go | 61 +- pkg/models/operations/insertconfig.go | 47 +- pkg/models/operations/installconnector.go | 42 +- pkg/models/operations/listaccounts.go | 237 ++++- pkg/models/operations/listallconnectors.go | 31 + pkg/models/operations/listbalances.go | 40 +- pkg/models/operations/listclients.go | 33 +- .../listconfigsavailableconnectors.go | 31 + pkg/models/operations/listconnectortasks.go | 78 +- pkg/models/operations/listflows.go | 43 +- pkg/models/operations/listlogs.go | 183 +++- pkg/models/operations/listpayments.go | 80 +- pkg/models/operations/listruns.go | 53 +- pkg/models/operations/listscopes.go | 33 +- pkg/models/operations/listtransactions.go | 243 ++++- pkg/models/operations/listusers.go | 33 +- pkg/models/operations/listwallets.go | 93 +- pkg/models/operations/options.go | 87 ++ .../operations/orchestrationgetserverinfo.go | 41 +- .../operations/paymentsgetserverinfo.go | 31 + pkg/models/operations/paymentslistaccounts.go | 78 +- pkg/models/operations/readclient.go | 41 +- pkg/models/operations/readconnectorconfig.go | 41 +- pkg/models/operations/readscope.go | 41 +- pkg/models/operations/readstats.go | 49 +- pkg/models/operations/readuser.go | 41 +- pkg/models/operations/resetconnector.go | 33 +- pkg/models/operations/reverttransaction.go | 65 +- pkg/models/operations/runscript.go | 68 +- pkg/models/operations/runworkflow.go | 70 +- pkg/models/operations/search.go | 31 + pkg/models/operations/searchgetserverinfo.go | 31 + pkg/models/operations/testconfig.go | 39 + pkg/models/operations/uninstallconnector.go | 33 +- pkg/models/operations/updateclient.go | 54 +- pkg/models/operations/updatemapping.go | 62 +- pkg/models/operations/updatescope.go | 54 +- pkg/models/operations/updatewallet.go | 59 +- pkg/models/operations/voidhold.go | 44 +- pkg/models/operations/walletsgetserverinfo.go | 47 +- pkg/models/sdkerrors/sdkerror.go | 35 + pkg/models/shared/account.go | 32 +- pkg/models/shared/accountresponse.go | 9 + pkg/models/shared/accountscursor.go | 44 + pkg/models/shared/accountscursorresponse.go | 44 + .../shared/accountwithvolumesandbalances.go | 50 +- .../shared/aggregatebalancesresponse.go | 9 + pkg/models/shared/assetholder.go | 9 + pkg/models/shared/attempt.go | 102 +++ pkg/models/shared/attemptresponse.go | 11 +- pkg/models/shared/balance.go | 9 + pkg/models/shared/balancescursorresponse.go | 44 + pkg/models/shared/balancewithassets.go | 16 + pkg/models/shared/bankingcircleconfig.go | 30 + pkg/models/shared/client.go | 72 ++ pkg/models/shared/clientsecret.go | 30 + pkg/models/shared/config.go | 9 + pkg/models/shared/configchangesecret.go | 9 + pkg/models/shared/configinfo.go | 23 + pkg/models/shared/configinforesponse.go | 9 + pkg/models/shared/configresponse.go | 11 +- pkg/models/shared/configsresponse.go | 54 +- pkg/models/shared/configuser.go | 23 + pkg/models/shared/confirmholdrequest.go | 20 +- pkg/models/shared/connector.go | 47 + pkg/models/shared/connectorconfig.go | 159 ++++ pkg/models/shared/connectorconfigresponse.go | 11 +- pkg/models/shared/connectorenum.go | 12 - .../shared/connectorsconfigsresponse.go | 37 + pkg/models/shared/connectorsresponse.go | 27 +- pkg/models/shared/contract.go | 23 +- pkg/models/shared/createbalancerequest.go | 9 + pkg/models/shared/createbalanceresponse.go | 9 + pkg/models/shared/createclientrequest.go | 51 ++ pkg/models/shared/createclientresponse.go | 9 + pkg/models/shared/createscoperequest.go | 16 + pkg/models/shared/createscoperesponse.go | 9 + pkg/models/shared/createsecretrequest.go | 16 + pkg/models/shared/createsecretresponse.go | 9 + pkg/models/shared/createwalletrequest.go | 17 + pkg/models/shared/createwalletresponse.go | 9 + pkg/models/shared/createworkflowrequest.go | 9 + pkg/models/shared/createworkflowresponse.go | 9 + pkg/models/shared/creditwalletrequest.go | 45 +- pkg/models/shared/currencycloudconfig.go | 39 +- pkg/models/shared/debitwalletrequest.go | 72 +- pkg/models/shared/debitwalletresponse.go | 9 + pkg/models/shared/dummypayconfig.go | 46 +- pkg/models/shared/error.go | 34 +- pkg/models/shared/errorresponse.go | 29 +- pkg/models/shared/errorsenum.go | 50 ++ pkg/models/shared/errorsenumenum.go | 13 - pkg/models/shared/expandeddebithold.go | 84 +- pkg/models/shared/getbalanceresponse.go | 9 + pkg/models/shared/getholdresponse.go | 9 + pkg/models/shared/getholdsresponse.go | 44 + pkg/models/shared/gettransactionsresponse.go | 44 + pkg/models/shared/getwalletresponse.go | 9 + .../shared/getworkflowoccurrenceresponse.go | 9 + pkg/models/shared/getworkflowresponse.go | 9 + pkg/models/shared/hold.go | 64 +- pkg/models/shared/ledgeraccountsubject.go | 22 + pkg/models/shared/ledgerinfo.go | 33 + pkg/models/shared/ledgerinforesponse.go | 14 + pkg/models/shared/ledgerstorage.go | 16 + pkg/models/shared/listbalancesresponse.go | 44 + pkg/models/shared/listclientsresponse.go | 9 + pkg/models/shared/listrunsresponse.go | 57 ++ pkg/models/shared/listscopesresponse.go | 9 + pkg/models/shared/listusersresponse.go | 9 + pkg/models/shared/listwalletsresponse.go | 44 + pkg/models/shared/listworkflowsresponse.go | 9 + pkg/models/shared/log.go | 90 +- pkg/models/shared/logscursorresponse.go | 44 + pkg/models/shared/mapping.go | 9 + pkg/models/shared/mappingresponse.go | 9 + pkg/models/shared/migrationinfo.go | 83 ++ pkg/models/shared/modulrconfig.go | 23 + pkg/models/shared/monetary.go | 22 +- pkg/models/shared/payment.go | 260 +++++- pkg/models/shared/paymentadjustment.go | 62 +- pkg/models/shared/paymentmetadata.go | 23 + pkg/models/shared/paymentmetadatachangelog.go | 28 + pkg/models/shared/paymentresponse.go | 9 + pkg/models/shared/paymentsaccount.go | 87 +- pkg/models/shared/paymentscursor.go | 44 + pkg/models/shared/paymentstatus.go | 41 + pkg/models/shared/paymentstatusenum.go | 10 - pkg/models/shared/posting.go | 30 + pkg/models/shared/posttransaction.go | 70 +- pkg/models/shared/query.go | 58 ++ pkg/models/shared/readclientresponse.go | 9 + pkg/models/shared/readscoperesponse.go | 9 + pkg/models/shared/readuserresponse.go | 9 + pkg/models/shared/response.go | 96 +- pkg/models/shared/runworkflowresponse.go | 9 + pkg/models/shared/scope.go | 30 + pkg/models/shared/script.go | 42 +- pkg/models/shared/scriptresponse.go | 38 +- pkg/models/shared/secret.go | 37 + pkg/models/shared/security.go | 9 + pkg/models/shared/serverinfo.go | 9 + pkg/models/shared/stagestatus.go | 49 + pkg/models/shared/stats.go | 16 + pkg/models/shared/statsresponse.go | 9 + pkg/models/shared/stripeconfig.go | 48 +- pkg/models/shared/stripetransferrequest.go | 46 +- pkg/models/shared/stripetransferresponse.go | 6 + pkg/models/shared/subject.go | 93 ++ pkg/models/shared/taskbankingcircle.go | 91 +- pkg/models/shared/taskcurrencycloud.go | 84 +- pkg/models/shared/taskdummypay.go | 98 +- pkg/models/shared/taskmodulr.go | 110 ++- pkg/models/shared/taskresponse.go | 167 +++- pkg/models/shared/taskscursor.go | 210 ++++- pkg/models/shared/taskstripe.go | 110 ++- pkg/models/shared/taskwise.go | 110 ++- pkg/models/shared/transaction.go | 63 ++ pkg/models/shared/transactiondata.go | 42 + pkg/models/shared/transactionresponse.go | 9 + pkg/models/shared/transactions.go | 9 + .../shared/transactionscursorresponse.go | 44 + pkg/models/shared/transactionsresponse.go | 9 + pkg/models/shared/updateclientrequest.go | 51 ++ pkg/models/shared/updateclientresponse.go | 9 + pkg/models/shared/updatescoperequest.go | 16 + pkg/models/shared/updatescoperesponse.go | 9 + pkg/models/shared/user.go | 23 + pkg/models/shared/volume.go | 23 + pkg/models/shared/wallet.go | 61 +- pkg/models/shared/walletserrorresponse.go | 34 +- pkg/models/shared/walletstransaction.go | 64 ++ pkg/models/shared/walletsubject.go | 30 + pkg/models/shared/walletsvolume.go | 23 + pkg/models/shared/walletwithbalances.go | 73 +- pkg/models/shared/webhooksconfig.go | 78 ++ pkg/models/shared/wiseconfig.go | 9 + pkg/models/shared/workflow.go | 42 + pkg/models/shared/workflowconfig.go | 9 + pkg/models/shared/workflowoccurrence.go | 49 + pkg/types/bigint.go | 21 + pkg/types/date.go | 54 ++ pkg/types/datetime.go | 23 + pkg/types/decimal.go | 20 + pkg/types/pointers.go | 10 + pkg/utils/contenttype.go | 2 + pkg/utils/form.go | 41 +- pkg/utils/headers.go | 16 +- pkg/utils/json.go | 573 ++++++++++++ pkg/utils/pathparams.go | 92 +- pkg/utils/queryparams.go | 51 +- pkg/utils/requestbody.go | 71 +- pkg/utils/retries.go | 2 + pkg/utils/security.go | 52 +- pkg/utils/utils.go | 29 +- scopes.go | 185 ++-- script.go | 55 +- search.go | 50 +- server.go | 54 +- stats.go | 59 +- transactions.go | 259 ++++-- users.go | 73 +- wallets.go | 490 ++++++---- webhooks.go | 224 +++-- 627 files changed, 21708 insertions(+), 1810 deletions(-) create mode 100755 .gitattributes create mode 100755 .gitignore create mode 100755 docs/models/operations/activateconfigrequest.md create mode 100755 docs/models/operations/activateconfigresponse.md create mode 100755 docs/models/operations/addmetadataontransactionrequest.md create mode 100755 docs/models/operations/addmetadataontransactionresponse.md create mode 100755 docs/models/operations/addmetadatatoaccountrequest.md create mode 100755 docs/models/operations/addmetadatatoaccountresponse.md create mode 100755 docs/models/operations/addscopetoclientrequest.md create mode 100755 docs/models/operations/addscopetoclientresponse.md create mode 100755 docs/models/operations/addtransientscoperequest.md create mode 100755 docs/models/operations/addtransientscoperesponse.md create mode 100755 docs/models/operations/changeconfigsecretrequest.md create mode 100755 docs/models/operations/changeconfigsecretresponse.md create mode 100755 docs/models/operations/confirmholdrequest.md create mode 100755 docs/models/operations/confirmholdresponse.md create mode 100755 docs/models/operations/connectorsstripetransferresponse.md create mode 100755 docs/models/operations/countaccountsmetadata.md create mode 100755 docs/models/operations/countaccountsrequest.md create mode 100755 docs/models/operations/countaccountsresponse.md create mode 100755 docs/models/operations/counttransactionsmetadata.md create mode 100755 docs/models/operations/counttransactionsrequest.md create mode 100755 docs/models/operations/counttransactionsresponse.md create mode 100755 docs/models/operations/createbalancerequest.md create mode 100755 docs/models/operations/createbalanceresponse.md create mode 100755 docs/models/operations/createclientresponse.md create mode 100755 docs/models/operations/createscoperesponse.md create mode 100755 docs/models/operations/createsecretrequest.md create mode 100755 docs/models/operations/createsecretresponse.md create mode 100755 docs/models/operations/createtransactionrequest.md create mode 100755 docs/models/operations/createtransactionresponse.md create mode 100755 docs/models/operations/createtransactionsrequest.md create mode 100755 docs/models/operations/createtransactionsresponse.md create mode 100755 docs/models/operations/createwalletresponse.md create mode 100755 docs/models/operations/createworkflowresponse.md create mode 100755 docs/models/operations/creditwalletrequest.md create mode 100755 docs/models/operations/creditwalletresponse.md create mode 100755 docs/models/operations/deactivateconfigrequest.md create mode 100755 docs/models/operations/deactivateconfigresponse.md create mode 100755 docs/models/operations/debitwalletrequest.md create mode 100755 docs/models/operations/debitwalletresponse.md create mode 100755 docs/models/operations/deleteclientrequest.md create mode 100755 docs/models/operations/deleteclientresponse.md create mode 100755 docs/models/operations/deleteconfigrequest.md create mode 100755 docs/models/operations/deleteconfigresponse.md create mode 100755 docs/models/operations/deletescopefromclientrequest.md create mode 100755 docs/models/operations/deletescopefromclientresponse.md create mode 100755 docs/models/operations/deletescoperequest.md create mode 100755 docs/models/operations/deletescoperesponse.md create mode 100755 docs/models/operations/deletesecretrequest.md create mode 100755 docs/models/operations/deletesecretresponse.md create mode 100755 docs/models/operations/deletetransientscoperequest.md create mode 100755 docs/models/operations/deletetransientscoperesponse.md create mode 100755 docs/models/operations/getaccountrequest.md create mode 100755 docs/models/operations/getaccountresponse.md create mode 100755 docs/models/operations/getbalancerequest.md create mode 100755 docs/models/operations/getbalanceresponse.md create mode 100755 docs/models/operations/getbalancesaggregatedrequest.md create mode 100755 docs/models/operations/getbalancesaggregatedresponse.md create mode 100755 docs/models/operations/getbalancesrequest.md create mode 100755 docs/models/operations/getbalancesresponse.md create mode 100755 docs/models/operations/getconnectortaskrequest.md create mode 100755 docs/models/operations/getconnectortaskresponse.md create mode 100755 docs/models/operations/getflowrequest.md create mode 100755 docs/models/operations/getflowresponse.md create mode 100755 docs/models/operations/getholdrequest.md create mode 100755 docs/models/operations/getholdresponse.md create mode 100755 docs/models/operations/getholdsmetadata.md create mode 100755 docs/models/operations/getholdsrequest.md create mode 100755 docs/models/operations/getholdsresponse.md create mode 100755 docs/models/operations/getinforesponse.md create mode 100755 docs/models/operations/getledgerinforequest.md create mode 100755 docs/models/operations/getledgerinforesponse.md create mode 100755 docs/models/operations/getmanyconfigsrequest.md create mode 100755 docs/models/operations/getmanyconfigsresponse.md create mode 100755 docs/models/operations/getmappingrequest.md create mode 100755 docs/models/operations/getmappingresponse.md create mode 100755 docs/models/operations/getpaymentrequest.md create mode 100755 docs/models/operations/getpaymentresponse.md create mode 100755 docs/models/operations/getserverinforesponse.md create mode 100755 docs/models/operations/gettransactionrequest.md create mode 100755 docs/models/operations/gettransactionresponse.md create mode 100755 docs/models/operations/gettransactionsrequest.md create mode 100755 docs/models/operations/gettransactionsresponse.md create mode 100755 docs/models/operations/getwalletrequest.md create mode 100755 docs/models/operations/getwalletresponse.md create mode 100755 docs/models/operations/getworkflowoccurrencerequest.md create mode 100755 docs/models/operations/getworkflowoccurrenceresponse.md create mode 100755 docs/models/operations/insertconfigresponse.md create mode 100755 docs/models/operations/installconnectorrequest.md create mode 100755 docs/models/operations/installconnectorresponse.md create mode 100755 docs/models/operations/listaccountsbalanceoperator.md create mode 100755 docs/models/operations/listaccountsmetadata.md create mode 100755 docs/models/operations/listaccountsrequest.md create mode 100755 docs/models/operations/listaccountsresponse.md create mode 100755 docs/models/operations/listallconnectorsresponse.md create mode 100755 docs/models/operations/listbalancesrequest.md create mode 100755 docs/models/operations/listbalancesresponse.md create mode 100755 docs/models/operations/listclientsresponse.md create mode 100755 docs/models/operations/listconfigsavailableconnectorsresponse.md create mode 100755 docs/models/operations/listconnectortasksrequest.md create mode 100755 docs/models/operations/listconnectortasksresponse.md create mode 100755 docs/models/operations/listflowsresponse.md create mode 100755 docs/models/operations/listlogsrequest.md create mode 100755 docs/models/operations/listlogsresponse.md create mode 100755 docs/models/operations/listpaymentsrequest.md create mode 100755 docs/models/operations/listpaymentsresponse.md create mode 100755 docs/models/operations/listrunsrequest.md create mode 100755 docs/models/operations/listrunsresponse.md create mode 100755 docs/models/operations/listscopesresponse.md create mode 100755 docs/models/operations/listtransactionsmetadata.md create mode 100755 docs/models/operations/listtransactionsrequest.md create mode 100755 docs/models/operations/listtransactionsresponse.md create mode 100755 docs/models/operations/listusersresponse.md create mode 100755 docs/models/operations/listwalletsmetadata.md create mode 100755 docs/models/operations/listwalletsrequest.md create mode 100755 docs/models/operations/listwalletsresponse.md create mode 100755 docs/models/operations/orchestrationgetserverinforesponse.md create mode 100755 docs/models/operations/paymentsgetserverinforesponse.md create mode 100755 docs/models/operations/paymentslistaccountsrequest.md create mode 100755 docs/models/operations/paymentslistaccountsresponse.md create mode 100755 docs/models/operations/readclientrequest.md create mode 100755 docs/models/operations/readclientresponse.md create mode 100755 docs/models/operations/readconnectorconfigrequest.md create mode 100755 docs/models/operations/readconnectorconfigresponse.md create mode 100755 docs/models/operations/readscoperequest.md create mode 100755 docs/models/operations/readscoperesponse.md create mode 100755 docs/models/operations/readstatsrequest.md create mode 100755 docs/models/operations/readstatsresponse.md create mode 100755 docs/models/operations/readuserrequest.md create mode 100755 docs/models/operations/readuserresponse.md create mode 100755 docs/models/operations/resetconnectorrequest.md create mode 100755 docs/models/operations/resetconnectorresponse.md create mode 100755 docs/models/operations/reverttransactionrequest.md create mode 100755 docs/models/operations/reverttransactionresponse.md create mode 100755 docs/models/operations/runscriptrequest.md create mode 100755 docs/models/operations/runscriptresponse.md create mode 100755 docs/models/operations/runworkflowrequest.md create mode 100755 docs/models/operations/runworkflowresponse.md create mode 100755 docs/models/operations/searchgetserverinforesponse.md create mode 100755 docs/models/operations/searchresponse.md create mode 100755 docs/models/operations/testconfigrequest.md create mode 100755 docs/models/operations/testconfigresponse.md create mode 100755 docs/models/operations/uninstallconnectorrequest.md create mode 100755 docs/models/operations/uninstallconnectorresponse.md create mode 100755 docs/models/operations/updateclientrequest.md create mode 100755 docs/models/operations/updateclientresponse.md create mode 100755 docs/models/operations/updatemappingrequest.md create mode 100755 docs/models/operations/updatemappingresponse.md create mode 100755 docs/models/operations/updatescoperequest.md create mode 100755 docs/models/operations/updatescoperesponse.md create mode 100755 docs/models/operations/updatewalletrequest.md create mode 100755 docs/models/operations/updatewalletrequestbody.md create mode 100755 docs/models/operations/updatewalletresponse.md create mode 100755 docs/models/operations/voidholdrequest.md create mode 100755 docs/models/operations/voidholdresponse.md create mode 100755 docs/models/operations/walletsgetserverinforesponse.md create mode 100755 docs/models/shared/account.md create mode 100755 docs/models/shared/accountmetadata.md create mode 100755 docs/models/shared/accountresponse.md create mode 100755 docs/models/shared/accountscursor.md create mode 100755 docs/models/shared/accountscursorcursor.md create mode 100755 docs/models/shared/accountscursorresponse.md create mode 100755 docs/models/shared/accountscursorresponsecursor.md create mode 100755 docs/models/shared/accountwithvolumesandbalances.md create mode 100755 docs/models/shared/accountwithvolumesandbalancesmetadata.md create mode 100755 docs/models/shared/aggregatebalancesresponse.md create mode 100755 docs/models/shared/assetholder.md create mode 100755 docs/models/shared/attempt.md create mode 100755 docs/models/shared/attemptresponse.md create mode 100755 docs/models/shared/balance.md create mode 100755 docs/models/shared/balancescursorresponse.md create mode 100755 docs/models/shared/balancescursorresponsecursor.md create mode 100755 docs/models/shared/balancewithassets.md create mode 100755 docs/models/shared/bankingcircleconfig.md create mode 100755 docs/models/shared/client.md create mode 100755 docs/models/shared/clientsecret.md create mode 100755 docs/models/shared/config.md create mode 100755 docs/models/shared/configchangesecret.md create mode 100755 docs/models/shared/configinfo.md create mode 100755 docs/models/shared/configinforesponse.md create mode 100755 docs/models/shared/configresponse.md create mode 100755 docs/models/shared/configsresponse.md create mode 100755 docs/models/shared/configsresponsecursor.md create mode 100755 docs/models/shared/configuser.md create mode 100755 docs/models/shared/confirmholdrequest.md create mode 100755 docs/models/shared/connector.md create mode 100755 docs/models/shared/connectorconfig.md create mode 100755 docs/models/shared/connectorconfigresponse.md create mode 100755 docs/models/shared/connectorsconfigsresponse.md create mode 100755 docs/models/shared/connectorsconfigsresponsedata.md create mode 100755 docs/models/shared/connectorsconfigsresponsedataconnector.md create mode 100755 docs/models/shared/connectorsconfigsresponsedataconnectorkey.md create mode 100755 docs/models/shared/connectorsresponse.md create mode 100755 docs/models/shared/connectorsresponsedata.md create mode 100755 docs/models/shared/contract.md create mode 100755 docs/models/shared/contractexpr.md create mode 100755 docs/models/shared/createbalancerequest.md create mode 100755 docs/models/shared/createbalanceresponse.md create mode 100755 docs/models/shared/createclientrequest.md create mode 100755 docs/models/shared/createclientresponse.md create mode 100755 docs/models/shared/createscoperequest.md create mode 100755 docs/models/shared/createscoperesponse.md create mode 100755 docs/models/shared/createsecretrequest.md create mode 100755 docs/models/shared/createsecretresponse.md create mode 100755 docs/models/shared/createwalletrequest.md create mode 100755 docs/models/shared/createwalletresponse.md create mode 100755 docs/models/shared/createworkflowrequest.md create mode 100755 docs/models/shared/createworkflowresponse.md create mode 100755 docs/models/shared/creditwalletrequest.md create mode 100755 docs/models/shared/currencycloudconfig.md create mode 100755 docs/models/shared/debitwalletrequest.md create mode 100755 docs/models/shared/debitwalletresponse.md create mode 100755 docs/models/shared/dummypayconfig.md create mode 100755 docs/models/shared/error.md create mode 100755 docs/models/shared/errorresponse.md create mode 100755 docs/models/shared/errorsenum.md create mode 100755 docs/models/shared/expandeddebithold.md create mode 100755 docs/models/shared/getbalanceresponse.md create mode 100755 docs/models/shared/getholdresponse.md create mode 100755 docs/models/shared/getholdsresponse.md create mode 100755 docs/models/shared/getholdsresponsecursor.md create mode 100755 docs/models/shared/gettransactionsresponse.md create mode 100755 docs/models/shared/gettransactionsresponsecursor.md create mode 100755 docs/models/shared/getwalletresponse.md create mode 100755 docs/models/shared/getworkflowoccurrenceresponse.md create mode 100755 docs/models/shared/getworkflowresponse.md create mode 100755 docs/models/shared/hold.md create mode 100755 docs/models/shared/ledgeraccountsubject.md create mode 100755 docs/models/shared/ledgerinfo.md create mode 100755 docs/models/shared/ledgerinforesponse.md create mode 100755 docs/models/shared/ledgerinfostorage.md create mode 100755 docs/models/shared/ledgerstorage.md create mode 100755 docs/models/shared/listbalancesresponse.md create mode 100755 docs/models/shared/listbalancesresponsecursor.md create mode 100755 docs/models/shared/listclientsresponse.md create mode 100755 docs/models/shared/listrunsresponse.md create mode 100755 docs/models/shared/listrunsresponsecursor.md create mode 100755 docs/models/shared/listscopesresponse.md create mode 100755 docs/models/shared/listusersresponse.md create mode 100755 docs/models/shared/listwalletsresponse.md create mode 100755 docs/models/shared/listwalletsresponsecursor.md create mode 100755 docs/models/shared/listworkflowsresponse.md create mode 100755 docs/models/shared/log.md create mode 100755 docs/models/shared/logdata.md create mode 100755 docs/models/shared/logscursorresponse.md create mode 100755 docs/models/shared/logscursorresponsecursor.md create mode 100755 docs/models/shared/logtype.md create mode 100755 docs/models/shared/mapping.md create mode 100755 docs/models/shared/mappingresponse.md create mode 100755 docs/models/shared/migrationinfo.md create mode 100755 docs/models/shared/migrationinfostate.md create mode 100755 docs/models/shared/modulrconfig.md create mode 100755 docs/models/shared/monetary.md create mode 100755 docs/models/shared/payment.md create mode 100755 docs/models/shared/paymentadjustment.md create mode 100755 docs/models/shared/paymentadjustmentraw.md create mode 100755 docs/models/shared/paymentmetadata.md create mode 100755 docs/models/shared/paymentmetadatachangelog.md create mode 100755 docs/models/shared/paymentraw.md create mode 100755 docs/models/shared/paymentresponse.md create mode 100755 docs/models/shared/paymentsaccount.md create mode 100755 docs/models/shared/paymentsaccounttype.md create mode 100755 docs/models/shared/paymentscheme.md create mode 100755 docs/models/shared/paymentscursor.md create mode 100755 docs/models/shared/paymentscursorcursor.md create mode 100755 docs/models/shared/paymentstatus.md create mode 100755 docs/models/shared/paymenttype.md create mode 100755 docs/models/shared/posting.md create mode 100755 docs/models/shared/posttransaction.md create mode 100755 docs/models/shared/posttransactionscript.md create mode 100755 docs/models/shared/posttransactionscriptvars.md create mode 100755 docs/models/shared/query.md create mode 100755 docs/models/shared/readclientresponse.md create mode 100755 docs/models/shared/readscoperesponse.md create mode 100755 docs/models/shared/readuserresponse.md create mode 100755 docs/models/shared/response.md create mode 100755 docs/models/shared/responsecursor.md create mode 100755 docs/models/shared/responsecursordata.md create mode 100755 docs/models/shared/responsecursortotal.md create mode 100755 docs/models/shared/responsedata.md create mode 100755 docs/models/shared/runworkflowresponse.md create mode 100755 docs/models/shared/scope.md create mode 100755 docs/models/shared/script.md create mode 100755 docs/models/shared/scriptresponse.md create mode 100755 docs/models/shared/scriptvars.md create mode 100755 docs/models/shared/secret.md create mode 100755 docs/models/shared/security.md create mode 100755 docs/models/shared/serverinfo.md create mode 100755 docs/models/shared/stagestatus.md create mode 100755 docs/models/shared/stats.md create mode 100755 docs/models/shared/statsresponse.md create mode 100755 docs/models/shared/stripeconfig.md create mode 100755 docs/models/shared/stripetransferrequest.md create mode 100755 docs/models/shared/stripetransferrequestmetadata.md create mode 100755 docs/models/shared/stripetransferresponse.md create mode 100755 docs/models/shared/subject.md create mode 100755 docs/models/shared/taskbankingcircle.md create mode 100755 docs/models/shared/taskbankingcircledescriptor.md create mode 100755 docs/models/shared/taskbankingcirclestate.md create mode 100755 docs/models/shared/taskcurrencycloud.md create mode 100755 docs/models/shared/taskcurrencyclouddescriptor.md create mode 100755 docs/models/shared/taskcurrencycloudstate.md create mode 100755 docs/models/shared/taskdummypay.md create mode 100755 docs/models/shared/taskdummypaydescriptor.md create mode 100755 docs/models/shared/taskdummypaystate.md create mode 100755 docs/models/shared/taskmodulr.md create mode 100755 docs/models/shared/taskmodulrdescriptor.md create mode 100755 docs/models/shared/taskmodulrstate.md create mode 100755 docs/models/shared/taskresponse.md create mode 100755 docs/models/shared/taskresponsedata.md create mode 100755 docs/models/shared/taskscursor.md create mode 100755 docs/models/shared/taskscursorcursor.md create mode 100755 docs/models/shared/taskscursorcursordata.md create mode 100755 docs/models/shared/taskstripe.md create mode 100755 docs/models/shared/taskstripedescriptor.md create mode 100755 docs/models/shared/taskstripestate.md create mode 100755 docs/models/shared/taskwise.md create mode 100755 docs/models/shared/taskwisedescriptor.md create mode 100755 docs/models/shared/taskwisestate.md create mode 100755 docs/models/shared/transaction.md create mode 100755 docs/models/shared/transactiondata.md create mode 100755 docs/models/shared/transactionresponse.md create mode 100755 docs/models/shared/transactions.md create mode 100755 docs/models/shared/transactionscursorresponse.md create mode 100755 docs/models/shared/transactionscursorresponsecursor.md create mode 100755 docs/models/shared/transactionsresponse.md create mode 100755 docs/models/shared/updateclientrequest.md create mode 100755 docs/models/shared/updateclientresponse.md create mode 100755 docs/models/shared/updatescoperequest.md create mode 100755 docs/models/shared/updatescoperesponse.md create mode 100755 docs/models/shared/user.md create mode 100755 docs/models/shared/volume.md create mode 100755 docs/models/shared/wallet.md create mode 100755 docs/models/shared/walletserrorresponse.md create mode 100755 docs/models/shared/walletstransaction.md create mode 100755 docs/models/shared/walletsubject.md create mode 100755 docs/models/shared/walletsvolume.md create mode 100755 docs/models/shared/walletwithbalances.md create mode 100755 docs/models/shared/walletwithbalancesbalances.md create mode 100755 docs/models/shared/webhooksconfig.md create mode 100755 docs/models/shared/wiseconfig.md create mode 100755 docs/models/shared/workflow.md create mode 100755 docs/models/shared/workflowconfig.md create mode 100755 docs/models/shared/workflowoccurrence.md create mode 100755 docs/sdks/accounts/README.md create mode 100755 docs/sdks/balances/README.md create mode 100755 docs/sdks/clients/README.md create mode 100755 docs/sdks/formance/README.md create mode 100755 docs/sdks/ledger/README.md create mode 100755 docs/sdks/logs/README.md create mode 100755 docs/sdks/mapping/README.md create mode 100755 docs/sdks/orchestration/README.md create mode 100755 docs/sdks/payments/README.md create mode 100755 docs/sdks/scopes/README.md create mode 100755 docs/sdks/script/README.md create mode 100755 docs/sdks/search/README.md create mode 100755 docs/sdks/server/README.md create mode 100755 docs/sdks/stats/README.md create mode 100755 docs/sdks/transactions/README.md create mode 100755 docs/sdks/users/README.md create mode 100755 docs/sdks/wallets/README.md create mode 100755 docs/sdks/webhooks/README.md create mode 100755 pkg/models/operations/options.go create mode 100755 pkg/models/sdkerrors/sdkerror.go create mode 100755 pkg/models/shared/attempt.go create mode 100755 pkg/models/shared/connector.go create mode 100755 pkg/models/shared/connectorconfig.go delete mode 100755 pkg/models/shared/connectorenum.go create mode 100755 pkg/models/shared/errorsenum.go delete mode 100755 pkg/models/shared/errorsenumenum.go create mode 100755 pkg/models/shared/ledgeraccountsubject.go create mode 100755 pkg/models/shared/ledgerinfo.go create mode 100755 pkg/models/shared/ledgerinforesponse.go create mode 100755 pkg/models/shared/listrunsresponse.go create mode 100755 pkg/models/shared/migrationinfo.go create mode 100755 pkg/models/shared/paymentstatus.go delete mode 100755 pkg/models/shared/paymentstatusenum.go create mode 100755 pkg/models/shared/stripetransferresponse.go create mode 100755 pkg/models/shared/subject.go create mode 100755 pkg/models/shared/walletsubject.go create mode 100755 pkg/models/shared/webhooksconfig.go create mode 100755 pkg/types/bigint.go create mode 100755 pkg/types/datetime.go create mode 100755 pkg/types/decimal.go create mode 100755 pkg/types/pointers.go create mode 100755 pkg/utils/json.go diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..e6a9944 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.go linguist-generated=false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..8b13789 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ + diff --git a/README.md b/README.md index 5a4c7bf..ff998dd 100755 --- a/README.md +++ b/README.md @@ -25,17 +25,17 @@ go get github.com/speakeasy-sdks/formance-go-sdk ```go package main -import ( - "context" - "log" - "github.com/speakeasy-sdks/formance-go-sdk" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" ) func main() { - s := formance.New(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", }), ) @@ -53,144 +53,176 @@ func main() { -## SDK Available Operations +## Available Resources and Operations -### Formance SDK +### [Formance SDK](docs/sdks/formance/README.md) -* `GetServerInfo` - Get server info -* `PaymentsgetServerInfo` - Get server info -* `SearchgetServerInfo` - Get server info +* [GetServerInfo](docs/sdks/formance/README.md#getserverinfo) - Get server info +* [PaymentsgetServerInfo](docs/sdks/formance/README.md#paymentsgetserverinfo) - Get server info +* [SearchgetServerInfo](docs/sdks/formance/README.md#searchgetserverinfo) - Get server info -### Accounts +### [Accounts](docs/sdks/accounts/README.md) -* `AddMetadataToAccount` - Add metadata to an account -* `CountAccounts` - Count the accounts from a ledger -* `GetAccount` - Get account by its address -* `ListAccounts` - List accounts from a ledger +* [AddMetadataToAccount](docs/sdks/accounts/README.md#addmetadatatoaccount) - Add metadata to an account +* [CountAccounts](docs/sdks/accounts/README.md#countaccounts) - Count the accounts from a ledger +* [GetAccount](docs/sdks/accounts/README.md#getaccount) - Get account by its address +* [ListAccounts](docs/sdks/accounts/README.md#listaccounts) - List accounts from a ledger -### Balances +### [Balances](docs/sdks/balances/README.md) -* `GetBalances` - Get the balances from a ledger's account -* `GetBalancesAggregated` - Get the aggregated balances from selected accounts +* [GetBalances](docs/sdks/balances/README.md#getbalances) - Get the balances from a ledger's account +* [GetBalancesAggregated](docs/sdks/balances/README.md#getbalancesaggregated) - Get the aggregated balances from selected accounts -### Clients +### [Clients](docs/sdks/clients/README.md) -* `AddScopeToClient` - Add scope to client -* `CreateClient` - Create client -* `CreateSecret` - Add a secret to a client -* `DeleteClient` - Delete client -* `DeleteScopeFromClient` - Delete scope from client -* `DeleteSecret` - Delete a secret from a client -* `ListClients` - List clients -* `ReadClient` - Read client -* `UpdateClient` - Update client +* [AddScopeToClient](docs/sdks/clients/README.md#addscopetoclient) - Add scope to client +* [CreateClient](docs/sdks/clients/README.md#createclient) - Create client +* [CreateSecret](docs/sdks/clients/README.md#createsecret) - Add a secret to a client +* [DeleteClient](docs/sdks/clients/README.md#deleteclient) - Delete client +* [DeleteScopeFromClient](docs/sdks/clients/README.md#deletescopefromclient) - Delete scope from client +* [DeleteSecret](docs/sdks/clients/README.md#deletesecret) - Delete a secret from a client +* [ListClients](docs/sdks/clients/README.md#listclients) - List clients +* [ReadClient](docs/sdks/clients/README.md#readclient) - Read client +* [UpdateClient](docs/sdks/clients/README.md#updateclient) - Update client -### Ledger +### [Ledger](docs/sdks/ledger/README.md) -* `GetLedgerInfo` - Get information about a ledger +* [GetLedgerInfo](docs/sdks/ledger/README.md#getledgerinfo) - Get information about a ledger -### Logs +### [Logs](docs/sdks/logs/README.md) -* `ListLogs` - List the logs from a ledger +* [ListLogs](docs/sdks/logs/README.md#listlogs) - List the logs from a ledger -### Mapping +### [Mapping](docs/sdks/mapping/README.md) -* `GetMapping` - Get the mapping of a ledger -* `UpdateMapping` - Update the mapping of a ledger +* [GetMapping](docs/sdks/mapping/README.md#getmapping) - Get the mapping of a ledger +* [UpdateMapping](docs/sdks/mapping/README.md#updatemapping) - Update the mapping of a ledger -### Orchestration +### [Orchestration](docs/sdks/orchestration/README.md) -* `CreateWorkflow` - Create workflow -* `GetFlow` - Get a flow by id -* `GetWorkflowOccurrence` - Get a workflow occurrence by id -* `ListFlows` - List registered flows -* `ListRuns` - List occurrences of a workflow -* `OrchestrationgetServerInfo` - Get server info -* `RunWorkflow` - Run workflow +* [CreateWorkflow](docs/sdks/orchestration/README.md#createworkflow) - Create workflow +* [GetFlow](docs/sdks/orchestration/README.md#getflow) - Get a flow by id +* [GetWorkflowOccurrence](docs/sdks/orchestration/README.md#getworkflowoccurrence) - Get a workflow occurrence by id +* [ListFlows](docs/sdks/orchestration/README.md#listflows) - List registered flows +* [ListRuns](docs/sdks/orchestration/README.md#listruns) - List occurrences of a workflow +* [OrchestrationgetServerInfo](docs/sdks/orchestration/README.md#orchestrationgetserverinfo) - Get server info +* [RunWorkflow](docs/sdks/orchestration/README.md#runworkflow) - Run workflow -### Payments +### [Payments](docs/sdks/payments/README.md) -* `ConnectorsStripeTransfer` - Transfer funds between Stripe accounts -* `GetConnectorTask` - Read a specific task of the connector -* `GetPayment` - Get a payment -* `InstallConnector` - Install a connector -* `ListAllConnectors` - List all installed connectors -* `ListConfigsAvailableConnectors` - List the configs of each available connector -* `ListConnectorTasks` - List tasks from a connector -* `ListPayments` - List payments -* `PaymentslistAccounts` - List accounts -* `ReadConnectorConfig` - Read the config of a connector -* `ResetConnector` - Reset a connector -* `UninstallConnector` - Uninstall a connector +* [ConnectorsStripeTransfer](docs/sdks/payments/README.md#connectorsstripetransfer) - Transfer funds between Stripe accounts +* [GetConnectorTask](docs/sdks/payments/README.md#getconnectortask) - Read a specific task of the connector +* [GetPayment](docs/sdks/payments/README.md#getpayment) - Get a payment +* [InstallConnector](docs/sdks/payments/README.md#installconnector) - Install a connector +* [ListAllConnectors](docs/sdks/payments/README.md#listallconnectors) - List all installed connectors +* [ListConfigsAvailableConnectors](docs/sdks/payments/README.md#listconfigsavailableconnectors) - List the configs of each available connector +* [ListConnectorTasks](docs/sdks/payments/README.md#listconnectortasks) - List tasks from a connector +* [ListPayments](docs/sdks/payments/README.md#listpayments) - List payments +* [PaymentslistAccounts](docs/sdks/payments/README.md#paymentslistaccounts) - List accounts +* [ReadConnectorConfig](docs/sdks/payments/README.md#readconnectorconfig) - Read the config of a connector +* [ResetConnector](docs/sdks/payments/README.md#resetconnector) - Reset a connector +* [UninstallConnector](docs/sdks/payments/README.md#uninstallconnector) - Uninstall a connector -### Scopes +### [Scopes](docs/sdks/scopes/README.md) -* `AddTransientScope` - Add a transient scope to a scope -* `CreateScope` - Create scope -* `DeleteScope` - Delete scope -* `DeleteTransientScope` - Delete a transient scope from a scope -* `ListScopes` - List scopes -* `ReadScope` - Read scope -* `UpdateScope` - Update scope +* [AddTransientScope](docs/sdks/scopes/README.md#addtransientscope) - Add a transient scope to a scope +* [CreateScope](docs/sdks/scopes/README.md#createscope) - Create scope +* [DeleteScope](docs/sdks/scopes/README.md#deletescope) - Delete scope +* [DeleteTransientScope](docs/sdks/scopes/README.md#deletetransientscope) - Delete a transient scope from a scope +* [ListScopes](docs/sdks/scopes/README.md#listscopes) - List scopes +* [ReadScope](docs/sdks/scopes/README.md#readscope) - Read scope +* [UpdateScope](docs/sdks/scopes/README.md#updatescope) - Update scope -### Script +### [Script](docs/sdks/script/README.md) -* `RunScript` - Execute a Numscript +* [~~RunScript~~](docs/sdks/script/README.md#runscript) - Execute a Numscript :warning: **Deprecated** -### Search +### [Search](docs/sdks/search/README.md) -* `Search` - Search +* [Search](docs/sdks/search/README.md#search) - Search -### Server +### [Server](docs/sdks/server/README.md) -* `GetInfo` - Show server information +* [GetInfo](docs/sdks/server/README.md#getinfo) - Show server information -### Stats +### [Stats](docs/sdks/stats/README.md) -* `ReadStats` - Get statistics from a ledger +* [ReadStats](docs/sdks/stats/README.md#readstats) - Get statistics from a ledger -### Transactions +### [Transactions](docs/sdks/transactions/README.md) -* `CreateTransactions` - Create a new batch of transactions to a ledger -* `AddMetadataOnTransaction` - Set the metadata of a transaction by its ID -* `CountTransactions` - Count the transactions from a ledger -* `CreateTransaction` - Create a new transaction to a ledger -* `GetTransaction` - Get transaction from a ledger by its ID -* `ListTransactions` - List transactions from a ledger -* `RevertTransaction` - Revert a ledger transaction by its ID +* [CreateTransactions](docs/sdks/transactions/README.md#createtransactions) - Create a new batch of transactions to a ledger +* [AddMetadataOnTransaction](docs/sdks/transactions/README.md#addmetadataontransaction) - Set the metadata of a transaction by its ID +* [CountTransactions](docs/sdks/transactions/README.md#counttransactions) - Count the transactions from a ledger +* [CreateTransaction](docs/sdks/transactions/README.md#createtransaction) - Create a new transaction to a ledger +* [GetTransaction](docs/sdks/transactions/README.md#gettransaction) - Get transaction from a ledger by its ID +* [ListTransactions](docs/sdks/transactions/README.md#listtransactions) - List transactions from a ledger +* [RevertTransaction](docs/sdks/transactions/README.md#reverttransaction) - Revert a ledger transaction by its ID -### Users +### [Users](docs/sdks/users/README.md) -* `ListUsers` - List users -* `ReadUser` - Read user +* [ListUsers](docs/sdks/users/README.md#listusers) - List users +* [ReadUser](docs/sdks/users/README.md#readuser) - Read user -### Wallets +### [Wallets](docs/sdks/wallets/README.md) -* `ConfirmHold` - Confirm a hold -* `CreateBalance` - Create a balance -* `CreateWallet` - Create a new wallet -* `CreditWallet` - Credit a wallet -* `DebitWallet` - Debit a wallet -* `GetBalance` - Get detailed balance -* `GetHold` - Get a hold -* `GetHolds` - Get all holds for a wallet -* `GetTransactions` -* `GetWallet` - Get a wallet -* `ListBalances` - List balances of a wallet -* `ListWallets` - List all wallets -* `UpdateWallet` - Update a wallet -* `VoidHold` - Cancel a hold -* `WalletsgetServerInfo` - Get server info +* [ConfirmHold](docs/sdks/wallets/README.md#confirmhold) - Confirm a hold +* [CreateBalance](docs/sdks/wallets/README.md#createbalance) - Create a balance +* [CreateWallet](docs/sdks/wallets/README.md#createwallet) - Create a new wallet +* [CreditWallet](docs/sdks/wallets/README.md#creditwallet) - Credit a wallet +* [DebitWallet](docs/sdks/wallets/README.md#debitwallet) - Debit a wallet +* [GetBalance](docs/sdks/wallets/README.md#getbalance) - Get detailed balance +* [GetHold](docs/sdks/wallets/README.md#gethold) - Get a hold +* [GetHolds](docs/sdks/wallets/README.md#getholds) - Get all holds for a wallet +* [GetTransactions](docs/sdks/wallets/README.md#gettransactions) +* [GetWallet](docs/sdks/wallets/README.md#getwallet) - Get a wallet +* [ListBalances](docs/sdks/wallets/README.md#listbalances) - List balances of a wallet +* [ListWallets](docs/sdks/wallets/README.md#listwallets) - List all wallets +* [UpdateWallet](docs/sdks/wallets/README.md#updatewallet) - Update a wallet +* [VoidHold](docs/sdks/wallets/README.md#voidhold) - Cancel a hold +* [WalletsgetServerInfo](docs/sdks/wallets/README.md#walletsgetserverinfo) - Get server info -### Webhooks +### [Webhooks](docs/sdks/webhooks/README.md) -* `ActivateConfig` - Activate one config -* `ChangeConfigSecret` - Change the signing secret of a config -* `DeactivateConfig` - Deactivate one config -* `DeleteConfig` - Delete one config -* `GetManyConfigs` - Get many configs -* `InsertConfig` - Insert a new config -* `TestConfig` - Test one config +* [ActivateConfig](docs/sdks/webhooks/README.md#activateconfig) - Activate one config +* [ChangeConfigSecret](docs/sdks/webhooks/README.md#changeconfigsecret) - Change the signing secret of a config +* [DeactivateConfig](docs/sdks/webhooks/README.md#deactivateconfig) - Deactivate one config +* [DeleteConfig](docs/sdks/webhooks/README.md#deleteconfig) - Delete one config +* [GetManyConfigs](docs/sdks/webhooks/README.md#getmanyconfigs) - Get many configs +* [InsertConfig](docs/sdks/webhooks/README.md#insertconfig) - Insert a new config +* [TestConfig](docs/sdks/webhooks/README.md#testconfig) - Test one config + + + + + + + + + + + +# Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the +returned response object will have a `Next` method that can be called to pull down the next group of results. If the +return value of `Next` is `nil`, then there are no more pages to be fetched. + +Here's an example of one such pagination call: + + + + + + + + + + + + + + ### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/RELEASES.md b/RELEASES.md index 01be622..a4b216d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -110,4 +110,14 @@ Based on: - OpenAPI Doc v1.0.0-rc.5 ./stack.yaml - Speakeasy CLI 1.12.0 https://github.com/speakeasy-api/speakeasy ### Releases -- [Go v0.3.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.3.1 - . \ No newline at end of file +- [Go v0.3.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.3.1 - . + +## 2023-09-22 00:37:56 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.89.0 (2.125.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.4.0] . +### Releases +- [Go v0.4.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.4.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 49cb03d..7e4eb72 100755 --- a/USAGE.md +++ b/USAGE.md @@ -1,19 +1,20 @@ + + ```go package main -import ( - "context" - "log" - "github.com/speakeasy-sdks/formance-go-sdk" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" ) func main() { - s := formance.New( - WithSecurity( shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", }), ) diff --git a/accounts.go b/accounts.go index 5ce21a9..4d99345 100755 --- a/accounts.go +++ b/accounts.go @@ -1,40 +1,39 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// accounts - Everything related to Accounts type accounts struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newAccounts(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *accounts { +func newAccounts(sdkConfig sdkConfiguration) *accounts { return &accounts{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // AddMetadataToAccount - Add metadata to an account func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations.AddMetadataToAccountRequest) (*operations.AddMetadataToAccountResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts/{address}/metadata", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts/{address}/metadata", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, false, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -46,10 +45,12 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -58,7 +59,13 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -72,12 +79,14 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -86,19 +95,24 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. // CountAccounts - Count the accounts from a ledger func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAccountsRequest) (*operations.CountAccountsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "HEAD", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -107,7 +121,13 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -123,12 +143,14 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -137,15 +159,20 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc // GetAccount - Get account by its address func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccountRequest) (*operations.GetAccountResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts/{address}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts/{address}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -154,7 +181,13 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -167,22 +200,26 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.AccountResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountResponse = out + res.AccountResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -192,19 +229,24 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount // ListAccounts - List accounts from a ledger // List accounts from a ledger, sorted by address in descending order. func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAccountsRequest) (*operations.ListAccountsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/accounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -213,7 +255,13 @@ func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAcco if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -226,22 +274,26 @@ func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAcco case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountsCursorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.AccountsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountsCursorResponse = out + res.AccountsCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/balances.go b/balances.go index 06b0399..ea06f4c 100755 --- a/balances.go +++ b/balances.go @@ -1,49 +1,50 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// balances - Everything related to Balances type balances struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newBalances(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *balances { +func newBalances(sdkConfig sdkConfiguration) *balances { return &balances{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // GetBalances - Get the balances from a ledger's account func (s *balances) GetBalances(ctx context.Context, request operations.GetBalancesRequest) (*operations.GetBalancesResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/balances", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/balances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -52,7 +53,13 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -65,22 +72,26 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BalancesCursorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.BalancesCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BalancesCursorResponse = out + res.BalancesCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -89,19 +100,24 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc // GetBalancesAggregated - Get the aggregated balances from selected accounts func (s *balances) GetBalancesAggregated(ctx context.Context, request operations.GetBalancesAggregatedRequest) (*operations.GetBalancesAggregatedResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/aggregate/balances", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/aggregate/balances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -110,7 +126,13 @@ func (s *balances) GetBalancesAggregated(ctx context.Context, request operations if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -123,22 +145,26 @@ func (s *balances) GetBalancesAggregated(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AggregateBalancesResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.AggregateBalancesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AggregateBalancesResponse = out + res.AggregateBalancesResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/clients.go b/clients.go index 1e14b21..7409ed1 100755 --- a/clients.go +++ b/clients.go @@ -1,46 +1,47 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// clients - Everything related to Clients type clients struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newClients(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *clients { +func newClients(sdkConfig sdkConfiguration) *clients { return &clients{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // AddScopeToClient - Add scope to client func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddScopeToClientRequest) (*operations.AddScopeToClientResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/scopes/{scopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/scopes/{scopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -49,7 +50,13 @@ func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddSc if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -66,11 +73,11 @@ func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddSc } // CreateClient - Create client -func (s *clients) CreateClient(ctx context.Context, request shared.CreateClientRequest) (*operations.CreateClientResponse, error) { - baseURL := s.serverURL +func (s *clients) CreateClient(ctx context.Context, request *shared.CreateClientRequest) (*operations.CreateClientResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/clients" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -79,10 +86,12 @@ func (s *clients) CreateClient(ctx context.Context, request shared.CreateClientR if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -91,7 +100,13 @@ func (s *clients) CreateClient(ctx context.Context, request shared.CreateClientR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -104,12 +119,14 @@ func (s *clients) CreateClient(ctx context.Context, request shared.CreateClientR case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateClientResponse = out + res.CreateClientResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -118,10 +135,13 @@ func (s *clients) CreateClient(ctx context.Context, request shared.CreateClientR // CreateSecret - Add a secret to a client func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSecretRequest) (*operations.CreateSecretResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/secrets", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/secrets", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "CreateSecretRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "CreateSecretRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -130,10 +150,12 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -142,7 +164,13 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -155,12 +183,14 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateSecretResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateSecretResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateSecretResponse = out + res.CreateSecretResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -169,15 +199,20 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec // DeleteClient - Delete client func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteClientRequest) (*operations.DeleteClientResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -186,7 +221,13 @@ func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteCli if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -204,15 +245,20 @@ func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteCli // DeleteScopeFromClient - Delete scope from client func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations.DeleteScopeFromClientRequest) (*operations.DeleteScopeFromClientResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/scopes/{scopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/scopes/{scopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -221,7 +267,13 @@ func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -239,15 +291,20 @@ func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations. // DeleteSecret - Delete a secret from a client func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSecretRequest) (*operations.DeleteSecretResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/secrets/{secretId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}/secrets/{secretId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -256,7 +313,13 @@ func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSec if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -274,15 +337,17 @@ func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSec // ListClients - List clients func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/clients" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -291,7 +356,13 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -304,12 +375,14 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListClientsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListClientsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListClientsResponse = out + res.ListClientsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -318,15 +391,20 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo // ReadClient - Read client func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientRequest) (*operations.ReadClientResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -335,7 +413,13 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -348,12 +432,14 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ReadClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ReadClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadClientResponse = out + res.ReadClientResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -362,10 +448,13 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR // UpdateClient - Update client func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateClientRequest) (*operations.UpdateClientResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/clients/{clientId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "UpdateClientRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "UpdateClientRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -374,10 +463,12 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -386,7 +477,13 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -399,12 +496,14 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.UpdateClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.UpdateClientResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.UpdateClientResponse = out + res.UpdateClientResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/docs/models/operations/activateconfigrequest.md b/docs/models/operations/activateconfigrequest.md new file mode 100755 index 0000000..4279932 --- /dev/null +++ b/docs/models/operations/activateconfigrequest.md @@ -0,0 +1,8 @@ +# ActivateConfigRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/activateconfigresponse.md b/docs/models/operations/activateconfigresponse.md new file mode 100755 index 0000000..c8a83cc --- /dev/null +++ b/docs/models/operations/activateconfigresponse.md @@ -0,0 +1,11 @@ +# ActivateConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully activated. | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addmetadataontransactionrequest.md b/docs/models/operations/addmetadataontransactionrequest.md new file mode 100755 index 0000000..9121596 --- /dev/null +++ b/docs/models/operations/addmetadataontransactionrequest.md @@ -0,0 +1,10 @@ +# AddMetadataOnTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | metadata | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Txid` | *int64* | :heavy_check_mark: | Transaction ID. | 1234 | \ No newline at end of file diff --git a/docs/models/operations/addmetadataontransactionresponse.md b/docs/models/operations/addmetadataontransactionresponse.md new file mode 100755 index 0000000..dc71aaa --- /dev/null +++ b/docs/models/operations/addmetadataontransactionresponse.md @@ -0,0 +1,11 @@ +# AddMetadataOnTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addmetadatatoaccountrequest.md b/docs/models/operations/addmetadatatoaccountrequest.md new file mode 100755 index 0000000..ebbf36d --- /dev/null +++ b/docs/models/operations/addmetadatatoaccountrequest.md @@ -0,0 +1,10 @@ +# AddMetadataToAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `RequestBody` | map[string]*interface{}* | :heavy_check_mark: | metadata | | +| `Address` | *string* | :heavy_check_mark: | Exact address of the account. It must match the following regular expressions pattern:
```
^\w+(:\w+)*$
```
| users:001 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/addmetadatatoaccountresponse.md b/docs/models/operations/addmetadatatoaccountresponse.md new file mode 100755 index 0000000..e941cce --- /dev/null +++ b/docs/models/operations/addmetadatatoaccountresponse.md @@ -0,0 +1,11 @@ +# AddMetadataToAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addscopetoclientrequest.md b/docs/models/operations/addscopetoclientrequest.md new file mode 100755 index 0000000..7748807 --- /dev/null +++ b/docs/models/operations/addscopetoclientrequest.md @@ -0,0 +1,9 @@ +# AddScopeToClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | \ No newline at end of file diff --git a/docs/models/operations/addscopetoclientresponse.md b/docs/models/operations/addscopetoclientresponse.md new file mode 100755 index 0000000..dbe04b9 --- /dev/null +++ b/docs/models/operations/addscopetoclientresponse.md @@ -0,0 +1,10 @@ +# AddScopeToClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addtransientscoperequest.md b/docs/models/operations/addtransientscoperequest.md new file mode 100755 index 0000000..32ebacf --- /dev/null +++ b/docs/models/operations/addtransientscoperequest.md @@ -0,0 +1,9 @@ +# AddTransientScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | +| `TransientScopeID` | *string* | :heavy_check_mark: | Transient scope ID | \ No newline at end of file diff --git a/docs/models/operations/addtransientscoperesponse.md b/docs/models/operations/addtransientscoperesponse.md new file mode 100755 index 0000000..42c54e2 --- /dev/null +++ b/docs/models/operations/addtransientscoperesponse.md @@ -0,0 +1,10 @@ +# AddTransientScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/changeconfigsecretrequest.md b/docs/models/operations/changeconfigsecretrequest.md new file mode 100755 index 0000000..a71d6bd --- /dev/null +++ b/docs/models/operations/changeconfigsecretrequest.md @@ -0,0 +1,9 @@ +# ChangeConfigSecretRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ConfigChangeSecret` | [*shared.ConfigChangeSecret](../../models/shared/configchangesecret.md) | :heavy_minus_sign: | N/A | | +| `ID` | *string* | :heavy_check_mark: | Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/changeconfigsecretresponse.md b/docs/models/operations/changeconfigsecretresponse.md new file mode 100755 index 0000000..376bfc2 --- /dev/null +++ b/docs/models/operations/changeconfigsecretresponse.md @@ -0,0 +1,11 @@ +# ChangeConfigSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Secret successfully changed. | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/confirmholdrequest.md b/docs/models/operations/confirmholdrequest.md new file mode 100755 index 0000000..9253222 --- /dev/null +++ b/docs/models/operations/confirmholdrequest.md @@ -0,0 +1,9 @@ +# ConfirmHoldRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ConfirmHoldRequest` | [*shared.ConfirmHoldRequest](../../models/shared/confirmholdrequest.md) | :heavy_minus_sign: | N/A | +| `HoldID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/confirmholdresponse.md b/docs/models/operations/confirmholdresponse.md new file mode 100755 index 0000000..ed82e6c --- /dev/null +++ b/docs/models/operations/confirmholdresponse.md @@ -0,0 +1,11 @@ +# ConfirmHoldResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/connectorsstripetransferresponse.md b/docs/models/operations/connectorsstripetransferresponse.md new file mode 100755 index 0000000..b798d89 --- /dev/null +++ b/docs/models/operations/connectorsstripetransferresponse.md @@ -0,0 +1,11 @@ +# ConnectorsStripeTransferResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StripeTransferResponse` | [*shared.StripeTransferResponse](../../models/shared/stripetransferresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/countaccountsmetadata.md b/docs/models/operations/countaccountsmetadata.md new file mode 100755 index 0000000..aa8a196 --- /dev/null +++ b/docs/models/operations/countaccountsmetadata.md @@ -0,0 +1,9 @@ +# CountAccountsMetadata + +Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/countaccountsrequest.md b/docs/models/operations/countaccountsrequest.md new file mode 100755 index 0000000..c1f44fa --- /dev/null +++ b/docs/models/operations/countaccountsrequest.md @@ -0,0 +1,10 @@ +# CountAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Address` | **string* | :heavy_minus_sign: | Filter accounts by address pattern (regular expression placed between ^ and $). | users:.+ | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Metadata` | [*CountAccountsMetadata](../../models/operations/countaccountsmetadata.md) | :heavy_minus_sign: | Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. | | \ No newline at end of file diff --git a/docs/models/operations/countaccountsresponse.md b/docs/models/operations/countaccountsresponse.md new file mode 100755 index 0000000..da82460 --- /dev/null +++ b/docs/models/operations/countaccountsresponse.md @@ -0,0 +1,12 @@ +# CountAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `Headers` | map[string][]*string* | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/counttransactionsmetadata.md b/docs/models/operations/counttransactionsmetadata.md new file mode 100755 index 0000000..bd9fe8c --- /dev/null +++ b/docs/models/operations/counttransactionsmetadata.md @@ -0,0 +1,9 @@ +# CountTransactionsMetadata + +Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/counttransactionsrequest.md b/docs/models/operations/counttransactionsrequest.md new file mode 100755 index 0000000..02fd870 --- /dev/null +++ b/docs/models/operations/counttransactionsrequest.md @@ -0,0 +1,17 @@ +# CountTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Account` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). | users:001 | +| `Destination` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). | users:001 | +| `EndTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
| | +| ~~`EndTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use `endTime` instead.
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Metadata` | [*CountTransactionsMetadata](../../models/operations/counttransactionsmetadata.md) | :heavy_minus_sign: | Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. | | +| `Reference` | **string* | :heavy_minus_sign: | Filter transactions by reference field. | ref:001 | +| `Source` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account at source (regular expression placed between ^ and $). | users:001 | +| `StartTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
| | +| ~~`StartTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use `startTime` instead.
| | \ No newline at end of file diff --git a/docs/models/operations/counttransactionsresponse.md b/docs/models/operations/counttransactionsresponse.md new file mode 100755 index 0000000..2b27cf4 --- /dev/null +++ b/docs/models/operations/counttransactionsresponse.md @@ -0,0 +1,12 @@ +# CountTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `Headers` | map[string][]*string* | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createbalancerequest.md b/docs/models/operations/createbalancerequest.md new file mode 100755 index 0000000..efa1781 --- /dev/null +++ b/docs/models/operations/createbalancerequest.md @@ -0,0 +1,9 @@ +# CreateBalanceRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `CreateBalanceRequest` | [*shared.CreateBalanceRequest](../../models/shared/createbalancerequest.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createbalanceresponse.md b/docs/models/operations/createbalanceresponse.md new file mode 100755 index 0000000..607c4d3 --- /dev/null +++ b/docs/models/operations/createbalanceresponse.md @@ -0,0 +1,12 @@ +# CreateBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateBalanceResponse` | [*shared.CreateBalanceResponse](../../models/shared/createbalanceresponse.md) | :heavy_minus_sign: | Created balance | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createclientresponse.md b/docs/models/operations/createclientresponse.md new file mode 100755 index 0000000..515dbd7 --- /dev/null +++ b/docs/models/operations/createclientresponse.md @@ -0,0 +1,11 @@ +# CreateClientResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateClientResponse` | [*shared.CreateClientResponse](../../models/shared/createclientresponse.md) | :heavy_minus_sign: | Client created | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createscoperesponse.md b/docs/models/operations/createscoperesponse.md new file mode 100755 index 0000000..cffa853 --- /dev/null +++ b/docs/models/operations/createscoperesponse.md @@ -0,0 +1,11 @@ +# CreateScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateScopeResponse` | [*shared.CreateScopeResponse](../../models/shared/createscoperesponse.md) | :heavy_minus_sign: | Created scope | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createsecretrequest.md b/docs/models/operations/createsecretrequest.md new file mode 100755 index 0000000..489a03a --- /dev/null +++ b/docs/models/operations/createsecretrequest.md @@ -0,0 +1,9 @@ +# CreateSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `CreateSecretRequest` | [*shared.CreateSecretRequest](../../models/shared/createsecretrequest.md) | :heavy_minus_sign: | N/A | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | \ No newline at end of file diff --git a/docs/models/operations/createsecretresponse.md b/docs/models/operations/createsecretresponse.md new file mode 100755 index 0000000..8c328e8 --- /dev/null +++ b/docs/models/operations/createsecretresponse.md @@ -0,0 +1,11 @@ +# CreateSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateSecretResponse` | [*shared.CreateSecretResponse](../../models/shared/createsecretresponse.md) | :heavy_minus_sign: | Created secret | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createtransactionrequest.md b/docs/models/operations/createtransactionrequest.md new file mode 100755 index 0000000..2603d41 --- /dev/null +++ b/docs/models/operations/createtransactionrequest.md @@ -0,0 +1,10 @@ +# CreateTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `PostTransaction` | [shared.PostTransaction](../../models/shared/posttransaction.md) | :heavy_check_mark: | The request body must contain at least one of the following objects:
- `postings`: suitable for simple transactions
- `script`: enabling more complex transactions with Numscript
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Preview` | **bool* | :heavy_minus_sign: | Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. | true | \ No newline at end of file diff --git a/docs/models/operations/createtransactionresponse.md b/docs/models/operations/createtransactionresponse.md new file mode 100755 index 0000000..df69794 --- /dev/null +++ b/docs/models/operations/createtransactionresponse.md @@ -0,0 +1,12 @@ +# CreateTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TransactionsResponse` | [*shared.TransactionsResponse](../../models/shared/transactionsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createtransactionsrequest.md b/docs/models/operations/createtransactionsrequest.md new file mode 100755 index 0000000..87a865c --- /dev/null +++ b/docs/models/operations/createtransactionsrequest.md @@ -0,0 +1,9 @@ +# CreateTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Transactions` | [shared.Transactions](../../models/shared/transactions.md) | :heavy_check_mark: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/createtransactionsresponse.md b/docs/models/operations/createtransactionsresponse.md new file mode 100755 index 0000000..1ec2050 --- /dev/null +++ b/docs/models/operations/createtransactionsresponse.md @@ -0,0 +1,12 @@ +# CreateTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TransactionsResponse` | [*shared.TransactionsResponse](../../models/shared/transactionsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createwalletresponse.md b/docs/models/operations/createwalletresponse.md new file mode 100755 index 0000000..f64cd87 --- /dev/null +++ b/docs/models/operations/createwalletresponse.md @@ -0,0 +1,12 @@ +# CreateWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateWalletResponse` | [*shared.CreateWalletResponse](../../models/shared/createwalletresponse.md) | :heavy_minus_sign: | Wallet created | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createworkflowresponse.md b/docs/models/operations/createworkflowresponse.md new file mode 100755 index 0000000..93a37ac --- /dev/null +++ b/docs/models/operations/createworkflowresponse.md @@ -0,0 +1,12 @@ +# CreateWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `CreateWorkflowResponse` | [*shared.CreateWorkflowResponse](../../models/shared/createworkflowresponse.md) | :heavy_minus_sign: | Created workflow | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/creditwalletrequest.md b/docs/models/operations/creditwalletrequest.md new file mode 100755 index 0000000..0036038 --- /dev/null +++ b/docs/models/operations/creditwalletrequest.md @@ -0,0 +1,9 @@ +# CreditWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `CreditWalletRequest` | [*shared.CreditWalletRequest](../../models/shared/creditwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/creditwalletresponse.md b/docs/models/operations/creditwalletresponse.md new file mode 100755 index 0000000..1b4353b --- /dev/null +++ b/docs/models/operations/creditwalletresponse.md @@ -0,0 +1,11 @@ +# CreditWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deactivateconfigrequest.md b/docs/models/operations/deactivateconfigrequest.md new file mode 100755 index 0000000..2604bd4 --- /dev/null +++ b/docs/models/operations/deactivateconfigrequest.md @@ -0,0 +1,8 @@ +# DeactivateConfigRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/deactivateconfigresponse.md b/docs/models/operations/deactivateconfigresponse.md new file mode 100755 index 0000000..2247fb1 --- /dev/null +++ b/docs/models/operations/deactivateconfigresponse.md @@ -0,0 +1,11 @@ +# DeactivateConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully deactivated. | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/debitwalletrequest.md b/docs/models/operations/debitwalletrequest.md new file mode 100755 index 0000000..afcfd7f --- /dev/null +++ b/docs/models/operations/debitwalletrequest.md @@ -0,0 +1,9 @@ +# DebitWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `DebitWalletRequest` | [*shared.DebitWalletRequest](../../models/shared/debitwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/debitwalletresponse.md b/docs/models/operations/debitwalletresponse.md new file mode 100755 index 0000000..740161d --- /dev/null +++ b/docs/models/operations/debitwalletresponse.md @@ -0,0 +1,12 @@ +# DebitWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `DebitWalletResponse` | [*shared.DebitWalletResponse](../../models/shared/debitwalletresponse.md) | :heavy_minus_sign: | Wallet successfully debited as a pending hold | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deleteclientrequest.md b/docs/models/operations/deleteclientrequest.md new file mode 100755 index 0000000..44fe54f --- /dev/null +++ b/docs/models/operations/deleteclientrequest.md @@ -0,0 +1,8 @@ +# DeleteClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | \ No newline at end of file diff --git a/docs/models/operations/deleteclientresponse.md b/docs/models/operations/deleteclientresponse.md new file mode 100755 index 0000000..d0c9a4a --- /dev/null +++ b/docs/models/operations/deleteclientresponse.md @@ -0,0 +1,10 @@ +# DeleteClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteconfigrequest.md b/docs/models/operations/deleteconfigrequest.md new file mode 100755 index 0000000..e143e30 --- /dev/null +++ b/docs/models/operations/deleteconfigrequest.md @@ -0,0 +1,8 @@ +# DeleteConfigRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/deleteconfigresponse.md b/docs/models/operations/deleteconfigresponse.md new file mode 100755 index 0000000..38b47c2 --- /dev/null +++ b/docs/models/operations/deleteconfigresponse.md @@ -0,0 +1,10 @@ +# DeleteConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletescopefromclientrequest.md b/docs/models/operations/deletescopefromclientrequest.md new file mode 100755 index 0000000..1f75874 --- /dev/null +++ b/docs/models/operations/deletescopefromclientrequest.md @@ -0,0 +1,9 @@ +# DeleteScopeFromClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | \ No newline at end of file diff --git a/docs/models/operations/deletescopefromclientresponse.md b/docs/models/operations/deletescopefromclientresponse.md new file mode 100755 index 0000000..4bc2627 --- /dev/null +++ b/docs/models/operations/deletescopefromclientresponse.md @@ -0,0 +1,10 @@ +# DeleteScopeFromClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletescoperequest.md b/docs/models/operations/deletescoperequest.md new file mode 100755 index 0000000..ae3e48a --- /dev/null +++ b/docs/models/operations/deletescoperequest.md @@ -0,0 +1,8 @@ +# DeleteScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | \ No newline at end of file diff --git a/docs/models/operations/deletescoperesponse.md b/docs/models/operations/deletescoperesponse.md new file mode 100755 index 0000000..8ee0c8d --- /dev/null +++ b/docs/models/operations/deletescoperesponse.md @@ -0,0 +1,10 @@ +# DeleteScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletesecretrequest.md b/docs/models/operations/deletesecretrequest.md new file mode 100755 index 0000000..0091443 --- /dev/null +++ b/docs/models/operations/deletesecretrequest.md @@ -0,0 +1,9 @@ +# DeleteSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | +| `SecretID` | *string* | :heavy_check_mark: | Secret ID | \ No newline at end of file diff --git a/docs/models/operations/deletesecretresponse.md b/docs/models/operations/deletesecretresponse.md new file mode 100755 index 0000000..7c891b7 --- /dev/null +++ b/docs/models/operations/deletesecretresponse.md @@ -0,0 +1,10 @@ +# DeleteSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletetransientscoperequest.md b/docs/models/operations/deletetransientscoperequest.md new file mode 100755 index 0000000..482c44f --- /dev/null +++ b/docs/models/operations/deletetransientscoperequest.md @@ -0,0 +1,9 @@ +# DeleteTransientScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | +| `TransientScopeID` | *string* | :heavy_check_mark: | Transient scope ID | \ No newline at end of file diff --git a/docs/models/operations/deletetransientscoperesponse.md b/docs/models/operations/deletetransientscoperesponse.md new file mode 100755 index 0000000..0d712f6 --- /dev/null +++ b/docs/models/operations/deletetransientscoperesponse.md @@ -0,0 +1,10 @@ +# DeleteTransientScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getaccountrequest.md b/docs/models/operations/getaccountrequest.md new file mode 100755 index 0000000..e7c7fcf --- /dev/null +++ b/docs/models/operations/getaccountrequest.md @@ -0,0 +1,9 @@ +# GetAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Address` | *string* | :heavy_check_mark: | Exact address of the account. It must match the following regular expressions pattern:
```
^\w+(:\w+)*$
```
| users:001 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/getaccountresponse.md b/docs/models/operations/getaccountresponse.md new file mode 100755 index 0000000..b9fc42b --- /dev/null +++ b/docs/models/operations/getaccountresponse.md @@ -0,0 +1,12 @@ +# GetAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `AccountResponse` | [*shared.AccountResponse](../../models/shared/accountresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbalancerequest.md b/docs/models/operations/getbalancerequest.md new file mode 100755 index 0000000..27f8cfb --- /dev/null +++ b/docs/models/operations/getbalancerequest.md @@ -0,0 +1,9 @@ +# GetBalanceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `BalanceName` | *string* | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbalanceresponse.md b/docs/models/operations/getbalanceresponse.md new file mode 100755 index 0000000..ba27236 --- /dev/null +++ b/docs/models/operations/getbalanceresponse.md @@ -0,0 +1,12 @@ +# GetBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `GetBalanceResponse` | [*shared.GetBalanceResponse](../../models/shared/getbalanceresponse.md) | :heavy_minus_sign: | Balance summary | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getbalancesaggregatedrequest.md b/docs/models/operations/getbalancesaggregatedrequest.md new file mode 100755 index 0000000..99a64f8 --- /dev/null +++ b/docs/models/operations/getbalancesaggregatedrequest.md @@ -0,0 +1,9 @@ +# GetBalancesAggregatedRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Address` | **string* | :heavy_minus_sign: | Filter balances involving given account, either as source or destination. | users:001 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/getbalancesaggregatedresponse.md b/docs/models/operations/getbalancesaggregatedresponse.md new file mode 100755 index 0000000..93a83e3 --- /dev/null +++ b/docs/models/operations/getbalancesaggregatedresponse.md @@ -0,0 +1,12 @@ +# GetBalancesAggregatedResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `AggregateBalancesResponse` | [*shared.AggregateBalancesResponse](../../models/shared/aggregatebalancesresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getbalancesrequest.md b/docs/models/operations/getbalancesrequest.md new file mode 100755 index 0000000..e7d5c02 --- /dev/null +++ b/docs/models/operations/getbalancesrequest.md @@ -0,0 +1,12 @@ +# GetBalancesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Address` | **string* | :heavy_minus_sign: | Filter balances involving given account, either as source or destination. | users:001 | +| `After` | **string* | :heavy_minus_sign: | Pagination cursor, will return accounts after given address, in descending order. | users:003 | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| ~~`PaginationToken`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
Deprecated, please use `cursor` instead. | aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | \ No newline at end of file diff --git a/docs/models/operations/getbalancesresponse.md b/docs/models/operations/getbalancesresponse.md new file mode 100755 index 0000000..68a8997 --- /dev/null +++ b/docs/models/operations/getbalancesresponse.md @@ -0,0 +1,12 @@ +# GetBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `BalancesCursorResponse` | [*shared.BalancesCursorResponse](../../models/shared/balancescursorresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getconnectortaskrequest.md b/docs/models/operations/getconnectortaskrequest.md new file mode 100755 index 0000000..b59c62d --- /dev/null +++ b/docs/models/operations/getconnectortaskrequest.md @@ -0,0 +1,9 @@ +# GetConnectorTaskRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | +| `TaskID` | *string* | :heavy_check_mark: | The task ID. | \ No newline at end of file diff --git a/docs/models/operations/getconnectortaskresponse.md b/docs/models/operations/getconnectortaskresponse.md new file mode 100755 index 0000000..ebdde55 --- /dev/null +++ b/docs/models/operations/getconnectortaskresponse.md @@ -0,0 +1,11 @@ +# GetConnectorTaskResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TaskResponse` | [*shared.TaskResponse](../../models/shared/taskresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getflowrequest.md b/docs/models/operations/getflowrequest.md new file mode 100755 index 0000000..2caebe4 --- /dev/null +++ b/docs/models/operations/getflowrequest.md @@ -0,0 +1,8 @@ +# GetFlowRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FlowID` | *string* | :heavy_check_mark: | The flow id | \ No newline at end of file diff --git a/docs/models/operations/getflowresponse.md b/docs/models/operations/getflowresponse.md new file mode 100755 index 0000000..65eff7f --- /dev/null +++ b/docs/models/operations/getflowresponse.md @@ -0,0 +1,12 @@ +# GetFlowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `GetWorkflowResponse` | [*shared.GetWorkflowResponse](../../models/shared/getworkflowresponse.md) | :heavy_minus_sign: | The workflow | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getholdrequest.md b/docs/models/operations/getholdrequest.md new file mode 100755 index 0000000..2dfc2a8 --- /dev/null +++ b/docs/models/operations/getholdrequest.md @@ -0,0 +1,8 @@ +# GetHoldRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `HoldID` | *string* | :heavy_check_mark: | The hold ID | \ No newline at end of file diff --git a/docs/models/operations/getholdresponse.md b/docs/models/operations/getholdresponse.md new file mode 100755 index 0000000..d567c8f --- /dev/null +++ b/docs/models/operations/getholdresponse.md @@ -0,0 +1,12 @@ +# GetHoldResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `GetHoldResponse` | [*shared.GetHoldResponse](../../models/shared/getholdresponse.md) | :heavy_minus_sign: | Holds | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getholdsmetadata.md b/docs/models/operations/getholdsmetadata.md new file mode 100755 index 0000000..03207d0 --- /dev/null +++ b/docs/models/operations/getholdsmetadata.md @@ -0,0 +1,9 @@ +# GetHoldsMetadata + +Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/getholdsrequest.md b/docs/models/operations/getholdsrequest.md new file mode 100755 index 0000000..0c14942 --- /dev/null +++ b/docs/models/operations/getholdsrequest.md @@ -0,0 +1,11 @@ +# GetHoldsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when the pagination token is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Metadata` | [*GetHoldsMetadata](../../models/operations/getholdsmetadata.md) | :heavy_minus_sign: | Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. | | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page | | +| `WalletID` | **string* | :heavy_minus_sign: | The wallet to filter on | | \ No newline at end of file diff --git a/docs/models/operations/getholdsresponse.md b/docs/models/operations/getholdsresponse.md new file mode 100755 index 0000000..2e7516f --- /dev/null +++ b/docs/models/operations/getholdsresponse.md @@ -0,0 +1,12 @@ +# GetHoldsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `GetHoldsResponse` | [*shared.GetHoldsResponse](../../models/shared/getholdsresponse.md) | :heavy_minus_sign: | Holds | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getinforesponse.md b/docs/models/operations/getinforesponse.md new file mode 100755 index 0000000..7a4ab7e --- /dev/null +++ b/docs/models/operations/getinforesponse.md @@ -0,0 +1,12 @@ +# GetInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ConfigInfoResponse` | [*shared.ConfigInfoResponse](../../models/shared/configinforesponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getledgerinforequest.md b/docs/models/operations/getledgerinforequest.md new file mode 100755 index 0000000..f45b795 --- /dev/null +++ b/docs/models/operations/getledgerinforequest.md @@ -0,0 +1,8 @@ +# GetLedgerInfoRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/getledgerinforesponse.md b/docs/models/operations/getledgerinforesponse.md new file mode 100755 index 0000000..08c0420 --- /dev/null +++ b/docs/models/operations/getledgerinforesponse.md @@ -0,0 +1,12 @@ +# GetLedgerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `LedgerInfoResponse` | [*shared.LedgerInfoResponse](../../models/shared/ledgerinforesponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmanyconfigsrequest.md b/docs/models/operations/getmanyconfigsrequest.md new file mode 100755 index 0000000..4d2f18e --- /dev/null +++ b/docs/models/operations/getmanyconfigsrequest.md @@ -0,0 +1,9 @@ +# GetManyConfigsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `Endpoint` | **string* | :heavy_minus_sign: | Optional filter by endpoint URL | https://example.com | +| `ID` | **string* | :heavy_minus_sign: | Optional filter by Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/getmanyconfigsresponse.md b/docs/models/operations/getmanyconfigsresponse.md new file mode 100755 index 0000000..f79eb35 --- /dev/null +++ b/docs/models/operations/getmanyconfigsresponse.md @@ -0,0 +1,11 @@ +# GetManyConfigsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ConfigsResponse` | [*shared.ConfigsResponse](../../models/shared/configsresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getmappingrequest.md b/docs/models/operations/getmappingrequest.md new file mode 100755 index 0000000..1399e12 --- /dev/null +++ b/docs/models/operations/getmappingrequest.md @@ -0,0 +1,8 @@ +# GetMappingRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/getmappingresponse.md b/docs/models/operations/getmappingresponse.md new file mode 100755 index 0000000..f07c53b --- /dev/null +++ b/docs/models/operations/getmappingresponse.md @@ -0,0 +1,12 @@ +# GetMappingResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `MappingResponse` | [*shared.MappingResponse](../../models/shared/mappingresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpaymentrequest.md b/docs/models/operations/getpaymentrequest.md new file mode 100755 index 0000000..537fe20 --- /dev/null +++ b/docs/models/operations/getpaymentrequest.md @@ -0,0 +1,8 @@ +# GetPaymentRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `PaymentID` | *string* | :heavy_check_mark: | The payment ID. | \ No newline at end of file diff --git a/docs/models/operations/getpaymentresponse.md b/docs/models/operations/getpaymentresponse.md new file mode 100755 index 0000000..51bf4f0 --- /dev/null +++ b/docs/models/operations/getpaymentresponse.md @@ -0,0 +1,11 @@ +# GetPaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `PaymentResponse` | [*shared.PaymentResponse](../../models/shared/paymentresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserverinforesponse.md b/docs/models/operations/getserverinforesponse.md new file mode 100755 index 0000000..3ae9a21 --- /dev/null +++ b/docs/models/operations/getserverinforesponse.md @@ -0,0 +1,11 @@ +# GetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettransactionrequest.md b/docs/models/operations/gettransactionrequest.md new file mode 100755 index 0000000..9d6da7d --- /dev/null +++ b/docs/models/operations/gettransactionrequest.md @@ -0,0 +1,9 @@ +# GetTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Txid` | *int64* | :heavy_check_mark: | Transaction ID. | 1234 | \ No newline at end of file diff --git a/docs/models/operations/gettransactionresponse.md b/docs/models/operations/gettransactionresponse.md new file mode 100755 index 0000000..2d37f5d --- /dev/null +++ b/docs/models/operations/gettransactionresponse.md @@ -0,0 +1,12 @@ +# GetTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TransactionResponse` | [*shared.TransactionResponse](../../models/shared/transactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/gettransactionsrequest.md b/docs/models/operations/gettransactionsrequest.md new file mode 100755 index 0000000..76f8dc4 --- /dev/null +++ b/docs/models/operations/gettransactionsrequest.md @@ -0,0 +1,10 @@ +# GetTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when the cursor is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page | | +| `WalletID` | **string* | :heavy_minus_sign: | A wallet ID to filter on | | \ No newline at end of file diff --git a/docs/models/operations/gettransactionsresponse.md b/docs/models/operations/gettransactionsresponse.md new file mode 100755 index 0000000..e5c3cc5 --- /dev/null +++ b/docs/models/operations/gettransactionsresponse.md @@ -0,0 +1,12 @@ +# GetTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `GetTransactionsResponse` | [*shared.GetTransactionsResponse](../../models/shared/gettransactionsresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwalletrequest.md b/docs/models/operations/getwalletrequest.md new file mode 100755 index 0000000..7a7f0a0 --- /dev/null +++ b/docs/models/operations/getwalletrequest.md @@ -0,0 +1,8 @@ +# GetWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getwalletresponse.md b/docs/models/operations/getwalletresponse.md new file mode 100755 index 0000000..ec5f290 --- /dev/null +++ b/docs/models/operations/getwalletresponse.md @@ -0,0 +1,12 @@ +# GetWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `GetWalletResponse` | [*shared.GetWalletResponse](../../models/shared/getwalletresponse.md) | :heavy_minus_sign: | Wallet | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getworkflowoccurrencerequest.md b/docs/models/operations/getworkflowoccurrencerequest.md new file mode 100755 index 0000000..cfb6ecb --- /dev/null +++ b/docs/models/operations/getworkflowoccurrencerequest.md @@ -0,0 +1,9 @@ +# GetWorkflowOccurrenceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FlowID` | *string* | :heavy_check_mark: | The flow id | +| `RunID` | *string* | :heavy_check_mark: | The occurrence id | \ No newline at end of file diff --git a/docs/models/operations/getworkflowoccurrenceresponse.md b/docs/models/operations/getworkflowoccurrenceresponse.md new file mode 100755 index 0000000..e50335f --- /dev/null +++ b/docs/models/operations/getworkflowoccurrenceresponse.md @@ -0,0 +1,12 @@ +# GetWorkflowOccurrenceResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `GetWorkflowOccurrenceResponse` | [*shared.GetWorkflowOccurrenceResponse](../../models/shared/getworkflowoccurrenceresponse.md) | :heavy_minus_sign: | The workflow occurrence | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/insertconfigresponse.md b/docs/models/operations/insertconfigresponse.md new file mode 100755 index 0000000..604d79a --- /dev/null +++ b/docs/models/operations/insertconfigresponse.md @@ -0,0 +1,12 @@ +# InsertConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config created successfully. | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `InsertConfig400TextPlainString` | **string* | :heavy_minus_sign: | Bad Request | \ No newline at end of file diff --git a/docs/models/operations/installconnectorrequest.md b/docs/models/operations/installconnectorrequest.md new file mode 100755 index 0000000..758c921 --- /dev/null +++ b/docs/models/operations/installconnectorrequest.md @@ -0,0 +1,9 @@ +# InstallConnectorRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `ConnectorConfig` | [shared.ConnectorConfig](../../models/shared/connectorconfig.md) | :heavy_check_mark: | N/A | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | \ No newline at end of file diff --git a/docs/models/operations/installconnectorresponse.md b/docs/models/operations/installconnectorresponse.md new file mode 100755 index 0000000..3491b7e --- /dev/null +++ b/docs/models/operations/installconnectorresponse.md @@ -0,0 +1,10 @@ +# InstallConnectorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listaccountsbalanceoperator.md b/docs/models/operations/listaccountsbalanceoperator.md new file mode 100755 index 0000000..3fde0e9 --- /dev/null +++ b/docs/models/operations/listaccountsbalanceoperator.md @@ -0,0 +1,16 @@ +# ListAccountsBalanceOperator + +Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. + + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ListAccountsBalanceOperatorGte` | gte | +| `ListAccountsBalanceOperatorLte` | lte | +| `ListAccountsBalanceOperatorGt` | gt | +| `ListAccountsBalanceOperatorLt` | lt | +| `ListAccountsBalanceOperatorE` | e | +| `ListAccountsBalanceOperatorNe` | ne | \ No newline at end of file diff --git a/docs/models/operations/listaccountsmetadata.md b/docs/models/operations/listaccountsmetadata.md new file mode 100755 index 0000000..6136598 --- /dev/null +++ b/docs/models/operations/listaccountsmetadata.md @@ -0,0 +1,9 @@ +# ListAccountsMetadata + +Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/listaccountsrequest.md b/docs/models/operations/listaccountsrequest.md new file mode 100755 index 0000000..69d701a --- /dev/null +++ b/docs/models/operations/listaccountsrequest.md @@ -0,0 +1,18 @@ +# ListAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Address` | **string* | :heavy_minus_sign: | Filter accounts by address pattern (regular expression placed between ^ and $). | users:.+ | +| `After` | **string* | :heavy_minus_sign: | Pagination cursor, will return accounts after given address, in descending order. | users:003 | +| `Balance` | **int64* | :heavy_minus_sign: | Filter accounts by their balance (default operator is gte) | 2400 | +| `BalanceOperator` | [*ListAccountsBalanceOperator](../../models/operations/listaccountsbalanceoperator.md) | :heavy_minus_sign: | Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.
| gte | +| ~~`BalanceOperatorDeprecated`~~ | [*ListAccountsBalanceOperator](../../models/operations/listaccountsbalanceoperator.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.
Deprecated, please use `balanceOperator` instead.
| gte | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Metadata` | [*ListAccountsMetadata](../../models/operations/listaccountsmetadata.md) | :heavy_minus_sign: | Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. | | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| ~~`PageSizeDeprecated`~~ | **int64* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The maximum number of results to return per page.
Deprecated, please use `pageSize` instead.
| | +| ~~`PaginationToken`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use `cursor` instead.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | \ No newline at end of file diff --git a/docs/models/operations/listaccountsresponse.md b/docs/models/operations/listaccountsresponse.md new file mode 100755 index 0000000..52b0206 --- /dev/null +++ b/docs/models/operations/listaccountsresponse.md @@ -0,0 +1,12 @@ +# ListAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `AccountsCursorResponse` | [*shared.AccountsCursorResponse](../../models/shared/accountscursorresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listallconnectorsresponse.md b/docs/models/operations/listallconnectorsresponse.md new file mode 100755 index 0000000..a8b5497 --- /dev/null +++ b/docs/models/operations/listallconnectorsresponse.md @@ -0,0 +1,11 @@ +# ListAllConnectorsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ConnectorsResponse` | [*shared.ConnectorsResponse](../../models/shared/connectorsresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listbalancesrequest.md b/docs/models/operations/listbalancesrequest.md new file mode 100755 index 0000000..eb35a01 --- /dev/null +++ b/docs/models/operations/listbalancesrequest.md @@ -0,0 +1,8 @@ +# ListBalancesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listbalancesresponse.md b/docs/models/operations/listbalancesresponse.md new file mode 100755 index 0000000..caf8b17 --- /dev/null +++ b/docs/models/operations/listbalancesresponse.md @@ -0,0 +1,11 @@ +# ListBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ListBalancesResponse` | [*shared.ListBalancesResponse](../../models/shared/listbalancesresponse.md) | :heavy_minus_sign: | Balances list | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listclientsresponse.md b/docs/models/operations/listclientsresponse.md new file mode 100755 index 0000000..e3613a8 --- /dev/null +++ b/docs/models/operations/listclientsresponse.md @@ -0,0 +1,11 @@ +# ListClientsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ListClientsResponse` | [*shared.ListClientsResponse](../../models/shared/listclientsresponse.md) | :heavy_minus_sign: | List of clients | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listconfigsavailableconnectorsresponse.md b/docs/models/operations/listconfigsavailableconnectorsresponse.md new file mode 100755 index 0000000..f8777dd --- /dev/null +++ b/docs/models/operations/listconfigsavailableconnectorsresponse.md @@ -0,0 +1,11 @@ +# ListConfigsAvailableConnectorsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ConnectorsConfigsResponse` | [*shared.ConnectorsConfigsResponse](../../models/shared/connectorsconfigsresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listconnectortasksrequest.md b/docs/models/operations/listconnectortasksrequest.md new file mode 100755 index 0000000..bca1819 --- /dev/null +++ b/docs/models/operations/listconnectortasksrequest.md @@ -0,0 +1,10 @@ +# ListConnectorTasksRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | \ No newline at end of file diff --git a/docs/models/operations/listconnectortasksresponse.md b/docs/models/operations/listconnectortasksresponse.md new file mode 100755 index 0000000..f78eabd --- /dev/null +++ b/docs/models/operations/listconnectortasksresponse.md @@ -0,0 +1,11 @@ +# ListConnectorTasksResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TasksCursor` | [*shared.TasksCursor](../../models/shared/taskscursor.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listflowsresponse.md b/docs/models/operations/listflowsresponse.md new file mode 100755 index 0000000..819a1d7 --- /dev/null +++ b/docs/models/operations/listflowsresponse.md @@ -0,0 +1,12 @@ +# ListFlowsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ListWorkflowsResponse` | [*shared.ListWorkflowsResponse](../../models/shared/listworkflowsresponse.md) | :heavy_minus_sign: | List of workflows | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlogsrequest.md b/docs/models/operations/listlogsrequest.md new file mode 100755 index 0000000..a334098 --- /dev/null +++ b/docs/models/operations/listlogsrequest.md @@ -0,0 +1,17 @@ +# ListLogsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `After` | **string* | :heavy_minus_sign: | Pagination cursor, will return the logs after a given ID. (in descending order). | 1234 | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `EndTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
| | +| ~~`EndTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use `endTime` instead.
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| ~~`PageSizeDeprecated`~~ | **int64* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The maximum number of results to return per page.
Deprecated, please use `pageSize` instead.
| | +| ~~`PaginationToken`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use `cursor` instead.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `StartTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
| | +| ~~`StartTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use `startTime` instead.
| | \ No newline at end of file diff --git a/docs/models/operations/listlogsresponse.md b/docs/models/operations/listlogsresponse.md new file mode 100755 index 0000000..c84d3b9 --- /dev/null +++ b/docs/models/operations/listlogsresponse.md @@ -0,0 +1,12 @@ +# ListLogsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `LogsCursorResponse` | [*shared.LogsCursorResponse](../../models/shared/logscursorresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listpaymentsrequest.md b/docs/models/operations/listpaymentsrequest.md new file mode 100755 index 0000000..a56b491 --- /dev/null +++ b/docs/models/operations/listpaymentsrequest.md @@ -0,0 +1,10 @@ +# ListPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `Sort` | []*string* | :heavy_minus_sign: | Fields used to sort payments (default is date:desc). | | \ No newline at end of file diff --git a/docs/models/operations/listpaymentsresponse.md b/docs/models/operations/listpaymentsresponse.md new file mode 100755 index 0000000..ba63577 --- /dev/null +++ b/docs/models/operations/listpaymentsresponse.md @@ -0,0 +1,11 @@ +# ListPaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `PaymentsCursor` | [*shared.PaymentsCursor](../../models/shared/paymentscursor.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listrunsrequest.md b/docs/models/operations/listrunsrequest.md new file mode 100755 index 0000000..fcd25c8 --- /dev/null +++ b/docs/models/operations/listrunsrequest.md @@ -0,0 +1,8 @@ +# ListRunsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FlowID` | *string* | :heavy_check_mark: | The flow id | \ No newline at end of file diff --git a/docs/models/operations/listrunsresponse.md b/docs/models/operations/listrunsresponse.md new file mode 100755 index 0000000..d23cd0b --- /dev/null +++ b/docs/models/operations/listrunsresponse.md @@ -0,0 +1,12 @@ +# ListRunsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ListRunsResponse` | [*shared.ListRunsResponse](../../models/shared/listrunsresponse.md) | :heavy_minus_sign: | List of workflow occurrences | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listscopesresponse.md b/docs/models/operations/listscopesresponse.md new file mode 100755 index 0000000..ba2b754 --- /dev/null +++ b/docs/models/operations/listscopesresponse.md @@ -0,0 +1,11 @@ +# ListScopesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ListScopesResponse` | [*shared.ListScopesResponse](../../models/shared/listscopesresponse.md) | :heavy_minus_sign: | List of scopes | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsmetadata.md b/docs/models/operations/listtransactionsmetadata.md new file mode 100755 index 0000000..05efc52 --- /dev/null +++ b/docs/models/operations/listtransactionsmetadata.md @@ -0,0 +1,9 @@ +# ListTransactionsMetadata + +Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsrequest.md b/docs/models/operations/listtransactionsrequest.md new file mode 100755 index 0000000..ffa8abf --- /dev/null +++ b/docs/models/operations/listtransactionsrequest.md @@ -0,0 +1,22 @@ +# ListTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Account` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). | users:001 | +| `After` | **string* | :heavy_minus_sign: | Pagination cursor, will return transactions after given txid (in descending order). | 1234 | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Destination` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). | users:001 | +| `EndTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
| | +| ~~`EndTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use `endTime` instead.
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Metadata` | [*ListTransactionsMetadata](../../models/operations/listtransactionsmetadata.md) | :heavy_minus_sign: | Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. | | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| ~~`PageSizeDeprecated`~~ | **int64* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The maximum number of results to return per page.
Deprecated, please use `pageSize` instead.
| | +| ~~`PaginationToken`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use `cursor` instead.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Reference` | **string* | :heavy_minus_sign: | Find transactions by reference field. | ref:001 | +| `Source` | **string* | :heavy_minus_sign: | Filter transactions with postings involving given account at source (regular expression placed between ^ and $). | users:001 | +| `StartTime` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
| | +| ~~`StartTimeDeprecated`~~ | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use `startTime` instead.
| | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsresponse.md b/docs/models/operations/listtransactionsresponse.md new file mode 100755 index 0000000..7e2296d --- /dev/null +++ b/docs/models/operations/listtransactionsresponse.md @@ -0,0 +1,12 @@ +# ListTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TransactionsCursorResponse` | [*shared.TransactionsCursorResponse](../../models/shared/transactionscursorresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listusersresponse.md b/docs/models/operations/listusersresponse.md new file mode 100755 index 0000000..3923230 --- /dev/null +++ b/docs/models/operations/listusersresponse.md @@ -0,0 +1,11 @@ +# ListUsersResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ListUsersResponse` | [*shared.ListUsersResponse](../../models/shared/listusersresponse.md) | :heavy_minus_sign: | List of users | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listwalletsmetadata.md b/docs/models/operations/listwalletsmetadata.md new file mode 100755 index 0000000..87c27b5 --- /dev/null +++ b/docs/models/operations/listwalletsmetadata.md @@ -0,0 +1,9 @@ +# ListWalletsMetadata + +Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/listwalletsrequest.md b/docs/models/operations/listwalletsrequest.md new file mode 100755 index 0000000..370355b --- /dev/null +++ b/docs/models/operations/listwalletsrequest.md @@ -0,0 +1,11 @@ +# ListWalletsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when the pagination token is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `Metadata` | [*ListWalletsMetadata](../../models/operations/listwalletsmetadata.md) | :heavy_minus_sign: | Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below. | | +| `Name` | **string* | :heavy_minus_sign: | Filter on wallet name | | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page | | \ No newline at end of file diff --git a/docs/models/operations/listwalletsresponse.md b/docs/models/operations/listwalletsresponse.md new file mode 100755 index 0000000..5745d64 --- /dev/null +++ b/docs/models/operations/listwalletsresponse.md @@ -0,0 +1,11 @@ +# ListWalletsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ListWalletsResponse` | [*shared.ListWalletsResponse](../../models/shared/listwalletsresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/orchestrationgetserverinforesponse.md b/docs/models/operations/orchestrationgetserverinforesponse.md new file mode 100755 index 0000000..aac2309 --- /dev/null +++ b/docs/models/operations/orchestrationgetserverinforesponse.md @@ -0,0 +1,12 @@ +# OrchestrationgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/paymentsgetserverinforesponse.md b/docs/models/operations/paymentsgetserverinforesponse.md new file mode 100755 index 0000000..53c848c --- /dev/null +++ b/docs/models/operations/paymentsgetserverinforesponse.md @@ -0,0 +1,11 @@ +# PaymentsgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/paymentslistaccountsrequest.md b/docs/models/operations/paymentslistaccountsrequest.md new file mode 100755 index 0000000..343f619 --- /dev/null +++ b/docs/models/operations/paymentslistaccountsrequest.md @@ -0,0 +1,10 @@ +# PaymentslistAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Cursor` | **string* | :heavy_minus_sign: | Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
| aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `Sort` | []*string* | :heavy_minus_sign: | Fields used to sort payments (default is date:desc). | | \ No newline at end of file diff --git a/docs/models/operations/paymentslistaccountsresponse.md b/docs/models/operations/paymentslistaccountsresponse.md new file mode 100755 index 0000000..7718a51 --- /dev/null +++ b/docs/models/operations/paymentslistaccountsresponse.md @@ -0,0 +1,11 @@ +# PaymentslistAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `AccountsCursor` | [*shared.AccountsCursor](../../models/shared/accountscursor.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/readclientrequest.md b/docs/models/operations/readclientrequest.md new file mode 100755 index 0000000..b970757 --- /dev/null +++ b/docs/models/operations/readclientrequest.md @@ -0,0 +1,8 @@ +# ReadClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | \ No newline at end of file diff --git a/docs/models/operations/readclientresponse.md b/docs/models/operations/readclientresponse.md new file mode 100755 index 0000000..7bfec31 --- /dev/null +++ b/docs/models/operations/readclientresponse.md @@ -0,0 +1,11 @@ +# ReadClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ReadClientResponse` | [*shared.ReadClientResponse](../../models/shared/readclientresponse.md) | :heavy_minus_sign: | Retrieved client | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/readconnectorconfigrequest.md b/docs/models/operations/readconnectorconfigrequest.md new file mode 100755 index 0000000..eb437e6 --- /dev/null +++ b/docs/models/operations/readconnectorconfigrequest.md @@ -0,0 +1,8 @@ +# ReadConnectorConfigRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | \ No newline at end of file diff --git a/docs/models/operations/readconnectorconfigresponse.md b/docs/models/operations/readconnectorconfigresponse.md new file mode 100755 index 0000000..84b3742 --- /dev/null +++ b/docs/models/operations/readconnectorconfigresponse.md @@ -0,0 +1,11 @@ +# ReadConnectorConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `ConnectorConfigResponse` | [*shared.ConnectorConfigResponse](../../models/shared/connectorconfigresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/readscoperequest.md b/docs/models/operations/readscoperequest.md new file mode 100755 index 0000000..6c9d3e7 --- /dev/null +++ b/docs/models/operations/readscoperequest.md @@ -0,0 +1,8 @@ +# ReadScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | \ No newline at end of file diff --git a/docs/models/operations/readscoperesponse.md b/docs/models/operations/readscoperesponse.md new file mode 100755 index 0000000..d79ba5b --- /dev/null +++ b/docs/models/operations/readscoperesponse.md @@ -0,0 +1,11 @@ +# ReadScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ReadScopeResponse` | [*shared.ReadScopeResponse](../../models/shared/readscoperesponse.md) | :heavy_minus_sign: | Retrieved scope | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/readstatsrequest.md b/docs/models/operations/readstatsrequest.md new file mode 100755 index 0000000..1be5ec7 --- /dev/null +++ b/docs/models/operations/readstatsrequest.md @@ -0,0 +1,8 @@ +# ReadStatsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Ledger` | *string* | :heavy_check_mark: | name of the ledger | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/readstatsresponse.md b/docs/models/operations/readstatsresponse.md new file mode 100755 index 0000000..08eed5a --- /dev/null +++ b/docs/models/operations/readstatsresponse.md @@ -0,0 +1,12 @@ +# ReadStatsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatsResponse` | [*shared.StatsResponse](../../models/shared/statsresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/readuserrequest.md b/docs/models/operations/readuserrequest.md new file mode 100755 index 0000000..69fb9f8 --- /dev/null +++ b/docs/models/operations/readuserrequest.md @@ -0,0 +1,8 @@ +# ReadUserRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `UserID` | *string* | :heavy_check_mark: | User ID | \ No newline at end of file diff --git a/docs/models/operations/readuserresponse.md b/docs/models/operations/readuserresponse.md new file mode 100755 index 0000000..f3e6cda --- /dev/null +++ b/docs/models/operations/readuserresponse.md @@ -0,0 +1,11 @@ +# ReadUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ReadUserResponse` | [*shared.ReadUserResponse](../../models/shared/readuserresponse.md) | :heavy_minus_sign: | Retrieved user | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/resetconnectorrequest.md b/docs/models/operations/resetconnectorrequest.md new file mode 100755 index 0000000..3b7f11c --- /dev/null +++ b/docs/models/operations/resetconnectorrequest.md @@ -0,0 +1,8 @@ +# ResetConnectorRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | \ No newline at end of file diff --git a/docs/models/operations/resetconnectorresponse.md b/docs/models/operations/resetconnectorresponse.md new file mode 100755 index 0000000..69cc9b1 --- /dev/null +++ b/docs/models/operations/resetconnectorresponse.md @@ -0,0 +1,10 @@ +# ResetConnectorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/reverttransactionrequest.md b/docs/models/operations/reverttransactionrequest.md new file mode 100755 index 0000000..902139e --- /dev/null +++ b/docs/models/operations/reverttransactionrequest.md @@ -0,0 +1,9 @@ +# RevertTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Txid` | *int64* | :heavy_check_mark: | Transaction ID. | 1234 | \ No newline at end of file diff --git a/docs/models/operations/reverttransactionresponse.md b/docs/models/operations/reverttransactionresponse.md new file mode 100755 index 0000000..5264ae3 --- /dev/null +++ b/docs/models/operations/reverttransactionresponse.md @@ -0,0 +1,12 @@ +# RevertTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `TransactionResponse` | [*shared.TransactionResponse](../../models/shared/transactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/runscriptrequest.md b/docs/models/operations/runscriptrequest.md new file mode 100755 index 0000000..2a03d60 --- /dev/null +++ b/docs/models/operations/runscriptrequest.md @@ -0,0 +1,10 @@ +# RunScriptRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `Script` | [shared.Script](../../models/shared/script.md) | :heavy_check_mark: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Preview` | **bool* | :heavy_minus_sign: | Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. | true | \ No newline at end of file diff --git a/docs/models/operations/runscriptresponse.md b/docs/models/operations/runscriptresponse.md new file mode 100755 index 0000000..bc67bc2 --- /dev/null +++ b/docs/models/operations/runscriptresponse.md @@ -0,0 +1,11 @@ +# RunScriptResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ScriptResponse` | [*shared.ScriptResponse](../../models/shared/scriptresponse.md) | :heavy_minus_sign: | On success, it will return a 200 status code, and the resulting transaction under the `transaction` field.

On failure, it will also return a 200 status code, and the following fields:
- `details`: contains a URL. When there is an error parsing Numscript, the result can be difficult to read—the provided URL will render the error in an easy-to-read format.
- `errorCode` and `error_code` (deprecated): contains the string code of the error
- `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript.
| +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/runworkflowrequest.md b/docs/models/operations/runworkflowrequest.md new file mode 100755 index 0000000..26cbb35 --- /dev/null +++ b/docs/models/operations/runworkflowrequest.md @@ -0,0 +1,10 @@ +# RunWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `RequestBody` | map[string]*string* | :heavy_minus_sign: | N/A | +| `FlowID` | *string* | :heavy_check_mark: | The flow id | +| `Wait` | **bool* | :heavy_minus_sign: | Wait end of the workflow before return | \ No newline at end of file diff --git a/docs/models/operations/runworkflowresponse.md b/docs/models/operations/runworkflowresponse.md new file mode 100755 index 0000000..1c03e2f --- /dev/null +++ b/docs/models/operations/runworkflowresponse.md @@ -0,0 +1,12 @@ +# RunWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `RunWorkflowResponse` | [*shared.RunWorkflowResponse](../../models/shared/runworkflowresponse.md) | :heavy_minus_sign: | The workflow occurrence | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchgetserverinforesponse.md b/docs/models/operations/searchgetserverinforesponse.md new file mode 100755 index 0000000..6ec0874 --- /dev/null +++ b/docs/models/operations/searchgetserverinforesponse.md @@ -0,0 +1,11 @@ +# SearchgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchresponse.md b/docs/models/operations/searchresponse.md new file mode 100755 index 0000000..2dc1c3c --- /dev/null +++ b/docs/models/operations/searchresponse.md @@ -0,0 +1,11 @@ +# SearchResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `Response` | [*shared.Response](../../models/shared/response.md) | :heavy_minus_sign: | Success | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/testconfigrequest.md b/docs/models/operations/testconfigrequest.md new file mode 100755 index 0000000..1f37112 --- /dev/null +++ b/docs/models/operations/testconfigrequest.md @@ -0,0 +1,8 @@ +# TestConfigRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Config ID | 4997257d-dfb6-445b-929c-cbe2ab182818 | \ No newline at end of file diff --git a/docs/models/operations/testconfigresponse.md b/docs/models/operations/testconfigresponse.md new file mode 100755 index 0000000..33597e3 --- /dev/null +++ b/docs/models/operations/testconfigresponse.md @@ -0,0 +1,11 @@ +# TestConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `AttemptResponse` | [*shared.AttemptResponse](../../models/shared/attemptresponse.md) | :heavy_minus_sign: | OK | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/uninstallconnectorrequest.md b/docs/models/operations/uninstallconnectorrequest.md new file mode 100755 index 0000000..77656e5 --- /dev/null +++ b/docs/models/operations/uninstallconnectorrequest.md @@ -0,0 +1,8 @@ +# UninstallConnectorRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Connector` | [shared.Connector](../../models/shared/connector.md) | :heavy_check_mark: | The name of the connector. | \ No newline at end of file diff --git a/docs/models/operations/uninstallconnectorresponse.md b/docs/models/operations/uninstallconnectorresponse.md new file mode 100755 index 0000000..8dc21d9 --- /dev/null +++ b/docs/models/operations/uninstallconnectorresponse.md @@ -0,0 +1,10 @@ +# UninstallConnectorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateclientrequest.md b/docs/models/operations/updateclientrequest.md new file mode 100755 index 0000000..4941654 --- /dev/null +++ b/docs/models/operations/updateclientrequest.md @@ -0,0 +1,9 @@ +# UpdateClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `UpdateClientRequest` | [*shared.UpdateClientRequest](../../models/shared/updateclientrequest.md) | :heavy_minus_sign: | N/A | +| `ClientID` | *string* | :heavy_check_mark: | Client ID | \ No newline at end of file diff --git a/docs/models/operations/updateclientresponse.md b/docs/models/operations/updateclientresponse.md new file mode 100755 index 0000000..146d731 --- /dev/null +++ b/docs/models/operations/updateclientresponse.md @@ -0,0 +1,11 @@ +# UpdateClientResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `UpdateClientResponse` | [*shared.UpdateClientResponse](../../models/shared/updateclientresponse.md) | :heavy_minus_sign: | Updated client | \ No newline at end of file diff --git a/docs/models/operations/updatemappingrequest.md b/docs/models/operations/updatemappingrequest.md new file mode 100755 index 0000000..aeaf81f --- /dev/null +++ b/docs/models/operations/updatemappingrequest.md @@ -0,0 +1,9 @@ +# UpdateMappingRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `Mapping` | [shared.Mapping](../../models/shared/mapping.md) | :heavy_check_mark: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/updatemappingresponse.md b/docs/models/operations/updatemappingresponse.md new file mode 100755 index 0000000..e2086dd --- /dev/null +++ b/docs/models/operations/updatemappingresponse.md @@ -0,0 +1,12 @@ +# UpdateMappingResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `MappingResponse` | [*shared.MappingResponse](../../models/shared/mappingresponse.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatescoperequest.md b/docs/models/operations/updatescoperequest.md new file mode 100755 index 0000000..5fe9545 --- /dev/null +++ b/docs/models/operations/updatescoperequest.md @@ -0,0 +1,9 @@ +# UpdateScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `UpdateScopeRequest` | [*shared.UpdateScopeRequest](../../models/shared/updatescoperequest.md) | :heavy_minus_sign: | N/A | +| `ScopeID` | *string* | :heavy_check_mark: | Scope ID | \ No newline at end of file diff --git a/docs/models/operations/updatescoperesponse.md b/docs/models/operations/updatescoperesponse.md new file mode 100755 index 0000000..ff2c24b --- /dev/null +++ b/docs/models/operations/updatescoperesponse.md @@ -0,0 +1,11 @@ +# UpdateScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `UpdateScopeResponse` | [*shared.UpdateScopeResponse](../../models/shared/updatescoperesponse.md) | :heavy_minus_sign: | Updated scope | \ No newline at end of file diff --git a/docs/models/operations/updatewalletrequest.md b/docs/models/operations/updatewalletrequest.md new file mode 100755 index 0000000..e57bde5 --- /dev/null +++ b/docs/models/operations/updatewalletrequest.md @@ -0,0 +1,9 @@ +# UpdateWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `RequestBody` | [*UpdateWalletRequestBody](../../models/operations/updatewalletrequestbody.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatewalletrequestbody.md b/docs/models/operations/updatewalletrequestbody.md new file mode 100755 index 0000000..2ea0e77 --- /dev/null +++ b/docs/models/operations/updatewalletrequestbody.md @@ -0,0 +1,8 @@ +# UpdateWalletRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | Custom metadata to attach to this wallet. | \ No newline at end of file diff --git a/docs/models/operations/updatewalletresponse.md b/docs/models/operations/updatewalletresponse.md new file mode 100755 index 0000000..45bc94d --- /dev/null +++ b/docs/models/operations/updatewalletresponse.md @@ -0,0 +1,11 @@ +# UpdateWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/voidholdrequest.md b/docs/models/operations/voidholdrequest.md new file mode 100755 index 0000000..48a6253 --- /dev/null +++ b/docs/models/operations/voidholdrequest.md @@ -0,0 +1,8 @@ +# VoidHoldRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `HoldID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/voidholdresponse.md b/docs/models/operations/voidholdresponse.md new file mode 100755 index 0000000..440bbf8 --- /dev/null +++ b/docs/models/operations/voidholdresponse.md @@ -0,0 +1,11 @@ +# VoidHoldResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/walletsgetserverinforesponse.md b/docs/models/operations/walletsgetserverinforesponse.md new file mode 100755 index 0000000..e32e5be --- /dev/null +++ b/docs/models/operations/walletsgetserverinforesponse.md @@ -0,0 +1,12 @@ +# WalletsgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/shared/account.md b/docs/models/shared/account.md new file mode 100755 index 0000000..a1833cb --- /dev/null +++ b/docs/models/shared/account.md @@ -0,0 +1,10 @@ +# Account + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Address` | *string* | :heavy_check_mark: | N/A | users:001 | +| `Metadata` | [*AccountMetadata](../../models/shared/accountmetadata.md) | :heavy_minus_sign: | N/A | | +| `Type` | **string* | :heavy_minus_sign: | N/A | virtual | \ No newline at end of file diff --git a/docs/models/shared/accountmetadata.md b/docs/models/shared/accountmetadata.md new file mode 100755 index 0000000..f41637b --- /dev/null +++ b/docs/models/shared/accountmetadata.md @@ -0,0 +1,7 @@ +# AccountMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/accountresponse.md b/docs/models/shared/accountresponse.md new file mode 100755 index 0000000..b4f1f6e --- /dev/null +++ b/docs/models/shared/accountresponse.md @@ -0,0 +1,8 @@ +# AccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Data` | [AccountWithVolumesAndBalances](../../models/shared/accountwithvolumesandbalances.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/accountscursor.md b/docs/models/shared/accountscursor.md new file mode 100755 index 0000000..d0cca6e --- /dev/null +++ b/docs/models/shared/accountscursor.md @@ -0,0 +1,8 @@ +# AccountsCursor + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Cursor` | [AccountsCursorCursor](../../models/shared/accountscursorcursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/accountscursorcursor.md b/docs/models/shared/accountscursorcursor.md new file mode 100755 index 0000000..1996d8c --- /dev/null +++ b/docs/models/shared/accountscursorcursor.md @@ -0,0 +1,12 @@ +# AccountsCursorCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Data` | [][PaymentsAccount](../../models/shared/paymentsaccount.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/accountscursorresponse.md b/docs/models/shared/accountscursorresponse.md new file mode 100755 index 0000000..9aca72f --- /dev/null +++ b/docs/models/shared/accountscursorresponse.md @@ -0,0 +1,8 @@ +# AccountsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Cursor` | [AccountsCursorResponseCursor](../../models/shared/accountscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/accountscursorresponsecursor.md b/docs/models/shared/accountscursorresponsecursor.md new file mode 100755 index 0000000..0e026a1 --- /dev/null +++ b/docs/models/shared/accountscursorresponsecursor.md @@ -0,0 +1,12 @@ +# AccountsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Account](../../models/shared/account.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/accountwithvolumesandbalances.md b/docs/models/shared/accountwithvolumesandbalances.md new file mode 100755 index 0000000..e0b9828 --- /dev/null +++ b/docs/models/shared/accountwithvolumesandbalances.md @@ -0,0 +1,12 @@ +# AccountWithVolumesAndBalances + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Address` | *string* | :heavy_check_mark: | N/A | users:001 | +| `Balances` | map[string]*int64* | :heavy_minus_sign: | N/A | | +| `Metadata` | [*AccountWithVolumesAndBalancesMetadata](../../models/shared/accountwithvolumesandbalancesmetadata.md) | :heavy_minus_sign: | N/A | | +| `Type` | **string* | :heavy_minus_sign: | N/A | virtual | +| `Volumes` | map[string]map[string]*int64* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/accountwithvolumesandbalancesmetadata.md b/docs/models/shared/accountwithvolumesandbalancesmetadata.md new file mode 100755 index 0000000..4a39016 --- /dev/null +++ b/docs/models/shared/accountwithvolumesandbalancesmetadata.md @@ -0,0 +1,7 @@ +# AccountWithVolumesAndBalancesMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/aggregatebalancesresponse.md b/docs/models/shared/aggregatebalancesresponse.md new file mode 100755 index 0000000..4dd70e6 --- /dev/null +++ b/docs/models/shared/aggregatebalancesresponse.md @@ -0,0 +1,8 @@ +# AggregateBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Data` | map[string]*int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/assetholder.md b/docs/models/shared/assetholder.md new file mode 100755 index 0000000..db98bbd --- /dev/null +++ b/docs/models/shared/assetholder.md @@ -0,0 +1,8 @@ +# AssetHolder + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `Assets` | map[string]*float64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/attempt.md b/docs/models/shared/attempt.md new file mode 100755 index 0000000..6ea7311 --- /dev/null +++ b/docs/models/shared/attempt.md @@ -0,0 +1,17 @@ +# Attempt + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Config` | [*WebhooksConfig](../../models/shared/webhooksconfig.md) | :heavy_minus_sign: | N/A | | +| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `ID` | **string* | :heavy_minus_sign: | N/A | | +| `NextRetryAfter` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `Payload` | **string* | :heavy_minus_sign: | N/A | {"data":"test"} | +| `RetryAttempt` | **int64* | :heavy_minus_sign: | N/A | 1 | +| `Status` | **string* | :heavy_minus_sign: | N/A | success | +| `StatusCode` | **int64* | :heavy_minus_sign: | N/A | 200 | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `WebhookID` | **string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/attemptresponse.md b/docs/models/shared/attemptresponse.md new file mode 100755 index 0000000..6d45062 --- /dev/null +++ b/docs/models/shared/attemptresponse.md @@ -0,0 +1,8 @@ +# AttemptResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [Attempt](../../models/shared/attempt.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/balance.md b/docs/models/shared/balance.md new file mode 100755 index 0000000..b4b6b06 --- /dev/null +++ b/docs/models/shared/balance.md @@ -0,0 +1,8 @@ +# Balance + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/balancescursorresponse.md b/docs/models/shared/balancescursorresponse.md new file mode 100755 index 0000000..ca5a06c --- /dev/null +++ b/docs/models/shared/balancescursorresponse.md @@ -0,0 +1,8 @@ +# BalancesCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Cursor` | [BalancesCursorResponseCursor](../../models/shared/balancescursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/balancescursorresponsecursor.md b/docs/models/shared/balancescursorresponsecursor.md new file mode 100755 index 0000000..2940a35 --- /dev/null +++ b/docs/models/shared/balancescursorresponsecursor.md @@ -0,0 +1,12 @@ +# BalancesCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | []map[string]map[string]*int64* | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/balancewithassets.md b/docs/models/shared/balancewithassets.md new file mode 100755 index 0000000..0160aca --- /dev/null +++ b/docs/models/shared/balancewithassets.md @@ -0,0 +1,9 @@ +# BalanceWithAssets + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `Assets` | map[string]*float64* | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/bankingcircleconfig.md b/docs/models/shared/bankingcircleconfig.md new file mode 100755 index 0000000..10a01c5 --- /dev/null +++ b/docs/models/shared/bankingcircleconfig.md @@ -0,0 +1,11 @@ +# BankingCircleConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `AuthorizationEndpoint` | *string* | :heavy_check_mark: | N/A | XXX | +| `Endpoint` | *string* | :heavy_check_mark: | N/A | XXX | +| `Password` | *string* | :heavy_check_mark: | N/A | XXX | +| `Username` | *string* | :heavy_check_mark: | N/A | XXX | \ No newline at end of file diff --git a/docs/models/shared/client.md b/docs/models/shared/client.md new file mode 100755 index 0000000..56a6972 --- /dev/null +++ b/docs/models/shared/client.md @@ -0,0 +1,17 @@ +# Client + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `PostLogoutRedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Public` | **bool* | :heavy_minus_sign: | N/A | +| `RedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Scopes` | []*string* | :heavy_minus_sign: | N/A | +| `Secrets` | [][ClientSecret](../../models/shared/clientsecret.md) | :heavy_minus_sign: | N/A | +| `Trusted` | **bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/clientsecret.md b/docs/models/shared/clientsecret.md new file mode 100755 index 0000000..2ae9d20 --- /dev/null +++ b/docs/models/shared/clientsecret.md @@ -0,0 +1,11 @@ +# ClientSecret + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `LastDigits` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/config.md b/docs/models/shared/config.md new file mode 100755 index 0000000..12bb551 --- /dev/null +++ b/docs/models/shared/config.md @@ -0,0 +1,8 @@ +# Config + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Storage` | [LedgerStorage](../../models/shared/ledgerstorage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/configchangesecret.md b/docs/models/shared/configchangesecret.md new file mode 100755 index 0000000..e9df0bf --- /dev/null +++ b/docs/models/shared/configchangesecret.md @@ -0,0 +1,8 @@ +# ConfigChangeSecret + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `Secret` | **string* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | \ No newline at end of file diff --git a/docs/models/shared/configinfo.md b/docs/models/shared/configinfo.md new file mode 100755 index 0000000..a62aa54 --- /dev/null +++ b/docs/models/shared/configinfo.md @@ -0,0 +1,10 @@ +# ConfigInfo + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `Config` | [Config](../../models/shared/config.md) | :heavy_check_mark: | N/A | +| `Server` | *string* | :heavy_check_mark: | N/A | +| `Version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/configinforesponse.md b/docs/models/shared/configinforesponse.md new file mode 100755 index 0000000..9a707e9 --- /dev/null +++ b/docs/models/shared/configinforesponse.md @@ -0,0 +1,8 @@ +# ConfigInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Data` | [ConfigInfo](../../models/shared/configinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/configresponse.md b/docs/models/shared/configresponse.md new file mode 100755 index 0000000..b5922c9 --- /dev/null +++ b/docs/models/shared/configresponse.md @@ -0,0 +1,8 @@ +# ConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Data` | [WebhooksConfig](../../models/shared/webhooksconfig.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/configsresponse.md b/docs/models/shared/configsresponse.md new file mode 100755 index 0000000..1c7f68e --- /dev/null +++ b/docs/models/shared/configsresponse.md @@ -0,0 +1,8 @@ +# ConfigsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `Cursor` | [ConfigsResponseCursor](../../models/shared/configsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/configsresponsecursor.md b/docs/models/shared/configsresponsecursor.md new file mode 100755 index 0000000..aaed2eb --- /dev/null +++ b/docs/models/shared/configsresponsecursor.md @@ -0,0 +1,12 @@ +# ConfigsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `Data` | [][WebhooksConfig](../../models/shared/webhooksconfig.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/configuser.md b/docs/models/shared/configuser.md new file mode 100755 index 0000000..833380f --- /dev/null +++ b/docs/models/shared/configuser.md @@ -0,0 +1,10 @@ +# ConfigUser + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `Endpoint` | *string* | :heavy_check_mark: | N/A | https://example.com | +| `EventTypes` | []*string* | :heavy_check_mark: | N/A | | +| `Secret` | **string* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | \ No newline at end of file diff --git a/docs/models/shared/confirmholdrequest.md b/docs/models/shared/confirmholdrequest.md new file mode 100755 index 0000000..0ee2e5a --- /dev/null +++ b/docs/models/shared/confirmholdrequest.md @@ -0,0 +1,9 @@ +# ConfirmHoldRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Amount` | **int64* | :heavy_minus_sign: | Define the amount to transfer. | 100 | +| `Final` | **bool* | :heavy_minus_sign: | Define a final confirmation. Remaining funds will be returned to the wallet. | true | \ No newline at end of file diff --git a/docs/models/shared/connector.md b/docs/models/shared/connector.md new file mode 100755 index 0000000..e15acd2 --- /dev/null +++ b/docs/models/shared/connector.md @@ -0,0 +1,13 @@ +# Connector + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `ConnectorStripe` | STRIPE | +| `ConnectorDummyPay` | DUMMY-PAY | +| `ConnectorWise` | WISE | +| `ConnectorModulr` | MODULR | +| `ConnectorCurrencyCloud` | CURRENCY-CLOUD | +| `ConnectorBankingCircle` | BANKING-CIRCLE | \ No newline at end of file diff --git a/docs/models/shared/connectorconfig.md b/docs/models/shared/connectorconfig.md new file mode 100755 index 0000000..19f6c96 --- /dev/null +++ b/docs/models/shared/connectorconfig.md @@ -0,0 +1,41 @@ +# ConnectorConfig + + +## Supported Types + +### StripeConfig + +```go +connectorConfig := shared.CreateConnectorConfigStripeConfig(shared.StripeConfig{/* values here */}) +``` + +### DummyPayConfig + +```go +connectorConfig := shared.CreateConnectorConfigDummyPayConfig(shared.DummyPayConfig{/* values here */}) +``` + +### WiseConfig + +```go +connectorConfig := shared.CreateConnectorConfigWiseConfig(shared.WiseConfig{/* values here */}) +``` + +### ModulrConfig + +```go +connectorConfig := shared.CreateConnectorConfigModulrConfig(shared.ModulrConfig{/* values here */}) +``` + +### CurrencyCloudConfig + +```go +connectorConfig := shared.CreateConnectorConfigCurrencyCloudConfig(shared.CurrencyCloudConfig{/* values here */}) +``` + +### BankingCircleConfig + +```go +connectorConfig := shared.CreateConnectorConfigBankingCircleConfig(shared.BankingCircleConfig{/* values here */}) +``` + diff --git a/docs/models/shared/connectorconfigresponse.md b/docs/models/shared/connectorconfigresponse.md new file mode 100755 index 0000000..c77d29e --- /dev/null +++ b/docs/models/shared/connectorconfigresponse.md @@ -0,0 +1,8 @@ +# ConnectorConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `Data` | [ConnectorConfig](../../models/shared/connectorconfig.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsconfigsresponse.md b/docs/models/shared/connectorsconfigsresponse.md new file mode 100755 index 0000000..dec57cc --- /dev/null +++ b/docs/models/shared/connectorsconfigsresponse.md @@ -0,0 +1,8 @@ +# ConnectorsConfigsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Data` | [ConnectorsConfigsResponseData](../../models/shared/connectorsconfigsresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsconfigsresponsedata.md b/docs/models/shared/connectorsconfigsresponsedata.md new file mode 100755 index 0000000..0adc62b --- /dev/null +++ b/docs/models/shared/connectorsconfigsresponsedata.md @@ -0,0 +1,8 @@ +# ConnectorsConfigsResponseData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `Connector` | [ConnectorsConfigsResponseDataConnector](../../models/shared/connectorsconfigsresponsedataconnector.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsconfigsresponsedataconnector.md b/docs/models/shared/connectorsconfigsresponsedataconnector.md new file mode 100755 index 0000000..a31c7a6 --- /dev/null +++ b/docs/models/shared/connectorsconfigsresponsedataconnector.md @@ -0,0 +1,8 @@ +# ConnectorsConfigsResponseDataConnector + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `Key` | [ConnectorsConfigsResponseDataConnectorKey](../../models/shared/connectorsconfigsresponsedataconnectorkey.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsconfigsresponsedataconnectorkey.md b/docs/models/shared/connectorsconfigsresponsedataconnectorkey.md new file mode 100755 index 0000000..147c99c --- /dev/null +++ b/docs/models/shared/connectorsconfigsresponsedataconnectorkey.md @@ -0,0 +1,9 @@ +# ConnectorsConfigsResponseDataConnectorKey + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `DataType` | *string* | :heavy_check_mark: | N/A | +| `Required` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsresponse.md b/docs/models/shared/connectorsresponse.md new file mode 100755 index 0000000..6c40408 --- /dev/null +++ b/docs/models/shared/connectorsresponse.md @@ -0,0 +1,8 @@ +# ConnectorsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Data` | [][ConnectorsResponseData](../../models/shared/connectorsresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/connectorsresponsedata.md b/docs/models/shared/connectorsresponsedata.md new file mode 100755 index 0000000..cbef222 --- /dev/null +++ b/docs/models/shared/connectorsresponsedata.md @@ -0,0 +1,9 @@ +# ConnectorsResponseData + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `Enabled` | **bool* | :heavy_minus_sign: | N/A | true | +| `Provider` | [*Connector](../../models/shared/connector.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/contract.md b/docs/models/shared/contract.md new file mode 100755 index 0000000..1eb000c --- /dev/null +++ b/docs/models/shared/contract.md @@ -0,0 +1,9 @@ +# Contract + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Account` | **string* | :heavy_minus_sign: | N/A | users:001 | +| `Expr` | [ContractExpr](../../models/shared/contractexpr.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/contractexpr.md b/docs/models/shared/contractexpr.md new file mode 100755 index 0000000..09a5a30 --- /dev/null +++ b/docs/models/shared/contractexpr.md @@ -0,0 +1,7 @@ +# ContractExpr + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/createbalancerequest.md b/docs/models/shared/createbalancerequest.md new file mode 100755 index 0000000..2472d7a --- /dev/null +++ b/docs/models/shared/createbalancerequest.md @@ -0,0 +1,8 @@ +# CreateBalanceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createbalanceresponse.md b/docs/models/shared/createbalanceresponse.md new file mode 100755 index 0000000..b85aa5a --- /dev/null +++ b/docs/models/shared/createbalanceresponse.md @@ -0,0 +1,8 @@ +# CreateBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [Balance](../../models/shared/balance.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createclientrequest.md b/docs/models/shared/createclientrequest.md new file mode 100755 index 0000000..0d0f716 --- /dev/null +++ b/docs/models/shared/createclientrequest.md @@ -0,0 +1,14 @@ +# CreateClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `PostLogoutRedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Public` | **bool* | :heavy_minus_sign: | N/A | +| `RedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Trusted` | **bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createclientresponse.md b/docs/models/shared/createclientresponse.md new file mode 100755 index 0000000..10c2816 --- /dev/null +++ b/docs/models/shared/createclientresponse.md @@ -0,0 +1,8 @@ +# CreateClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Data` | [*Client](../../models/shared/client.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createscoperequest.md b/docs/models/shared/createscoperequest.md new file mode 100755 index 0000000..a165a96 --- /dev/null +++ b/docs/models/shared/createscoperequest.md @@ -0,0 +1,9 @@ +# CreateScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Label` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createscoperesponse.md b/docs/models/shared/createscoperesponse.md new file mode 100755 index 0000000..9f23804 --- /dev/null +++ b/docs/models/shared/createscoperesponse.md @@ -0,0 +1,8 @@ +# CreateScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `Data` | [*Scope](../../models/shared/scope.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createsecretrequest.md b/docs/models/shared/createsecretrequest.md new file mode 100755 index 0000000..0764ceb --- /dev/null +++ b/docs/models/shared/createsecretrequest.md @@ -0,0 +1,9 @@ +# CreateSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createsecretresponse.md b/docs/models/shared/createsecretresponse.md new file mode 100755 index 0000000..51482f9 --- /dev/null +++ b/docs/models/shared/createsecretresponse.md @@ -0,0 +1,8 @@ +# CreateSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Data` | [*Secret](../../models/shared/secret.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createwalletrequest.md b/docs/models/shared/createwalletrequest.md new file mode 100755 index 0000000..67a0e1d --- /dev/null +++ b/docs/models/shared/createwalletrequest.md @@ -0,0 +1,9 @@ +# CreateWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | Custom metadata to attach to this wallet. | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createwalletresponse.md b/docs/models/shared/createwalletresponse.md new file mode 100755 index 0000000..5eb60a4 --- /dev/null +++ b/docs/models/shared/createwalletresponse.md @@ -0,0 +1,8 @@ +# CreateWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `Data` | [Wallet](../../models/shared/wallet.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createworkflowrequest.md b/docs/models/shared/createworkflowrequest.md new file mode 100755 index 0000000..b514570 --- /dev/null +++ b/docs/models/shared/createworkflowrequest.md @@ -0,0 +1,8 @@ +# CreateWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Stages` | []map[string]*interface{}* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createworkflowresponse.md b/docs/models/shared/createworkflowresponse.md new file mode 100755 index 0000000..65db51a --- /dev/null +++ b/docs/models/shared/createworkflowresponse.md @@ -0,0 +1,8 @@ +# CreateWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Data` | [Workflow](../../models/shared/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/creditwalletrequest.md b/docs/models/shared/creditwalletrequest.md new file mode 100755 index 0000000..9d5887f --- /dev/null +++ b/docs/models/shared/creditwalletrequest.md @@ -0,0 +1,12 @@ +# CreditWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Amount` | [Monetary](../../models/shared/monetary.md) | :heavy_check_mark: | N/A | +| `Balance` | **string* | :heavy_minus_sign: | The balance to credit | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | Metadata associated with the wallet. | +| `Reference` | **string* | :heavy_minus_sign: | N/A | +| `Sources` | [][Subject](../../models/shared/subject.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/currencycloudconfig.md b/docs/models/shared/currencycloudconfig.md new file mode 100755 index 0000000..ec6dad3 --- /dev/null +++ b/docs/models/shared/currencycloudconfig.md @@ -0,0 +1,11 @@ +# CurrencyCloudConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `APIKey` | *string* | :heavy_check_mark: | N/A | XXX | +| `Endpoint` | **string* | :heavy_minus_sign: | The endpoint to use for the API. Defaults to https://devapi.currencycloud.com | XXX | +| `LoginID` | *string* | :heavy_check_mark: | Username of the API Key holder | XXX | +| `PollingPeriod` | **string* | :heavy_minus_sign: | The frequency at which the connector will fetch transactions | 60s | \ No newline at end of file diff --git a/docs/models/shared/debitwalletrequest.md b/docs/models/shared/debitwalletrequest.md new file mode 100755 index 0000000..a6c8f31 --- /dev/null +++ b/docs/models/shared/debitwalletrequest.md @@ -0,0 +1,13 @@ +# DebitWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `Amount` | [Monetary](../../models/shared/monetary.md) | :heavy_check_mark: | N/A | +| `Balances` | []*string* | :heavy_minus_sign: | N/A | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `Destination` | [*Subject](../../models/shared/subject.md) | :heavy_minus_sign: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | Metadata associated with the wallet. | +| `Pending` | **bool* | :heavy_minus_sign: | Set to true to create a pending hold. If false, the wallet will be debited immediately. | \ No newline at end of file diff --git a/docs/models/shared/debitwalletresponse.md b/docs/models/shared/debitwalletresponse.md new file mode 100755 index 0000000..4b4073f --- /dev/null +++ b/docs/models/shared/debitwalletresponse.md @@ -0,0 +1,8 @@ +# DebitWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `Data` | [Hold](../../models/shared/hold.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/dummypayconfig.md b/docs/models/shared/dummypayconfig.md new file mode 100755 index 0000000..a6b5b66 --- /dev/null +++ b/docs/models/shared/dummypayconfig.md @@ -0,0 +1,10 @@ +# DummyPayConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Directory` | *string* | :heavy_check_mark: | N/A | /tmp/dummypay | +| `FileGenerationPeriod` | **string* | :heavy_minus_sign: | The frequency at which the connector will create new payment objects in the directory | 60s | +| `FilePollingPeriod` | **string* | :heavy_minus_sign: | The frequency at which the connector will try to fetch new payment objects from the directory | 60s | \ No newline at end of file diff --git a/docs/models/shared/error.md b/docs/models/shared/error.md new file mode 100755 index 0000000..dfeeeea --- /dev/null +++ b/docs/models/shared/error.md @@ -0,0 +1,9 @@ +# Error + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ErrorCode` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/errorresponse.md b/docs/models/shared/errorresponse.md new file mode 100755 index 0000000..e5c2360 --- /dev/null +++ b/docs/models/shared/errorresponse.md @@ -0,0 +1,10 @@ +# ErrorResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Details` | **string* | :heavy_minus_sign: | N/A | https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9 | +| `ErrorCode` | [*ErrorsEnum](../../models/shared/errorsenum.md) | :heavy_minus_sign: | N/A | INSUFFICIENT_FUND | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | [INSUFFICIENT_FUND] account had insufficient funds | \ No newline at end of file diff --git a/docs/models/shared/errorsenum.md b/docs/models/shared/errorsenum.md new file mode 100755 index 0000000..9bd7978 --- /dev/null +++ b/docs/models/shared/errorsenum.md @@ -0,0 +1,14 @@ +# ErrorsEnum + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `ErrorsEnumInternal` | INTERNAL | +| `ErrorsEnumInsufficientFund` | INSUFFICIENT_FUND | +| `ErrorsEnumValidation` | VALIDATION | +| `ErrorsEnumConflict` | CONFLICT | +| `ErrorsEnumNoScript` | NO_SCRIPT | +| `ErrorsEnumCompilationFailed` | COMPILATION_FAILED | +| `ErrorsEnumMetadataOverride` | METADATA_OVERRIDE | \ No newline at end of file diff --git a/docs/models/shared/expandeddebithold.md b/docs/models/shared/expandeddebithold.md new file mode 100755 index 0000000..f707b67 --- /dev/null +++ b/docs/models/shared/expandeddebithold.md @@ -0,0 +1,14 @@ +# ExpandedDebitHold + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Description` | *string* | :heavy_check_mark: | N/A | | +| `Destination` | [*Subject](../../models/shared/subject.md) | :heavy_minus_sign: | N/A | | +| `ID` | *string* | :heavy_check_mark: | The unique ID of the hold. | | +| `Metadata` | map[string]*interface{}* | :heavy_check_mark: | Metadata associated with the hold. | | +| `OriginalAmount` | *int64* | :heavy_check_mark: | Original amount on hold | 100 | +| `Remaining` | *int64* | :heavy_check_mark: | Remaining amount on hold | 10 | +| `WalletID` | *string* | :heavy_check_mark: | The ID of the wallet the hold is associated with. | | \ No newline at end of file diff --git a/docs/models/shared/getbalanceresponse.md b/docs/models/shared/getbalanceresponse.md new file mode 100755 index 0000000..48e4695 --- /dev/null +++ b/docs/models/shared/getbalanceresponse.md @@ -0,0 +1,8 @@ +# GetBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `Data` | [BalanceWithAssets](../../models/shared/balancewithassets.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getholdresponse.md b/docs/models/shared/getholdresponse.md new file mode 100755 index 0000000..d559f57 --- /dev/null +++ b/docs/models/shared/getholdresponse.md @@ -0,0 +1,8 @@ +# GetHoldResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `Data` | [ExpandedDebitHold](../../models/shared/expandeddebithold.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getholdsresponse.md b/docs/models/shared/getholdsresponse.md new file mode 100755 index 0000000..8988694 --- /dev/null +++ b/docs/models/shared/getholdsresponse.md @@ -0,0 +1,8 @@ +# GetHoldsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Cursor` | [GetHoldsResponseCursor](../../models/shared/getholdsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getholdsresponsecursor.md b/docs/models/shared/getholdsresponsecursor.md new file mode 100755 index 0000000..b1729f3 --- /dev/null +++ b/docs/models/shared/getholdsresponsecursor.md @@ -0,0 +1,12 @@ +# GetHoldsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Hold](../../models/shared/hold.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/gettransactionsresponse.md b/docs/models/shared/gettransactionsresponse.md new file mode 100755 index 0000000..d297608 --- /dev/null +++ b/docs/models/shared/gettransactionsresponse.md @@ -0,0 +1,8 @@ +# GetTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Cursor` | [GetTransactionsResponseCursor](../../models/shared/gettransactionsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/gettransactionsresponsecursor.md b/docs/models/shared/gettransactionsresponsecursor.md new file mode 100755 index 0000000..4c19542 --- /dev/null +++ b/docs/models/shared/gettransactionsresponsecursor.md @@ -0,0 +1,12 @@ +# GetTransactionsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `Data` | [][WalletsTransaction](../../models/shared/walletstransaction.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/getwalletresponse.md b/docs/models/shared/getwalletresponse.md new file mode 100755 index 0000000..b00a1d2 --- /dev/null +++ b/docs/models/shared/getwalletresponse.md @@ -0,0 +1,8 @@ +# GetWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [WalletWithBalances](../../models/shared/walletwithbalances.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getworkflowoccurrenceresponse.md b/docs/models/shared/getworkflowoccurrenceresponse.md new file mode 100755 index 0000000..dbc0893 --- /dev/null +++ b/docs/models/shared/getworkflowoccurrenceresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowOccurrenceResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [WorkflowOccurrence](../../models/shared/workflowoccurrence.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getworkflowresponse.md b/docs/models/shared/getworkflowresponse.md new file mode 100755 index 0000000..1139677 --- /dev/null +++ b/docs/models/shared/getworkflowresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Data` | [Workflow](../../models/shared/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/hold.md b/docs/models/shared/hold.md new file mode 100755 index 0000000..d6f3f32 --- /dev/null +++ b/docs/models/shared/hold.md @@ -0,0 +1,12 @@ +# Hold + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Description` | *string* | :heavy_check_mark: | N/A | +| `Destination` | [*Subject](../../models/shared/subject.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | The unique ID of the hold. | +| `Metadata` | map[string]*interface{}* | :heavy_check_mark: | Metadata associated with the hold. | +| `WalletID` | *string* | :heavy_check_mark: | The ID of the wallet the hold is associated with. | \ No newline at end of file diff --git a/docs/models/shared/ledgeraccountsubject.md b/docs/models/shared/ledgeraccountsubject.md new file mode 100755 index 0000000..c6eec72 --- /dev/null +++ b/docs/models/shared/ledgeraccountsubject.md @@ -0,0 +1,9 @@ +# LedgerAccountSubject + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Identifier` | *string* | :heavy_check_mark: | N/A | +| `Type` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/ledgerinfo.md b/docs/models/shared/ledgerinfo.md new file mode 100755 index 0000000..137b63a --- /dev/null +++ b/docs/models/shared/ledgerinfo.md @@ -0,0 +1,9 @@ +# LedgerInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | ledger001 | +| `Storage` | [*LedgerInfoStorage](../../models/shared/ledgerinfostorage.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/ledgerinforesponse.md b/docs/models/shared/ledgerinforesponse.md new file mode 100755 index 0000000..b2c4262 --- /dev/null +++ b/docs/models/shared/ledgerinforesponse.md @@ -0,0 +1,8 @@ +# LedgerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `Data` | [*LedgerInfo](../../models/shared/ledgerinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/ledgerinfostorage.md b/docs/models/shared/ledgerinfostorage.md new file mode 100755 index 0000000..2d93d7e --- /dev/null +++ b/docs/models/shared/ledgerinfostorage.md @@ -0,0 +1,8 @@ +# LedgerInfoStorage + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Migrations` | [][MigrationInfo](../../models/shared/migrationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/ledgerstorage.md b/docs/models/shared/ledgerstorage.md new file mode 100755 index 0000000..159532b --- /dev/null +++ b/docs/models/shared/ledgerstorage.md @@ -0,0 +1,9 @@ +# LedgerStorage + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Driver` | *string* | :heavy_check_mark: | N/A | +| `Ledgers` | []*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listbalancesresponse.md b/docs/models/shared/listbalancesresponse.md new file mode 100755 index 0000000..6238acc --- /dev/null +++ b/docs/models/shared/listbalancesresponse.md @@ -0,0 +1,8 @@ +# ListBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Cursor` | [ListBalancesResponseCursor](../../models/shared/listbalancesresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listbalancesresponsecursor.md b/docs/models/shared/listbalancesresponsecursor.md new file mode 100755 index 0000000..6b71dd2 --- /dev/null +++ b/docs/models/shared/listbalancesresponsecursor.md @@ -0,0 +1,12 @@ +# ListBalancesResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Balance](../../models/shared/balance.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/listclientsresponse.md b/docs/models/shared/listclientsresponse.md new file mode 100755 index 0000000..ada6d7e --- /dev/null +++ b/docs/models/shared/listclientsresponse.md @@ -0,0 +1,8 @@ +# ListClientsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [][Client](../../models/shared/client.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listrunsresponse.md b/docs/models/shared/listrunsresponse.md new file mode 100755 index 0000000..840e482 --- /dev/null +++ b/docs/models/shared/listrunsresponse.md @@ -0,0 +1,8 @@ +# ListRunsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Cursor` | [ListRunsResponseCursor](../../models/shared/listrunsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listrunsresponsecursor.md b/docs/models/shared/listrunsresponsecursor.md new file mode 100755 index 0000000..cedb73b --- /dev/null +++ b/docs/models/shared/listrunsresponsecursor.md @@ -0,0 +1,12 @@ +# ListRunsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `Data` | [][WorkflowOccurrence](../../models/shared/workflowoccurrence.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/listscopesresponse.md b/docs/models/shared/listscopesresponse.md new file mode 100755 index 0000000..e2e0f37 --- /dev/null +++ b/docs/models/shared/listscopesresponse.md @@ -0,0 +1,8 @@ +# ListScopesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `Data` | [][Scope](../../models/shared/scope.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listusersresponse.md b/docs/models/shared/listusersresponse.md new file mode 100755 index 0000000..e4586af --- /dev/null +++ b/docs/models/shared/listusersresponse.md @@ -0,0 +1,8 @@ +# ListUsersResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Data` | [][User](../../models/shared/user.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listwalletsresponse.md b/docs/models/shared/listwalletsresponse.md new file mode 100755 index 0000000..c28c056 --- /dev/null +++ b/docs/models/shared/listwalletsresponse.md @@ -0,0 +1,8 @@ +# ListWalletsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `Cursor` | [ListWalletsResponseCursor](../../models/shared/listwalletsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listwalletsresponsecursor.md b/docs/models/shared/listwalletsresponsecursor.md new file mode 100755 index 0000000..63f0972 --- /dev/null +++ b/docs/models/shared/listwalletsresponsecursor.md @@ -0,0 +1,12 @@ +# ListWalletsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Wallet](../../models/shared/wallet.md) | :heavy_check_mark: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/listworkflowsresponse.md b/docs/models/shared/listworkflowsresponse.md new file mode 100755 index 0000000..7986d2b --- /dev/null +++ b/docs/models/shared/listworkflowsresponse.md @@ -0,0 +1,8 @@ +# ListWorkflowsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [][Workflow](../../models/shared/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/log.md b/docs/models/shared/log.md new file mode 100755 index 0000000..73b1e4e --- /dev/null +++ b/docs/models/shared/log.md @@ -0,0 +1,12 @@ +# Log + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Data` | [LogData](../../models/shared/logdata.md) | :heavy_check_mark: | N/A | | +| `Date` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Hash` | *string* | :heavy_check_mark: | N/A | 9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e | +| `ID` | *int64* | :heavy_check_mark: | N/A | 1234 | +| `Type` | [LogType](../../models/shared/logtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/logdata.md b/docs/models/shared/logdata.md new file mode 100755 index 0000000..54cd59d --- /dev/null +++ b/docs/models/shared/logdata.md @@ -0,0 +1,7 @@ +# LogData + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/logscursorresponse.md b/docs/models/shared/logscursorresponse.md new file mode 100755 index 0000000..322cd96 --- /dev/null +++ b/docs/models/shared/logscursorresponse.md @@ -0,0 +1,8 @@ +# LogsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Cursor` | [LogsCursorResponseCursor](../../models/shared/logscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/logscursorresponsecursor.md b/docs/models/shared/logscursorresponsecursor.md new file mode 100755 index 0000000..03fc795 --- /dev/null +++ b/docs/models/shared/logscursorresponsecursor.md @@ -0,0 +1,12 @@ +# LogsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Log](../../models/shared/log.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/logtype.md b/docs/models/shared/logtype.md new file mode 100755 index 0000000..400bcd3 --- /dev/null +++ b/docs/models/shared/logtype.md @@ -0,0 +1,9 @@ +# LogType + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `LogTypeNewTransaction` | NEW_TRANSACTION | +| `LogTypeSetMetadata` | SET_METADATA | \ No newline at end of file diff --git a/docs/models/shared/mapping.md b/docs/models/shared/mapping.md new file mode 100755 index 0000000..64bfeb7 --- /dev/null +++ b/docs/models/shared/mapping.md @@ -0,0 +1,8 @@ +# Mapping + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Contracts` | [][Contract](../../models/shared/contract.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/mappingresponse.md b/docs/models/shared/mappingresponse.md new file mode 100755 index 0000000..fc23a2c --- /dev/null +++ b/docs/models/shared/mappingresponse.md @@ -0,0 +1,8 @@ +# MappingResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Data` | [*Mapping](../../models/shared/mapping.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/migrationinfo.md b/docs/models/shared/migrationinfo.md new file mode 100755 index 0000000..25f2551 --- /dev/null +++ b/docs/models/shared/migrationinfo.md @@ -0,0 +1,11 @@ +# MigrationInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Date` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `Name` | **string* | :heavy_minus_sign: | N/A | migrations:001 | +| `State` | [*MigrationInfoState](../../models/shared/migrationinfostate.md) | :heavy_minus_sign: | N/A | | +| `Version` | **int64* | :heavy_minus_sign: | N/A | 11 | \ No newline at end of file diff --git a/docs/models/shared/migrationinfostate.md b/docs/models/shared/migrationinfostate.md new file mode 100755 index 0000000..5193be7 --- /dev/null +++ b/docs/models/shared/migrationinfostate.md @@ -0,0 +1,9 @@ +# MigrationInfoState + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `MigrationInfoStateToDo` | to do | +| `MigrationInfoStateDone` | done | \ No newline at end of file diff --git a/docs/models/shared/modulrconfig.md b/docs/models/shared/modulrconfig.md new file mode 100755 index 0000000..25cb42c --- /dev/null +++ b/docs/models/shared/modulrconfig.md @@ -0,0 +1,10 @@ +# ModulrConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `APIKey` | *string* | :heavy_check_mark: | N/A | XXX | +| `APISecret` | *string* | :heavy_check_mark: | N/A | XXX | +| `Endpoint` | **string* | :heavy_minus_sign: | N/A | XXX | \ No newline at end of file diff --git a/docs/models/shared/monetary.md b/docs/models/shared/monetary.md new file mode 100755 index 0000000..dbf1c0a --- /dev/null +++ b/docs/models/shared/monetary.md @@ -0,0 +1,9 @@ +# Monetary + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `Amount` | *int64* | :heavy_check_mark: | The amount of the monetary value. | +| `Asset` | *string* | :heavy_check_mark: | The asset of the monetary value. | \ No newline at end of file diff --git a/docs/models/shared/payment.md b/docs/models/shared/payment.md new file mode 100755 index 0000000..2d7c949 --- /dev/null +++ b/docs/models/shared/payment.md @@ -0,0 +1,20 @@ +# Payment + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `AccountID` | *string* | :heavy_check_mark: | N/A | | +| `Adjustments` | [][PaymentAdjustment](../../models/shared/paymentadjustment.md) | :heavy_check_mark: | N/A | | +| `Asset` | *string* | :heavy_check_mark: | N/A | USD | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `ID` | *string* | :heavy_check_mark: | N/A | XXX | +| `InitialAmount` | *int64* | :heavy_check_mark: | N/A | 100 | +| `Metadata` | [][PaymentMetadata](../../models/shared/paymentmetadata.md) | :heavy_check_mark: | N/A | | +| `Provider` | [Connector](../../models/shared/connector.md) | :heavy_check_mark: | N/A | | +| `Raw` | [PaymentRaw](../../models/shared/paymentraw.md) | :heavy_check_mark: | N/A | | +| `Reference` | *string* | :heavy_check_mark: | N/A | | +| `Scheme` | [PaymentScheme](../../models/shared/paymentscheme.md) | :heavy_check_mark: | N/A | | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | | +| `Type` | [PaymentType](../../models/shared/paymenttype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/paymentadjustment.md b/docs/models/shared/paymentadjustment.md new file mode 100755 index 0000000..c62c064 --- /dev/null +++ b/docs/models/shared/paymentadjustment.md @@ -0,0 +1,12 @@ +# PaymentAdjustment + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Absolute` | *bool* | :heavy_check_mark: | N/A | | +| `Amount` | *int64* | :heavy_check_mark: | N/A | 100 | +| `Date` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Raw` | [PaymentAdjustmentRaw](../../models/shared/paymentadjustmentraw.md) | :heavy_check_mark: | N/A | | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/paymentadjustmentraw.md b/docs/models/shared/paymentadjustmentraw.md new file mode 100755 index 0000000..78f88ae --- /dev/null +++ b/docs/models/shared/paymentadjustmentraw.md @@ -0,0 +1,7 @@ +# PaymentAdjustmentRaw + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/paymentmetadata.md b/docs/models/shared/paymentmetadata.md new file mode 100755 index 0000000..90a1ef9 --- /dev/null +++ b/docs/models/shared/paymentmetadata.md @@ -0,0 +1,10 @@ +# PaymentMetadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Changelog` | [*PaymentMetadataChangelog](../../models/shared/paymentmetadatachangelog.md) | :heavy_minus_sign: | N/A | +| `Key` | *string* | :heavy_check_mark: | N/A | +| `Value` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/paymentmetadatachangelog.md b/docs/models/shared/paymentmetadatachangelog.md new file mode 100755 index 0000000..2191419 --- /dev/null +++ b/docs/models/shared/paymentmetadatachangelog.md @@ -0,0 +1,9 @@ +# PaymentMetadataChangelog + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Timestamp` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Value` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/paymentraw.md b/docs/models/shared/paymentraw.md new file mode 100755 index 0000000..e884afe --- /dev/null +++ b/docs/models/shared/paymentraw.md @@ -0,0 +1,7 @@ +# PaymentRaw + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/paymentresponse.md b/docs/models/shared/paymentresponse.md new file mode 100755 index 0000000..ac9dc71 --- /dev/null +++ b/docs/models/shared/paymentresponse.md @@ -0,0 +1,8 @@ +# PaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [Payment](../../models/shared/payment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/paymentsaccount.md b/docs/models/shared/paymentsaccount.md new file mode 100755 index 0000000..092dc0c --- /dev/null +++ b/docs/models/shared/paymentsaccount.md @@ -0,0 +1,12 @@ +# PaymentsAccount + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Provider` | [Connector](../../models/shared/connector.md) | :heavy_check_mark: | N/A | +| `Reference` | *string* | :heavy_check_mark: | N/A | +| `Type` | [PaymentsAccountType](../../models/shared/paymentsaccounttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/paymentsaccounttype.md b/docs/models/shared/paymentsaccounttype.md new file mode 100755 index 0000000..452bcc4 --- /dev/null +++ b/docs/models/shared/paymentsaccounttype.md @@ -0,0 +1,9 @@ +# PaymentsAccountType + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PaymentsAccountTypeTarget` | TARGET | +| `PaymentsAccountTypeSource` | SOURCE | \ No newline at end of file diff --git a/docs/models/shared/paymentscheme.md b/docs/models/shared/paymentscheme.md new file mode 100755 index 0000000..e88c62f --- /dev/null +++ b/docs/models/shared/paymentscheme.md @@ -0,0 +1,25 @@ +# PaymentScheme + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `PaymentSchemeVisa` | visa | +| `PaymentSchemeMastercard` | mastercard | +| `PaymentSchemeAmex` | amex | +| `PaymentSchemeDiners` | diners | +| `PaymentSchemeDiscover` | discover | +| `PaymentSchemeJcb` | jcb | +| `PaymentSchemeUnionpay` | unionpay | +| `PaymentSchemeSepaDebit` | sepa debit | +| `PaymentSchemeSepaCredit` | sepa credit | +| `PaymentSchemeSepa` | sepa | +| `PaymentSchemeApplePay` | apple pay | +| `PaymentSchemeGooglePay` | google pay | +| `PaymentSchemeA2a` | a2a | +| `PaymentSchemeAchDebit` | ach debit | +| `PaymentSchemeAch` | ach | +| `PaymentSchemeRtp` | rtp | +| `PaymentSchemeUnknown` | unknown | +| `PaymentSchemeOther` | other | \ No newline at end of file diff --git a/docs/models/shared/paymentscursor.md b/docs/models/shared/paymentscursor.md new file mode 100755 index 0000000..0e56d11 --- /dev/null +++ b/docs/models/shared/paymentscursor.md @@ -0,0 +1,8 @@ +# PaymentsCursor + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Cursor` | [PaymentsCursorCursor](../../models/shared/paymentscursorcursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/paymentscursorcursor.md b/docs/models/shared/paymentscursorcursor.md new file mode 100755 index 0000000..9861aa3 --- /dev/null +++ b/docs/models/shared/paymentscursorcursor.md @@ -0,0 +1,12 @@ +# PaymentsCursorCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Payment](../../models/shared/payment.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/paymentstatus.md b/docs/models/shared/paymentstatus.md new file mode 100755 index 0000000..f1d31ee --- /dev/null +++ b/docs/models/shared/paymentstatus.md @@ -0,0 +1,11 @@ +# PaymentStatus + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `PaymentStatusPending` | PENDING | +| `PaymentStatusActive` | ACTIVE | +| `PaymentStatusTerminated` | TERMINATED | +| `PaymentStatusFailed` | FAILED | \ No newline at end of file diff --git a/docs/models/shared/paymenttype.md b/docs/models/shared/paymenttype.md new file mode 100755 index 0000000..dfc9842 --- /dev/null +++ b/docs/models/shared/paymenttype.md @@ -0,0 +1,11 @@ +# PaymentType + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `PaymentTypePayIn` | PAY-IN | +| `PaymentTypePayout` | PAYOUT | +| `PaymentTypeTransfer` | TRANSFER | +| `PaymentTypeOther` | OTHER | \ No newline at end of file diff --git a/docs/models/shared/posting.md b/docs/models/shared/posting.md new file mode 100755 index 0000000..6607ee6 --- /dev/null +++ b/docs/models/shared/posting.md @@ -0,0 +1,11 @@ +# Posting + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Amount` | *int64* | :heavy_check_mark: | N/A | 100 | +| `Asset` | *string* | :heavy_check_mark: | N/A | COIN | +| `Destination` | *string* | :heavy_check_mark: | N/A | users:002 | +| `Source` | *string* | :heavy_check_mark: | N/A | users:001 | \ No newline at end of file diff --git a/docs/models/shared/posttransaction.md b/docs/models/shared/posttransaction.md new file mode 100755 index 0000000..87ad2d9 --- /dev/null +++ b/docs/models/shared/posttransaction.md @@ -0,0 +1,12 @@ +# PostTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_minus_sign: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Script` | [*PostTransactionScript](../../models/shared/posttransactionscript.md) | :heavy_minus_sign: | N/A | | +| `Timestamp` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/posttransactionscript.md b/docs/models/shared/posttransactionscript.md new file mode 100755 index 0000000..cf9465c --- /dev/null +++ b/docs/models/shared/posttransactionscript.md @@ -0,0 +1,9 @@ +# PostTransactionScript + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Plain` | *string* | :heavy_check_mark: | N/A | vars {
account $user
}
send [COIN 10] (
source = @world
destination = $user
)
| +| `Vars` | [*PostTransactionScriptVars](../../models/shared/posttransactionscriptvars.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/posttransactionscriptvars.md b/docs/models/shared/posttransactionscriptvars.md new file mode 100755 index 0000000..ef1a0de --- /dev/null +++ b/docs/models/shared/posttransactionscriptvars.md @@ -0,0 +1,7 @@ +# PostTransactionScriptVars + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/query.md b/docs/models/shared/query.md new file mode 100755 index 0000000..63e5dfb --- /dev/null +++ b/docs/models/shared/query.md @@ -0,0 +1,15 @@ +# Query + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `After` | []*string* | :heavy_minus_sign: | N/A | | +| `Cursor` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | +| `Ledgers` | []*string* | :heavy_minus_sign: | N/A | | +| `PageSize` | **int64* | :heavy_minus_sign: | N/A | | +| `Policy` | **string* | :heavy_minus_sign: | N/A | OR | +| `Sort` | **string* | :heavy_minus_sign: | N/A | txid:asc | +| `Target` | **string* | :heavy_minus_sign: | N/A | | +| `Terms` | []*string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/readclientresponse.md b/docs/models/shared/readclientresponse.md new file mode 100755 index 0000000..fb6d823 --- /dev/null +++ b/docs/models/shared/readclientresponse.md @@ -0,0 +1,8 @@ +# ReadClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Data` | [*Client](../../models/shared/client.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/readscoperesponse.md b/docs/models/shared/readscoperesponse.md new file mode 100755 index 0000000..49f970d --- /dev/null +++ b/docs/models/shared/readscoperesponse.md @@ -0,0 +1,8 @@ +# ReadScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `Data` | [*Scope](../../models/shared/scope.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/readuserresponse.md b/docs/models/shared/readuserresponse.md new file mode 100755 index 0000000..2aef17f --- /dev/null +++ b/docs/models/shared/readuserresponse.md @@ -0,0 +1,8 @@ +# ReadUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `Data` | [*User](../../models/shared/user.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/response.md b/docs/models/shared/response.md new file mode 100755 index 0000000..cf74e35 --- /dev/null +++ b/docs/models/shared/response.md @@ -0,0 +1,9 @@ +# Response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Cursor` | [*ResponseCursor](../../models/shared/responsecursor.md) | :heavy_minus_sign: | N/A | +| `Data` | [*ResponseData](../../models/shared/responsedata.md) | :heavy_minus_sign: | The payload | \ No newline at end of file diff --git a/docs/models/shared/responsecursor.md b/docs/models/shared/responsecursor.md new file mode 100755 index 0000000..cea1ced --- /dev/null +++ b/docs/models/shared/responsecursor.md @@ -0,0 +1,13 @@ +# ResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Data` | [][ResponseCursorData](../../models/shared/responsecursordata.md) | :heavy_minus_sign: | N/A | | +| `HasMore` | **bool* | :heavy_minus_sign: | N/A | | +| `Next` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | +| `PageSize` | **int64* | :heavy_minus_sign: | N/A | | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | +| `Total` | [*ResponseCursorTotal](../../models/shared/responsecursortotal.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/responsecursordata.md b/docs/models/shared/responsecursordata.md new file mode 100755 index 0000000..f531979 --- /dev/null +++ b/docs/models/shared/responsecursordata.md @@ -0,0 +1,7 @@ +# ResponseCursorData + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/responsecursortotal.md b/docs/models/shared/responsecursortotal.md new file mode 100755 index 0000000..dfa5769 --- /dev/null +++ b/docs/models/shared/responsecursortotal.md @@ -0,0 +1,9 @@ +# ResponseCursorTotal + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Relation` | **string* | :heavy_minus_sign: | N/A | eq | +| `Value` | **int64* | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/shared/responsedata.md b/docs/models/shared/responsedata.md new file mode 100755 index 0000000..c3a85e7 --- /dev/null +++ b/docs/models/shared/responsedata.md @@ -0,0 +1,9 @@ +# ResponseData + +The payload + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/runworkflowresponse.md b/docs/models/shared/runworkflowresponse.md new file mode 100755 index 0000000..d643e81 --- /dev/null +++ b/docs/models/shared/runworkflowresponse.md @@ -0,0 +1,8 @@ +# RunWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [WorkflowOccurrence](../../models/shared/workflowoccurrence.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/scope.md b/docs/models/shared/scope.md new file mode 100755 index 0000000..fbdae91 --- /dev/null +++ b/docs/models/shared/scope.md @@ -0,0 +1,11 @@ +# Scope + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Label` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Transient` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/script.md b/docs/models/shared/script.md new file mode 100755 index 0000000..0a3d2d2 --- /dev/null +++ b/docs/models/shared/script.md @@ -0,0 +1,11 @@ +# Script + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Plain` | *string* | :heavy_check_mark: | N/A | vars {
account $user
}
send [COIN 10] (
source = @world
destination = $user
)
| +| `Reference` | **string* | :heavy_minus_sign: | Reference to attach to the generated transaction | order_1234 | +| `Vars` | [*ScriptVars](../../models/shared/scriptvars.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/scriptresponse.md b/docs/models/shared/scriptresponse.md new file mode 100755 index 0000000..8f24996 --- /dev/null +++ b/docs/models/shared/scriptresponse.md @@ -0,0 +1,11 @@ +# ScriptResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Details` | **string* | :heavy_minus_sign: | N/A | https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9 | +| `ErrorCode` | [*ErrorsEnum](../../models/shared/errorsenum.md) | :heavy_minus_sign: | N/A | INSUFFICIENT_FUND | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | account had insufficient funds | +| `Transaction` | [*Transaction](../../models/shared/transaction.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/scriptvars.md b/docs/models/shared/scriptvars.md new file mode 100755 index 0000000..285f3df --- /dev/null +++ b/docs/models/shared/scriptvars.md @@ -0,0 +1,7 @@ +# ScriptVars + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/secret.md b/docs/models/shared/secret.md new file mode 100755 index 0000000..851b992 --- /dev/null +++ b/docs/models/shared/secret.md @@ -0,0 +1,12 @@ +# Secret + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Clear` | *string* | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `LastDigits` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/security.md b/docs/models/shared/security.md new file mode 100755 index 0000000..5d923fc --- /dev/null +++ b/docs/models/shared/security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Authorization` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/serverinfo.md b/docs/models/shared/serverinfo.md new file mode 100755 index 0000000..bf626a0 --- /dev/null +++ b/docs/models/shared/serverinfo.md @@ -0,0 +1,8 @@ +# ServerInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagestatus.md b/docs/models/shared/stagestatus.md new file mode 100755 index 0000000..2ff198a --- /dev/null +++ b/docs/models/shared/stagestatus.md @@ -0,0 +1,12 @@ +# StageStatus + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `OccurrenceID` | *string* | :heavy_check_mark: | N/A | +| `Stage` | *float64* | :heavy_check_mark: | N/A | +| `StartedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `TerminatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stats.md b/docs/models/shared/stats.md new file mode 100755 index 0000000..c87615b --- /dev/null +++ b/docs/models/shared/stats.md @@ -0,0 +1,9 @@ +# Stats + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Accounts` | *int64* | :heavy_check_mark: | N/A | +| `Transactions` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/statsresponse.md b/docs/models/shared/statsresponse.md new file mode 100755 index 0000000..fdc3811 --- /dev/null +++ b/docs/models/shared/statsresponse.md @@ -0,0 +1,8 @@ +# StatsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Data` | [Stats](../../models/shared/stats.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stripeconfig.md b/docs/models/shared/stripeconfig.md new file mode 100755 index 0000000..be8667e --- /dev/null +++ b/docs/models/shared/stripeconfig.md @@ -0,0 +1,10 @@ +# StripeConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `APIKey` | *string* | :heavy_check_mark: | N/A | XXX | +| `PageSize` | **int64* | :heavy_minus_sign: | Number of BalanceTransaction to fetch at each polling interval.
| 50 | +| `PollingPeriod` | **string* | :heavy_minus_sign: | The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.
| 60s | \ No newline at end of file diff --git a/docs/models/shared/stripetransferrequest.md b/docs/models/shared/stripetransferrequest.md new file mode 100755 index 0000000..377c039 --- /dev/null +++ b/docs/models/shared/stripetransferrequest.md @@ -0,0 +1,11 @@ +# StripeTransferRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Amount` | **int64* | :heavy_minus_sign: | N/A | 100 | +| `Asset` | **string* | :heavy_minus_sign: | N/A | USD | +| `Destination` | **string* | :heavy_minus_sign: | N/A | acct_1Gqj58KZcSIg2N2q | +| `Metadata` | [*StripeTransferRequestMetadata](../../models/shared/stripetransferrequestmetadata.md) | :heavy_minus_sign: | A set of key/value pairs that you can attach to a transfer object.
It can be useful for storing additional information about the transfer in a structured format.
| | \ No newline at end of file diff --git a/docs/models/shared/stripetransferrequestmetadata.md b/docs/models/shared/stripetransferrequestmetadata.md new file mode 100755 index 0000000..d99b0e6 --- /dev/null +++ b/docs/models/shared/stripetransferrequestmetadata.md @@ -0,0 +1,11 @@ +# StripeTransferRequestMetadata + +A set of key/value pairs that you can attach to a transfer object. +It can be useful for storing additional information about the transfer in a structured format. + + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/stripetransferresponse.md b/docs/models/shared/stripetransferresponse.md new file mode 100755 index 0000000..7282c88 --- /dev/null +++ b/docs/models/shared/stripetransferresponse.md @@ -0,0 +1,7 @@ +# StripeTransferResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/subject.md b/docs/models/shared/subject.md new file mode 100755 index 0000000..8d398e2 --- /dev/null +++ b/docs/models/shared/subject.md @@ -0,0 +1,17 @@ +# Subject + + +## Supported Types + +### LedgerAccountSubject + +```go +subject := shared.CreateSubjectAccount(shared.LedgerAccountSubject{/* values here */}) +``` + +### WalletSubject + +```go +subject := shared.CreateSubjectWallet(shared.WalletSubject{/* values here */}) +``` + diff --git a/docs/models/shared/taskbankingcircle.md b/docs/models/shared/taskbankingcircle.md new file mode 100755 index 0000000..be73c0b --- /dev/null +++ b/docs/models/shared/taskbankingcircle.md @@ -0,0 +1,15 @@ +# TaskBankingCircle + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskBankingCircleDescriptor](../../models/shared/taskbankingcircledescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskBankingCircleState](../../models/shared/taskbankingcirclestate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskbankingcircledescriptor.md b/docs/models/shared/taskbankingcircledescriptor.md new file mode 100755 index 0000000..1455551 --- /dev/null +++ b/docs/models/shared/taskbankingcircledescriptor.md @@ -0,0 +1,9 @@ +# TaskBankingCircleDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskbankingcirclestate.md b/docs/models/shared/taskbankingcirclestate.md new file mode 100755 index 0000000..ab19f64 --- /dev/null +++ b/docs/models/shared/taskbankingcirclestate.md @@ -0,0 +1,7 @@ +# TaskBankingCircleState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/taskcurrencycloud.md b/docs/models/shared/taskcurrencycloud.md new file mode 100755 index 0000000..bd9ab58 --- /dev/null +++ b/docs/models/shared/taskcurrencycloud.md @@ -0,0 +1,15 @@ +# TaskCurrencyCloud + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskCurrencyCloudDescriptor](../../models/shared/taskcurrencyclouddescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskCurrencyCloudState](../../models/shared/taskcurrencycloudstate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskcurrencyclouddescriptor.md b/docs/models/shared/taskcurrencyclouddescriptor.md new file mode 100755 index 0000000..82a03ab --- /dev/null +++ b/docs/models/shared/taskcurrencyclouddescriptor.md @@ -0,0 +1,8 @@ +# TaskCurrencyCloudDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Name` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskcurrencycloudstate.md b/docs/models/shared/taskcurrencycloudstate.md new file mode 100755 index 0000000..dee02a3 --- /dev/null +++ b/docs/models/shared/taskcurrencycloudstate.md @@ -0,0 +1,7 @@ +# TaskCurrencyCloudState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/taskdummypay.md b/docs/models/shared/taskdummypay.md new file mode 100755 index 0000000..c0ccfa8 --- /dev/null +++ b/docs/models/shared/taskdummypay.md @@ -0,0 +1,15 @@ +# TaskDummyPay + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskDummyPayDescriptor](../../models/shared/taskdummypaydescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskDummyPayState](../../models/shared/taskdummypaystate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskdummypaydescriptor.md b/docs/models/shared/taskdummypaydescriptor.md new file mode 100755 index 0000000..a770929 --- /dev/null +++ b/docs/models/shared/taskdummypaydescriptor.md @@ -0,0 +1,10 @@ +# TaskDummyPayDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FileName` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskdummypaystate.md b/docs/models/shared/taskdummypaystate.md new file mode 100755 index 0000000..c48e908 --- /dev/null +++ b/docs/models/shared/taskdummypaystate.md @@ -0,0 +1,7 @@ +# TaskDummyPayState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/taskmodulr.md b/docs/models/shared/taskmodulr.md new file mode 100755 index 0000000..2e7e47d --- /dev/null +++ b/docs/models/shared/taskmodulr.md @@ -0,0 +1,15 @@ +# TaskModulr + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskModulrDescriptor](../../models/shared/taskmodulrdescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskModulrState](../../models/shared/taskmodulrstate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskmodulrdescriptor.md b/docs/models/shared/taskmodulrdescriptor.md new file mode 100755 index 0000000..0261933 --- /dev/null +++ b/docs/models/shared/taskmodulrdescriptor.md @@ -0,0 +1,10 @@ +# TaskModulrDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `AccountID` | **string* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskmodulrstate.md b/docs/models/shared/taskmodulrstate.md new file mode 100755 index 0000000..291d63b --- /dev/null +++ b/docs/models/shared/taskmodulrstate.md @@ -0,0 +1,7 @@ +# TaskModulrState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/taskresponse.md b/docs/models/shared/taskresponse.md new file mode 100755 index 0000000..4522661 --- /dev/null +++ b/docs/models/shared/taskresponse.md @@ -0,0 +1,8 @@ +# TaskResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Data` | [TaskResponseData](../../models/shared/taskresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskresponsedata.md b/docs/models/shared/taskresponsedata.md new file mode 100755 index 0000000..2f2534b --- /dev/null +++ b/docs/models/shared/taskresponsedata.md @@ -0,0 +1,41 @@ +# TaskResponseData + + +## Supported Types + +### TaskStripe + +```go +taskResponseData := shared.CreateTaskResponseDataTaskStripe(shared.TaskStripe{/* values here */}) +``` + +### TaskWise + +```go +taskResponseData := shared.CreateTaskResponseDataTaskWise(shared.TaskWise{/* values here */}) +``` + +### TaskCurrencyCloud + +```go +taskResponseData := shared.CreateTaskResponseDataTaskCurrencyCloud(shared.TaskCurrencyCloud{/* values here */}) +``` + +### TaskDummyPay + +```go +taskResponseData := shared.CreateTaskResponseDataTaskDummyPay(shared.TaskDummyPay{/* values here */}) +``` + +### TaskModulr + +```go +taskResponseData := shared.CreateTaskResponseDataTaskModulr(shared.TaskModulr{/* values here */}) +``` + +### TaskBankingCircle + +```go +taskResponseData := shared.CreateTaskResponseDataTaskBankingCircle(shared.TaskBankingCircle{/* values here */}) +``` + diff --git a/docs/models/shared/taskscursor.md b/docs/models/shared/taskscursor.md new file mode 100755 index 0000000..bcc40f1 --- /dev/null +++ b/docs/models/shared/taskscursor.md @@ -0,0 +1,8 @@ +# TasksCursor + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `Cursor` | [TasksCursorCursor](../../models/shared/taskscursorcursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskscursorcursor.md b/docs/models/shared/taskscursorcursor.md new file mode 100755 index 0000000..19bd016 --- /dev/null +++ b/docs/models/shared/taskscursorcursor.md @@ -0,0 +1,12 @@ +# TasksCursorCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Data` | [][TasksCursorCursorData](../../models/shared/taskscursorcursordata.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/taskscursorcursordata.md b/docs/models/shared/taskscursorcursordata.md new file mode 100755 index 0000000..0445c5c --- /dev/null +++ b/docs/models/shared/taskscursorcursordata.md @@ -0,0 +1,41 @@ +# TasksCursorCursorData + + +## Supported Types + +### TaskStripe + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskStripe(shared.TaskStripe{/* values here */}) +``` + +### TaskWise + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskWise(shared.TaskWise{/* values here */}) +``` + +### TaskCurrencyCloud + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskCurrencyCloud(shared.TaskCurrencyCloud{/* values here */}) +``` + +### TaskDummyPay + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskDummyPay(shared.TaskDummyPay{/* values here */}) +``` + +### TaskModulr + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskModulr(shared.TaskModulr{/* values here */}) +``` + +### TaskBankingCircle + +```go +tasksCursorCursorData := shared.CreateTasksCursorCursorDataTaskBankingCircle(shared.TaskBankingCircle{/* values here */}) +``` + diff --git a/docs/models/shared/taskstripe.md b/docs/models/shared/taskstripe.md new file mode 100755 index 0000000..2990b1e --- /dev/null +++ b/docs/models/shared/taskstripe.md @@ -0,0 +1,15 @@ +# TaskStripe + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskStripeDescriptor](../../models/shared/taskstripedescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskStripeState](../../models/shared/taskstripestate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskstripedescriptor.md b/docs/models/shared/taskstripedescriptor.md new file mode 100755 index 0000000..7b44b60 --- /dev/null +++ b/docs/models/shared/taskstripedescriptor.md @@ -0,0 +1,10 @@ +# TaskStripeDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Account` | *string* | :heavy_check_mark: | N/A | +| `Main` | **bool* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskstripestate.md b/docs/models/shared/taskstripestate.md new file mode 100755 index 0000000..9639b5c --- /dev/null +++ b/docs/models/shared/taskstripestate.md @@ -0,0 +1,7 @@ +# TaskStripeState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/taskwise.md b/docs/models/shared/taskwise.md new file mode 100755 index 0000000..8c2362c --- /dev/null +++ b/docs/models/shared/taskwise.md @@ -0,0 +1,15 @@ +# TaskWise + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Descriptor` | [TaskWiseDescriptor](../../models/shared/taskwisedescriptor.md) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `State` | [TaskWiseState](../../models/shared/taskwisestate.md) | :heavy_check_mark: | N/A | +| `Status` | [PaymentStatus](../../models/shared/paymentstatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskwisedescriptor.md b/docs/models/shared/taskwisedescriptor.md new file mode 100755 index 0000000..d1a0196 --- /dev/null +++ b/docs/models/shared/taskwisedescriptor.md @@ -0,0 +1,10 @@ +# TaskWiseDescriptor + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `ProfileID` | **int64* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/taskwisestate.md b/docs/models/shared/taskwisestate.md new file mode 100755 index 0000000..fc76ce0 --- /dev/null +++ b/docs/models/shared/taskwisestate.md @@ -0,0 +1,7 @@ +# TaskWiseState + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/transaction.md b/docs/models/shared/transaction.md new file mode 100755 index 0000000..d3f08c1 --- /dev/null +++ b/docs/models/shared/transaction.md @@ -0,0 +1,14 @@ +# Transaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `PostCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | | +| `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_check_mark: | N/A | | +| `PreCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Timestamp` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Txid` | *int64* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/transactiondata.md b/docs/models/shared/transactiondata.md new file mode 100755 index 0000000..b3fc32b --- /dev/null +++ b/docs/models/shared/transactiondata.md @@ -0,0 +1,11 @@ +# TransactionData + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_check_mark: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Timestamp` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/transactionresponse.md b/docs/models/shared/transactionresponse.md new file mode 100755 index 0000000..9200d43 --- /dev/null +++ b/docs/models/shared/transactionresponse.md @@ -0,0 +1,8 @@ +# TransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Data` | [Transaction](../../models/shared/transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/transactions.md b/docs/models/shared/transactions.md new file mode 100755 index 0000000..c6c4b99 --- /dev/null +++ b/docs/models/shared/transactions.md @@ -0,0 +1,8 @@ +# Transactions + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Transactions` | [][TransactionData](../../models/shared/transactiondata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/transactionscursorresponse.md b/docs/models/shared/transactionscursorresponse.md new file mode 100755 index 0000000..1cb12dc --- /dev/null +++ b/docs/models/shared/transactionscursorresponse.md @@ -0,0 +1,8 @@ +# TransactionsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `Cursor` | [TransactionsCursorResponseCursor](../../models/shared/transactionscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/transactionscursorresponsecursor.md b/docs/models/shared/transactionscursorresponsecursor.md new file mode 100755 index 0000000..0a29700 --- /dev/null +++ b/docs/models/shared/transactionscursorresponsecursor.md @@ -0,0 +1,12 @@ +# TransactionsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Data` | [][Transaction](../../models/shared/transaction.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | +| `Next` | **string* | :heavy_minus_sign: | N/A | | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | 15 | +| `Previous` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | \ No newline at end of file diff --git a/docs/models/shared/transactionsresponse.md b/docs/models/shared/transactionsresponse.md new file mode 100755 index 0000000..3d9db87 --- /dev/null +++ b/docs/models/shared/transactionsresponse.md @@ -0,0 +1,8 @@ +# TransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Data` | [][Transaction](../../models/shared/transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/updateclientrequest.md b/docs/models/shared/updateclientrequest.md new file mode 100755 index 0000000..e40cc0a --- /dev/null +++ b/docs/models/shared/updateclientrequest.md @@ -0,0 +1,14 @@ +# UpdateClientRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `PostLogoutRedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Public` | **bool* | :heavy_minus_sign: | N/A | +| `RedirectUris` | []*string* | :heavy_minus_sign: | N/A | +| `Trusted` | **bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/updateclientresponse.md b/docs/models/shared/updateclientresponse.md new file mode 100755 index 0000000..d76a947 --- /dev/null +++ b/docs/models/shared/updateclientresponse.md @@ -0,0 +1,8 @@ +# UpdateClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Data` | [*Client](../../models/shared/client.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/updatescoperequest.md b/docs/models/shared/updatescoperequest.md new file mode 100755 index 0000000..8e37550 --- /dev/null +++ b/docs/models/shared/updatescoperequest.md @@ -0,0 +1,9 @@ +# UpdateScopeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Label` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/updatescoperesponse.md b/docs/models/shared/updatescoperesponse.md new file mode 100755 index 0000000..d2c7146 --- /dev/null +++ b/docs/models/shared/updatescoperesponse.md @@ -0,0 +1,8 @@ +# UpdateScopeResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `Data` | [*Scope](../../models/shared/scope.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/user.md b/docs/models/shared/user.md new file mode 100755 index 0000000..b035373 --- /dev/null +++ b/docs/models/shared/user.md @@ -0,0 +1,10 @@ +# User + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `Email` | **string* | :heavy_minus_sign: | N/A | user1@orga1.com | +| `ID` | **string* | :heavy_minus_sign: | N/A | 3bb03708-312f-48a0-821a-e765837dc2c4 | +| `Subject` | **string* | :heavy_minus_sign: | N/A | Jane Doe | \ No newline at end of file diff --git a/docs/models/shared/volume.md b/docs/models/shared/volume.md new file mode 100755 index 0000000..8e48cd6 --- /dev/null +++ b/docs/models/shared/volume.md @@ -0,0 +1,10 @@ +# Volume + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **int64* | :heavy_minus_sign: | N/A | +| `Input` | *int64* | :heavy_check_mark: | N/A | +| `Output` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/wallet.md b/docs/models/shared/wallet.md new file mode 100755 index 0000000..95b7e6e --- /dev/null +++ b/docs/models/shared/wallet.md @@ -0,0 +1,12 @@ +# Wallet + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | The unique ID of the wallet. | +| `Ledger` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_check_mark: | Metadata associated with the wallet. | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletserrorresponse.md b/docs/models/shared/walletserrorresponse.md new file mode 100755 index 0000000..2574da7 --- /dev/null +++ b/docs/models/shared/walletserrorresponse.md @@ -0,0 +1,9 @@ +# WalletsErrorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ErrorCode` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletstransaction.md b/docs/models/shared/walletstransaction.md new file mode 100755 index 0000000..c51f4e5 --- /dev/null +++ b/docs/models/shared/walletstransaction.md @@ -0,0 +1,14 @@ +# WalletsTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | Metadata associated with the wallet. | | +| `PostCommitVolumes` | map[string]map[string][WalletsVolume](../../models/shared/walletsvolume.md) | :heavy_minus_sign: | N/A | | +| `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_check_mark: | N/A | | +| `PreCommitVolumes` | map[string]map[string][WalletsVolume](../../models/shared/walletsvolume.md) | :heavy_minus_sign: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Timestamp` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Txid` | *int64* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/walletsubject.md b/docs/models/shared/walletsubject.md new file mode 100755 index 0000000..0cb03c8 --- /dev/null +++ b/docs/models/shared/walletsubject.md @@ -0,0 +1,10 @@ +# WalletSubject + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **string* | :heavy_minus_sign: | N/A | +| `Identifier` | *string* | :heavy_check_mark: | N/A | +| `Type` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletsvolume.md b/docs/models/shared/walletsvolume.md new file mode 100755 index 0000000..7941e4b --- /dev/null +++ b/docs/models/shared/walletsvolume.md @@ -0,0 +1,10 @@ +# WalletsVolume + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | *int64* | :heavy_check_mark: | N/A | +| `Input` | *int64* | :heavy_check_mark: | N/A | +| `Output` | *int64* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletwithbalances.md b/docs/models/shared/walletwithbalances.md new file mode 100755 index 0000000..12c57e0 --- /dev/null +++ b/docs/models/shared/walletwithbalances.md @@ -0,0 +1,13 @@ +# WalletWithBalances + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Balances` | [WalletWithBalancesBalances](../../models/shared/walletwithbalancesbalances.md) | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | The unique ID of the wallet. | +| `Ledger` | *string* | :heavy_check_mark: | N/A | +| `Metadata` | map[string]*interface{}* | :heavy_check_mark: | Metadata associated with the wallet. | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletwithbalancesbalances.md b/docs/models/shared/walletwithbalancesbalances.md new file mode 100755 index 0000000..b3ceb39 --- /dev/null +++ b/docs/models/shared/walletwithbalancesbalances.md @@ -0,0 +1,8 @@ +# WalletWithBalancesBalances + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Main` | [AssetHolder](../../models/shared/assetholder.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/webhooksconfig.md b/docs/models/shared/webhooksconfig.md new file mode 100755 index 0000000..bd0e2a1 --- /dev/null +++ b/docs/models/shared/webhooksconfig.md @@ -0,0 +1,14 @@ +# WebhooksConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Active` | **bool* | :heavy_minus_sign: | N/A | true | +| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `Endpoint` | **string* | :heavy_minus_sign: | N/A | https://example.com | +| `EventTypes` | []*string* | :heavy_minus_sign: | N/A | | +| `ID` | **string* | :heavy_minus_sign: | N/A | | +| `Secret` | **string* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/wiseconfig.md b/docs/models/shared/wiseconfig.md new file mode 100755 index 0000000..634a613 --- /dev/null +++ b/docs/models/shared/wiseconfig.md @@ -0,0 +1,8 @@ +# WiseConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `APIKey` | *string* | :heavy_check_mark: | N/A | XXX | \ No newline at end of file diff --git a/docs/models/shared/workflow.md b/docs/models/shared/workflow.md new file mode 100755 index 0000000..f3b25d0 --- /dev/null +++ b/docs/models/shared/workflow.md @@ -0,0 +1,11 @@ +# Workflow + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Config` | [WorkflowConfig](../../models/shared/workflowconfig.md) | :heavy_check_mark: | N/A | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workflowconfig.md b/docs/models/shared/workflowconfig.md new file mode 100755 index 0000000..f6255dc --- /dev/null +++ b/docs/models/shared/workflowconfig.md @@ -0,0 +1,8 @@ +# WorkflowConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Stages` | []map[string]*interface{}* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workflowoccurrence.md b/docs/models/shared/workflowoccurrence.md new file mode 100755 index 0000000..9170dce --- /dev/null +++ b/docs/models/shared/workflowoccurrence.md @@ -0,0 +1,12 @@ +# WorkflowOccurrence + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Statuses` | [][StageStatus](../../models/shared/stagestatus.md) | :heavy_check_mark: | N/A | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `WorkflowID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md new file mode 100755 index 0000000..474a10f --- /dev/null +++ b/docs/sdks/accounts/README.md @@ -0,0 +1,233 @@ +# Accounts + +## Overview + +Everything related to Accounts + +### Available Operations + +* [AddMetadataToAccount](#addmetadatatoaccount) - Add metadata to an account +* [CountAccounts](#countaccounts) - Count the accounts from a ledger +* [GetAccount](#getaccount) - Get account by its address +* [ListAccounts](#listaccounts) - List accounts from a ledger + +## AddMetadataToAccount + +Add metadata to an account + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Accounts.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ + RequestBody: map[string]interface{}{ + "corrupti": "provident", + }, + Address: "users:001", + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.AddMetadataToAccountRequest](../../models/operations/addmetadatatoaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.AddMetadataToAccountResponse](../../models/operations/addmetadatatoaccountresponse.md), error** + + +## CountAccounts + +Count the accounts from a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Accounts.CountAccounts(ctx, operations.CountAccountsRequest{ + Address: formancegosdk.String("users:.+"), + Ledger: "ledger001", + Metadata: &operations.CountAccountsMetadata{}, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CountAccountsRequest](../../models/operations/countaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CountAccountsResponse](../../models/operations/countaccountsresponse.md), error** + + +## GetAccount + +Get account by its address + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Accounts.GetAccount(ctx, operations.GetAccountRequest{ + Address: "users:001", + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetAccountRequest](../../models/operations/getaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetAccountResponse](../../models/operations/getaccountresponse.md), error** + + +## ListAccounts + +List accounts from a ledger, sorted by address in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Accounts.ListAccounts(ctx, operations.ListAccountsRequest{ + Address: formancegosdk.String("users:.+"), + After: formancegosdk.String("users:003"), + Balance: formancegosdk.Int64(2400), + BalanceOperator: operations.ListAccountsBalanceOperatorGte.ToPointer(), + BalanceOperatorDeprecated: operations.ListAccountsBalanceOperatorGte.ToPointer(), + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + Metadata: &operations.ListAccountsMetadata{}, + PageSize: formancegosdk.Int64(715190), + PageSizeDeprecated: formancegosdk.Int64(844266), + PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountsCursorResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListAccountsRequest](../../models/operations/listaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListAccountsResponse](../../models/operations/listaccountsresponse.md), error** + diff --git a/docs/sdks/balances/README.md b/docs/sdks/balances/README.md new file mode 100755 index 0000000..fea5930 --- /dev/null +++ b/docs/sdks/balances/README.md @@ -0,0 +1,117 @@ +# Balances + +## Overview + +Everything related to Balances + +### Available Operations + +* [GetBalances](#getbalances) - Get the balances from a ledger's account +* [GetBalancesAggregated](#getbalancesaggregated) - Get the aggregated balances from selected accounts + +## GetBalances + +Get the balances from a ledger's account + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Balances.GetBalances(ctx, operations.GetBalancesRequest{ + Address: formancegosdk.String("users:001"), + After: formancegosdk.String("users:003"), + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + if err != nil { + log.Fatal(err) + } + + if res.BalancesCursorResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetBalancesRequest](../../models/operations/getbalancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetBalancesResponse](../../models/operations/getbalancesresponse.md), error** + + +## GetBalancesAggregated + +Get the aggregated balances from selected accounts + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Balances.GetBalancesAggregated(ctx, operations.GetBalancesAggregatedRequest{ + Address: formancegosdk.String("users:001"), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.AggregateBalancesResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetBalancesAggregatedRequest](../../models/operations/getbalancesaggregatedrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetBalancesAggregatedResponse](../../models/operations/getbalancesaggregatedresponse.md), error** + diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md new file mode 100755 index 0000000..953c765 --- /dev/null +++ b/docs/sdks/clients/README.md @@ -0,0 +1,507 @@ +# Clients + +## Overview + +Everything related to Clients + +### Available Operations + +* [AddScopeToClient](#addscopetoclient) - Add scope to client +* [CreateClient](#createclient) - Create client +* [CreateSecret](#createsecret) - Add a secret to a client +* [DeleteClient](#deleteclient) - Delete client +* [DeleteScopeFromClient](#deletescopefromclient) - Delete scope from client +* [DeleteSecret](#deletesecret) - Delete a secret from a client +* [ListClients](#listclients) - List clients +* [ReadClient](#readclient) - Read client +* [UpdateClient](#updateclient) - Update client + +## AddScopeToClient + +Add scope to client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.AddScopeToClient(ctx, operations.AddScopeToClientRequest{ + ClientID: "unde", + ScopeID: "nulla", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.AddScopeToClientRequest](../../models/operations/addscopetoclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.AddScopeToClientResponse](../../models/operations/addscopetoclientresponse.md), error** + + +## CreateClient + +Create client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.CreateClient(ctx, shared.CreateClientRequest{ + Description: formancegosdk.String("corrupti"), + Metadata: map[string]interface{}{ + "illum": "vel", + }, + Name: "Doug Hoppe", + PostLogoutRedirectUris: []string{ + "debitis", + }, + Public: formancegosdk.Bool(false), + RedirectUris: []string{ + "ipsa", + }, + Trusted: formancegosdk.Bool(false), + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateClientResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.CreateClientRequest](../../models/shared/createclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateClientResponse](../../models/operations/createclientresponse.md), error** + + +## CreateSecret + +Add a secret to a client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.CreateSecret(ctx, operations.CreateSecretRequest{ + CreateSecretRequest: &shared.CreateSecretRequest{ + Metadata: map[string]interface{}{ + "delectus": "tempora", + }, + Name: "Minnie Schiller", + }, + ClientID: "iusto", + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateSecretResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateSecretRequest](../../models/operations/createsecretrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateSecretResponse](../../models/operations/createsecretresponse.md), error** + + +## DeleteClient + +Delete client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.DeleteClient(ctx, operations.DeleteClientRequest{ + ClientID: "excepturi", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteClientRequest](../../models/operations/deleteclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteClientResponse](../../models/operations/deleteclientresponse.md), error** + + +## DeleteScopeFromClient + +Delete scope from client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.DeleteScopeFromClient(ctx, operations.DeleteScopeFromClientRequest{ + ClientID: "nisi", + ScopeID: "recusandae", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteScopeFromClientRequest](../../models/operations/deletescopefromclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteScopeFromClientResponse](../../models/operations/deletescopefromclientresponse.md), error** + + +## DeleteSecret + +Delete a secret from a client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.DeleteSecret(ctx, operations.DeleteSecretRequest{ + ClientID: "temporibus", + SecretID: "ab", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteSecretRequest](../../models/operations/deletesecretrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteSecretResponse](../../models/operations/deletesecretresponse.md), error** + + +## ListClients + +List clients + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.ListClients(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ListClientsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListClientsResponse](../../models/operations/listclientsresponse.md), error** + + +## ReadClient + +Read client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.ReadClient(ctx, operations.ReadClientRequest{ + ClientID: "quis", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReadClientResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ReadClientRequest](../../models/operations/readclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadClientResponse](../../models/operations/readclientresponse.md), error** + + +## UpdateClient + +Update client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Clients.UpdateClient(ctx, operations.UpdateClientRequest{ + UpdateClientRequest: &shared.UpdateClientRequest{ + Description: formancegosdk.String("veritatis"), + Metadata: map[string]interface{}{ + "deserunt": "perferendis", + }, + Name: "Estelle Will", + PostLogoutRedirectUris: []string{ + "at", + }, + Public: formancegosdk.Bool(false), + RedirectUris: []string{ + "at", + }, + Trusted: formancegosdk.Bool(false), + }, + ClientID: "maiores", + }) + if err != nil { + log.Fatal(err) + } + + if res.UpdateClientResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UpdateClientRequest](../../models/operations/updateclientrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.UpdateClientResponse](../../models/operations/updateclientresponse.md), error** + diff --git a/docs/sdks/formance/README.md b/docs/sdks/formance/README.md new file mode 100755 index 0000000..829eae4 --- /dev/null +++ b/docs/sdks/formance/README.md @@ -0,0 +1,163 @@ +# Formance SDK + +## Overview + +Formance Stack API: Open, modular foundation for unique payments flows + +# Introduction +This API is documented in **OpenAPI format**. + +# Authentication +Formance Stack offers one forms of authentication: + - OAuth2 +OAuth2 - an open protocol to allow secure authorization in a simple +and standard method from web, mobile and desktop applications. + + + +### Available Operations + +* [GetServerInfo](#getserverinfo) - Get server info +* [PaymentsgetServerInfo](#paymentsgetserverinfo) - Get server info +* [SearchgetServerInfo](#searchgetserverinfo) - Get server info + +## GetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Formance.GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerInfoResponse](../../models/operations/getserverinforesponse.md), error** + + +## PaymentsgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Formance.PaymentsgetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.PaymentsgetServerInfoResponse](../../models/operations/paymentsgetserverinforesponse.md), error** + + +## SearchgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Formance.SearchgetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.SearchgetServerInfoResponse](../../models/operations/searchgetserverinforesponse.md), error** + diff --git a/docs/sdks/ledger/README.md b/docs/sdks/ledger/README.md new file mode 100755 index 0000000..b19381c --- /dev/null +++ b/docs/sdks/ledger/README.md @@ -0,0 +1,60 @@ +# Ledger + +## Overview + +Everything related to Ledger + +### Available Operations + +* [GetLedgerInfo](#getledgerinfo) - Get information about a ledger + +## GetLedgerInfo + +Get information about a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Ledger.GetLedgerInfo(ctx, operations.GetLedgerInfoRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.LedgerInfoResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetLedgerInfoRequest](../../models/operations/getledgerinforequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetLedgerInfoResponse](../../models/operations/getledgerinforesponse.md), error** + diff --git a/docs/sdks/logs/README.md b/docs/sdks/logs/README.md new file mode 100755 index 0000000..08f6657 --- /dev/null +++ b/docs/sdks/logs/README.md @@ -0,0 +1,70 @@ +# Logs + +## Overview + +Everything related to Logs + +### Available Operations + +* [ListLogs](#listlogs) - List the logs from a ledger + +## ListLogs + +List the logs from a ledger, sorted by ID in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Logs.ListLogs(ctx, operations.ListLogsRequest{ + After: formancegosdk.String("1234"), + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + EndTime: types.MustTimeFromString("2022-03-15T07:22:15.330Z"), + EndTimeDeprecated: types.MustTimeFromString("2021-08-13T16:19:19.906Z"), + Ledger: "ledger001", + PageSize: formancegosdk.Int64(520478), + PageSizeDeprecated: formancegosdk.Int64(780529), + PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + StartTime: types.MustTimeFromString("2022-10-06T15:49:54.663Z"), + StartTimeDeprecated: types.MustTimeFromString("2021-09-20T20:35:01.256Z"), + }) + if err != nil { + log.Fatal(err) + } + + if res.LogsCursorResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListLogsRequest](../../models/operations/listlogsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListLogsResponse](../../models/operations/listlogsresponse.md), error** + diff --git a/docs/sdks/mapping/README.md b/docs/sdks/mapping/README.md new file mode 100755 index 0000000..20c3c40 --- /dev/null +++ b/docs/sdks/mapping/README.md @@ -0,0 +1,120 @@ +# Mapping + +## Overview + +Everything related to Mapping + +### Available Operations + +* [GetMapping](#getmapping) - Get the mapping of a ledger +* [UpdateMapping](#updatemapping) - Update the mapping of a ledger + +## GetMapping + +Get the mapping of a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Mapping.GetMapping(ctx, operations.GetMappingRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.MappingResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetMappingRequest](../../models/operations/getmappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetMappingResponse](../../models/operations/getmappingresponse.md), error** + + +## UpdateMapping + +Update the mapping of a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Mapping.UpdateMapping(ctx, operations.UpdateMappingRequest{ + Mapping: &shared.Mapping{ + Contracts: []shared.Contract{ + shared.Contract{ + Account: formancegosdk.String("users:001"), + Expr: shared.ContractExpr{}, + }, + }, + }, + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.MappingResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UpdateMappingRequest](../../models/operations/updatemappingrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.UpdateMappingResponse](../../models/operations/updatemappingresponse.md), error** + diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md new file mode 100755 index 0000000..8fe0b50 --- /dev/null +++ b/docs/sdks/orchestration/README.md @@ -0,0 +1,372 @@ +# Orchestration + +## Overview + +Everything related to Orchestration + +### Available Operations + +* [CreateWorkflow](#createworkflow) - Create workflow +* [GetFlow](#getflow) - Get a flow by id +* [GetWorkflowOccurrence](#getworkflowoccurrence) - Get a workflow occurrence by id +* [ListFlows](#listflows) - List registered flows +* [ListRuns](#listruns) - List occurrences of a workflow +* [OrchestrationgetServerInfo](#orchestrationgetserverinfo) - Get server info +* [RunWorkflow](#runworkflow) - Run workflow + +## CreateWorkflow + +Create a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.CreateWorkflow(ctx, shared.CreateWorkflowRequest{ + Stages: []map[string]interface{}{ + map[string]interface{}{ + "occaecati": "fugit", + }, + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateWorkflowResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.CreateWorkflowRequest](../../models/shared/createworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateWorkflowResponse](../../models/operations/createworkflowresponse.md), error** + + +## GetFlow + +Get a flow by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.GetFlow(ctx, operations.GetFlowRequest{ + FlowID: "deleniti", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWorkflowResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetFlowRequest](../../models/operations/getflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetFlowResponse](../../models/operations/getflowresponse.md), error** + + +## GetWorkflowOccurrence + +Get a workflow occurrence by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.GetWorkflowOccurrence(ctx, operations.GetWorkflowOccurrenceRequest{ + FlowID: "hic", + RunID: "optio", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWorkflowOccurrenceResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetWorkflowOccurrenceRequest](../../models/operations/getworkflowoccurrencerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetWorkflowOccurrenceResponse](../../models/operations/getworkflowoccurrenceresponse.md), error** + + +## ListFlows + +List registered flows + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.ListFlows(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ListWorkflowsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListFlowsResponse](../../models/operations/listflowsresponse.md), error** + + +## ListRuns + +List occurrences of a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.ListRuns(ctx, operations.ListRunsRequest{ + FlowID: "totam", + }) + if err != nil { + log.Fatal(err) + } + + if res.ListRunsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListRunsRequest](../../models/operations/listrunsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListRunsResponse](../../models/operations/listrunsresponse.md), error** + + +## OrchestrationgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.OrchestrationgetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.OrchestrationgetServerInfoResponse](../../models/operations/orchestrationgetserverinforesponse.md), error** + + +## RunWorkflow + +Run workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{ + RequestBody: map[string]string{ + "beatae": "commodi", + }, + FlowID: "molestiae", + Wait: formancegosdk.Bool(false), + }) + if err != nil { + log.Fatal(err) + } + + if res.RunWorkflowResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.RunWorkflowRequest](../../models/operations/runworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.RunWorkflowResponse](../../models/operations/runworkflowresponse.md), error** + diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md new file mode 100755 index 0000000..81af9d6 --- /dev/null +++ b/docs/sdks/payments/README.md @@ -0,0 +1,640 @@ +# Payments + +## Overview + +Everything related to Payments + +### Available Operations + +* [ConnectorsStripeTransfer](#connectorsstripetransfer) - Transfer funds between Stripe accounts +* [GetConnectorTask](#getconnectortask) - Read a specific task of the connector +* [GetPayment](#getpayment) - Get a payment +* [InstallConnector](#installconnector) - Install a connector +* [ListAllConnectors](#listallconnectors) - List all installed connectors +* [ListConfigsAvailableConnectors](#listconfigsavailableconnectors) - List the configs of each available connector +* [ListConnectorTasks](#listconnectortasks) - List tasks from a connector +* [ListPayments](#listpayments) - List payments +* [PaymentslistAccounts](#paymentslistaccounts) - List accounts +* [ReadConnectorConfig](#readconnectorconfig) - Read the config of a connector +* [ResetConnector](#resetconnector) - Reset a connector +* [UninstallConnector](#uninstallconnector) - Uninstall a connector + +## ConnectorsStripeTransfer + +Execute a transfer between two Stripe accounts. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ConnectorsStripeTransfer(ctx, shared.StripeTransferRequest{ + Amount: formancegosdk.Int64(100), + Asset: formancegosdk.String("USD"), + Destination: formancegosdk.String("acct_1Gqj58KZcSIg2N2q"), + Metadata: &shared.StripeTransferRequestMetadata{}, + }) + if err != nil { + log.Fatal(err) + } + + if res.StripeTransferResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.StripeTransferRequest](../../models/shared/stripetransferrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ConnectorsStripeTransferResponse](../../models/operations/connectorsstripetransferresponse.md), error** + + +## GetConnectorTask + +Get a specific task associated to the connector. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.GetConnectorTask(ctx, operations.GetConnectorTaskRequest{ + Connector: shared.ConnectorDummyPay, + TaskID: "qui", + }) + if err != nil { + log.Fatal(err) + } + + if res.TaskResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetConnectorTaskRequest](../../models/operations/getconnectortaskrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetConnectorTaskResponse](../../models/operations/getconnectortaskresponse.md), error** + + +## GetPayment + +Get a payment + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.GetPayment(ctx, operations.GetPaymentRequest{ + PaymentID: "impedit", + }) + if err != nil { + log.Fatal(err) + } + + if res.PaymentResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetPaymentRequest](../../models/operations/getpaymentrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetPaymentResponse](../../models/operations/getpaymentresponse.md), error** + + +## InstallConnector + +Install a connector by its name and config. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.InstallConnector(ctx, operations.InstallConnectorRequest{ + ConnectorConfig: shared.ConnectorConfig{}, + Connector: shared.ConnectorCurrencyCloud, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.InstallConnectorRequest](../../models/operations/installconnectorrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.InstallConnectorResponse](../../models/operations/installconnectorresponse.md), error** + + +## ListAllConnectors + +List all installed connectors. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ListAllConnectors(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ConnectorsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListAllConnectorsResponse](../../models/operations/listallconnectorsresponse.md), error** + + +## ListConfigsAvailableConnectors + +List the configs of each available connector. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ListConfigsAvailableConnectors(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ConnectorsConfigsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListConfigsAvailableConnectorsResponse](../../models/operations/listconfigsavailableconnectorsresponse.md), error** + + +## ListConnectorTasks + +List all tasks associated with this connector. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ListConnectorTasks(ctx, operations.ListConnectorTasksRequest{ + Connector: shared.ConnectorWise, + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + PageSize: formancegosdk.Int64(216550), + }) + if err != nil { + log.Fatal(err) + } + + if res.TasksCursor != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListConnectorTasksRequest](../../models/operations/listconnectortasksrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListConnectorTasksResponse](../../models/operations/listconnectortasksresponse.md), error** + + +## ListPayments + +List payments + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ListPayments(ctx, operations.ListPaymentsRequest{ + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + PageSize: formancegosdk.Int64(568434), + Sort: []string{ + "aspernatur", + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.PaymentsCursor != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListPaymentsRequest](../../models/operations/listpaymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListPaymentsResponse](../../models/operations/listpaymentsresponse.md), error** + + +## PaymentslistAccounts + +List accounts + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.PaymentslistAccounts(ctx, operations.PaymentslistAccountsRequest{ + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + PageSize: formancegosdk.Int64(18789), + Sort: []string{ + "ad", + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountsCursor != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.PaymentslistAccountsRequest](../../models/operations/paymentslistaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.PaymentslistAccountsResponse](../../models/operations/paymentslistaccountsresponse.md), error** + + +## ReadConnectorConfig + +Read connector config + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ReadConnectorConfig(ctx, operations.ReadConnectorConfigRequest{ + Connector: shared.ConnectorModulr, + }) + if err != nil { + log.Fatal(err) + } + + if res.ConnectorConfigResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ReadConnectorConfigRequest](../../models/operations/readconnectorconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadConnectorConfigResponse](../../models/operations/readconnectorconfigresponse.md), error** + + +## ResetConnector + +Reset a connector by its name. +It will remove the connector and ALL PAYMENTS generated with it. + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.ResetConnector(ctx, operations.ResetConnectorRequest{ + Connector: shared.ConnectorStripe, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ResetConnectorRequest](../../models/operations/resetconnectorrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ResetConnectorResponse](../../models/operations/resetconnectorresponse.md), error** + + +## UninstallConnector + +Uninstall a connector by its name. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Payments.UninstallConnector(ctx, operations.UninstallConnectorRequest{ + Connector: shared.ConnectorModulr, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UninstallConnectorRequest](../../models/operations/uninstallconnectorrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.UninstallConnectorResponse](../../models/operations/uninstallconnectorresponse.md), error** + diff --git a/docs/sdks/scopes/README.md b/docs/sdks/scopes/README.md new file mode 100755 index 0000000..f53f4f1 --- /dev/null +++ b/docs/sdks/scopes/README.md @@ -0,0 +1,378 @@ +# Scopes + +## Overview + +Everything related to Scopes + +### Available Operations + +* [AddTransientScope](#addtransientscope) - Add a transient scope to a scope +* [CreateScope](#createscope) - Create scope +* [DeleteScope](#deletescope) - Delete scope +* [DeleteTransientScope](#deletetransientscope) - Delete a transient scope from a scope +* [ListScopes](#listscopes) - List scopes +* [ReadScope](#readscope) - Read scope +* [UpdateScope](#updatescope) - Update scope + +## AddTransientScope + +Add a transient scope to a scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.AddTransientScope(ctx, operations.AddTransientScopeRequest{ + ScopeID: "dolor", + TransientScopeID: "natus", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.AddTransientScopeRequest](../../models/operations/addtransientscoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.AddTransientScopeResponse](../../models/operations/addtransientscoperesponse.md), error** + + +## CreateScope + +Create scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.CreateScope(ctx, shared.CreateScopeRequest{ + Label: "laboriosam", + Metadata: map[string]interface{}{ + "hic": "saepe", + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateScopeResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.CreateScopeRequest](../../models/shared/createscoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateScopeResponse](../../models/operations/createscoperesponse.md), error** + + +## DeleteScope + +Delete scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.DeleteScope(ctx, operations.DeleteScopeRequest{ + ScopeID: "fuga", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteScopeRequest](../../models/operations/deletescoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteScopeResponse](../../models/operations/deletescoperesponse.md), error** + + +## DeleteTransientScope + +Delete a transient scope from a scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.DeleteTransientScope(ctx, operations.DeleteTransientScopeRequest{ + ScopeID: "in", + TransientScopeID: "corporis", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteTransientScopeRequest](../../models/operations/deletetransientscoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteTransientScopeResponse](../../models/operations/deletetransientscoperesponse.md), error** + + +## ListScopes + +List Scopes + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.ListScopes(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ListScopesResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListScopesResponse](../../models/operations/listscopesresponse.md), error** + + +## ReadScope + +Read scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.ReadScope(ctx, operations.ReadScopeRequest{ + ScopeID: "iste", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReadScopeResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ReadScopeRequest](../../models/operations/readscoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadScopeResponse](../../models/operations/readscoperesponse.md), error** + + +## UpdateScope + +Update scope + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Scopes.UpdateScope(ctx, operations.UpdateScopeRequest{ + UpdateScopeRequest: &shared.UpdateScopeRequest{ + Label: "iure", + Metadata: map[string]interface{}{ + "saepe": "quidem", + }, + }, + ScopeID: "architecto", + }) + if err != nil { + log.Fatal(err) + } + + if res.UpdateScopeResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UpdateScopeRequest](../../models/operations/updatescoperequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.UpdateScopeResponse](../../models/operations/updatescoperesponse.md), error** + diff --git a/docs/sdks/script/README.md b/docs/sdks/script/README.md new file mode 100755 index 0000000..b25715c --- /dev/null +++ b/docs/sdks/script/README.md @@ -0,0 +1,79 @@ +# Script + +## Overview + +Everything related to Script + +### Available Operations + +* [~~RunScript~~](#runscript) - Execute a Numscript :warning: **Deprecated** + +## ~~RunScript~~ + +This route is deprecated, and has been merged into `POST /{ledger}/transactions`. + + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Script.RunScript(ctx, operations.RunScriptRequest{ + Script: shared.Script{ + Metadata: map[string]interface{}{ + "ipsa": "reiciendis", + }, + Plain: "vars { + account $user + } + send [COIN 10] ( + source = @world + destination = $user + ) + ", + Reference: formancegosdk.String("order_1234"), + Vars: &shared.ScriptVars{}, + }, + Ledger: "ledger001", + Preview: formancegosdk.Bool(true), + }) + if err != nil { + log.Fatal(err) + } + + if res.ScriptResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.RunScriptRequest](../../models/operations/runscriptrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.RunScriptResponse](../../models/operations/runscriptresponse.md), error** + diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md new file mode 100755 index 0000000..7b00ef6 --- /dev/null +++ b/docs/sdks/search/README.md @@ -0,0 +1,72 @@ +# Search + +## Overview + +Everything related to Search + +### Available Operations + +* [Search](#search) - Search + +## Search + +ElasticSearch query engine + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Search.Search(ctx, shared.Query{ + After: []string{ + "users:002", + }, + Cursor: formancegosdk.String("YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="), + Ledgers: []string{ + "quickstart", + }, + PageSize: formancegosdk.Int64(666767), + Policy: formancegosdk.String("OR"), + Sort: formancegosdk.String("txid:asc"), + Target: formancegosdk.String("mollitia"), + Terms: []string{ + "destination=central_bank1", + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.Response != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.Query](../../models/shared/query.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.SearchResponse](../../models/operations/searchresponse.md), error** + diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md new file mode 100755 index 0000000..9615c3b --- /dev/null +++ b/docs/sdks/server/README.md @@ -0,0 +1,56 @@ +# Server + +## Overview + +Everything related to Server + +### Available Operations + +* [GetInfo](#getinfo) - Show server information + +## GetInfo + +Show server information + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Server.GetInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ConfigInfoResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetInfoResponse](../../models/operations/getinforesponse.md), error** + diff --git a/docs/sdks/stats/README.md b/docs/sdks/stats/README.md new file mode 100755 index 0000000..9638d58 --- /dev/null +++ b/docs/sdks/stats/README.md @@ -0,0 +1,61 @@ +# Stats + +## Overview + +Everything related to Stats + +### Available Operations + +* [ReadStats](#readstats) - Get statistics from a ledger + +## ReadStats + +Get statistics from a ledger. (aggregate metrics on accounts and transactions) + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Stats.ReadStats(ctx, operations.ReadStatsRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ReadStatsRequest](../../models/operations/readstatsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadStatsResponse](../../models/operations/readstatsresponse.md), error** + diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md new file mode 100755 index 0000000..e6f36aa --- /dev/null +++ b/docs/sdks/transactions/README.md @@ -0,0 +1,451 @@ +# Transactions + +## Overview + +Everything related to Transactions + +### Available Operations + +* [CreateTransactions](#createtransactions) - Create a new batch of transactions to a ledger +* [AddMetadataOnTransaction](#addmetadataontransaction) - Set the metadata of a transaction by its ID +* [CountTransactions](#counttransactions) - Count the transactions from a ledger +* [CreateTransaction](#createtransaction) - Create a new transaction to a ledger +* [GetTransaction](#gettransaction) - Get transaction from a ledger by its ID +* [ListTransactions](#listtransactions) - List transactions from a ledger +* [RevertTransaction](#reverttransaction) - Revert a ledger transaction by its ID + +## CreateTransactions + +Create a new batch of transactions to a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.CreateTransactions(ctx, operations.CreateTransactionsRequest{ + Transactions: shared.Transactions{ + Transactions: []shared.TransactionData{ + shared.TransactionData{ + Metadata: map[string]interface{}{ + "laborum": "dolores", + }, + Postings: []shared.Posting{ + shared.Posting{ + Amount: 100, + Asset: "COIN", + Destination: "users:002", + Source: "users:001", + }, + }, + Reference: formancegosdk.String("ref:001"), + Timestamp: types.MustTimeFromString("2022-08-23T06:35:12.519Z"), + }, + }, + }, + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.TransactionsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateTransactionsRequest](../../models/operations/createtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateTransactionsResponse](../../models/operations/createtransactionsresponse.md), error** + + +## AddMetadataOnTransaction + +Set the metadata of a transaction by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ + RequestBody: map[string]interface{}{ + "explicabo": "nobis", + }, + Ledger: "ledger001", + Txid: 1234, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.AddMetadataOnTransactionRequest](../../models/operations/addmetadataontransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.AddMetadataOnTransactionResponse](../../models/operations/addmetadataontransactionresponse.md), error** + + +## CountTransactions + +Count the transactions from a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.CountTransactions(ctx, operations.CountTransactionsRequest{ + Account: formancegosdk.String("users:001"), + Destination: formancegosdk.String("users:001"), + EndTime: types.MustTimeFromString("2022-05-24T03:24:11.703Z"), + EndTimeDeprecated: types.MustTimeFromString("2022-09-04T08:35:09.957Z"), + Ledger: "ledger001", + Metadata: &operations.CountTransactionsMetadata{}, + Reference: formancegosdk.String("ref:001"), + Source: formancegosdk.String("users:001"), + StartTime: types.MustTimeFromString("2022-12-03T22:47:10.600Z"), + StartTimeDeprecated: types.MustTimeFromString("2022-05-14T11:45:33.094Z"), + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CountTransactionsRequest](../../models/operations/counttransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CountTransactionsResponse](../../models/operations/counttransactionsresponse.md), error** + + +## CreateTransaction + +Create a new transaction to a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.CreateTransaction(ctx, operations.CreateTransactionRequest{ + PostTransaction: shared.PostTransaction{ + Metadata: map[string]interface{}{ + "doloribus": "sapiente", + }, + Postings: []shared.Posting{ + shared.Posting{ + Amount: 100, + Asset: "COIN", + Destination: "users:002", + Source: "users:001", + }, + }, + Reference: formancegosdk.String("ref:001"), + Script: &shared.PostTransactionScript{ + Plain: "vars { + account $user + } + send [COIN 10] ( + source = @world + destination = $user + ) + ", + Vars: &shared.PostTransactionScriptVars{}, + }, + Timestamp: types.MustTimeFromString("2022-05-07T17:33:24.154Z"), + }, + Ledger: "ledger001", + Preview: formancegosdk.Bool(true), + }) + if err != nil { + log.Fatal(err) + } + + if res.TransactionsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateTransactionRequest](../../models/operations/createtransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateTransactionResponse](../../models/operations/createtransactionresponse.md), error** + + +## GetTransaction + +Get transaction from a ledger by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.GetTransaction(ctx, operations.GetTransactionRequest{ + Ledger: "ledger001", + Txid: 1234, + }) + if err != nil { + log.Fatal(err) + } + + if res.TransactionResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetTransactionRequest](../../models/operations/gettransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetTransactionResponse](../../models/operations/gettransactionresponse.md), error** + + +## ListTransactions + +List transactions from a ledger, sorted by txid in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.ListTransactions(ctx, operations.ListTransactionsRequest{ + Account: formancegosdk.String("users:001"), + After: formancegosdk.String("1234"), + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Destination: formancegosdk.String("users:001"), + EndTime: types.MustTimeFromString("2022-05-14T04:53:02.888Z"), + EndTimeDeprecated: types.MustTimeFromString("2022-01-02T17:10:32.894Z"), + Ledger: "ledger001", + Metadata: &operations.ListTransactionsMetadata{}, + PageSize: formancegosdk.Int64(653108), + PageSizeDeprecated: formancegosdk.Int64(581850), + PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Reference: formancegosdk.String("ref:001"), + Source: formancegosdk.String("users:001"), + StartTime: types.MustTimeFromString("2022-08-02T18:07:51.623Z"), + StartTimeDeprecated: types.MustTimeFromString("2022-07-11T17:38:58.953Z"), + }) + if err != nil { + log.Fatal(err) + } + + if res.TransactionsCursorResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListTransactionsRequest](../../models/operations/listtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListTransactionsResponse](../../models/operations/listtransactionsresponse.md), error** + + +## RevertTransaction + +Revert a ledger transaction by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Transactions.RevertTransaction(ctx, operations.RevertTransactionRequest{ + Ledger: "ledger001", + Txid: 1234, + }) + if err != nil { + log.Fatal(err) + } + + if res.TransactionResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.RevertTransactionRequest](../../models/operations/reverttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.RevertTransactionResponse](../../models/operations/reverttransactionresponse.md), error** + diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md new file mode 100755 index 0000000..9ea2858 --- /dev/null +++ b/docs/sdks/users/README.md @@ -0,0 +1,108 @@ +# Users + +## Overview + +Everything related to Users + +### Available Operations + +* [ListUsers](#listusers) - List users +* [ReadUser](#readuser) - Read user + +## ListUsers + +List users + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Users.ListUsers(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ListUsersResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.ListUsersResponse](../../models/operations/listusersresponse.md), error** + + +## ReadUser + +Read user + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Users.ReadUser(ctx, operations.ReadUserRequest{ + UserID: "velit", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReadUserResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ReadUserRequest](../../models/operations/readuserrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadUserResponse](../../models/operations/readuserresponse.md), error** + diff --git a/docs/sdks/wallets/README.md b/docs/sdks/wallets/README.md new file mode 100755 index 0000000..f4b998d --- /dev/null +++ b/docs/sdks/wallets/README.md @@ -0,0 +1,834 @@ +# Wallets + +## Overview + +Everything related to Wallets + +### Available Operations + +* [ConfirmHold](#confirmhold) - Confirm a hold +* [CreateBalance](#createbalance) - Create a balance +* [CreateWallet](#createwallet) - Create a new wallet +* [CreditWallet](#creditwallet) - Credit a wallet +* [DebitWallet](#debitwallet) - Debit a wallet +* [GetBalance](#getbalance) - Get detailed balance +* [GetHold](#gethold) - Get a hold +* [GetHolds](#getholds) - Get all holds for a wallet +* [GetTransactions](#gettransactions) +* [GetWallet](#getwallet) - Get a wallet +* [ListBalances](#listbalances) - List balances of a wallet +* [ListWallets](#listwallets) - List all wallets +* [UpdateWallet](#updatewallet) - Update a wallet +* [VoidHold](#voidhold) - Cancel a hold +* [WalletsgetServerInfo](#walletsgetserverinfo) - Get server info + +## ConfirmHold + +Confirm a hold + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.ConfirmHold(ctx, operations.ConfirmHoldRequest{ + ConfirmHoldRequest: &shared.ConfirmHoldRequest{ + Amount: formancegosdk.Int64(100), + Final: formancegosdk.Bool(true), + }, + HoldID: "error", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ConfirmHoldRequest](../../models/operations/confirmholdrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ConfirmHoldResponse](../../models/operations/confirmholdresponse.md), error** + + +## CreateBalance + +Create a balance + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.CreateBalance(ctx, operations.CreateBalanceRequest{ + CreateBalanceRequest: &shared.CreateBalanceRequest{ + Name: "Beatrice Brown", + }, + ID: "52c3f5ad-019d-4a1f-be78-f097b0074f15", + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateBalanceResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateBalanceRequest](../../models/operations/createbalancerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateBalanceResponse](../../models/operations/createbalanceresponse.md), error** + + +## CreateWallet + +Create a new wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.CreateWallet(ctx, shared.CreateWalletRequest{ + Metadata: map[string]interface{}{ + "dolore": "iusto", + }, + Name: "Maryann Hamill", + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateWalletResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.CreateWalletRequest](../../models/shared/createwalletrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateWalletResponse](../../models/operations/createwalletresponse.md), error** + + +## CreditWallet + +Credit a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.CreditWallet(ctx, operations.CreditWalletRequest{ + CreditWalletRequest: &shared.CreditWalletRequest{ + Amount: shared.Monetary{ + Amount: 918236, + Asset: "quae", + }, + Balance: formancegosdk.String("ipsum"), + Metadata: map[string]interface{}{ + "quidem": "molestias", + }, + Reference: formancegosdk.String("excepturi"), + Sources: []shared.Subject{ + shared.Subject{}, + }, + }, + ID: "d488e1e9-1e45-40ad-aabd-44269802d502", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreditWalletRequest](../../models/operations/creditwalletrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreditWalletResponse](../../models/operations/creditwalletresponse.md), error** + + +## DebitWallet + +Debit a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.DebitWallet(ctx, operations.DebitWalletRequest{ + DebitWalletRequest: &shared.DebitWalletRequest{ + Amount: shared.Monetary{ + Amount: 677817, + Asset: "excepturi", + }, + Balances: []string{ + "tempora", + }, + Description: formancegosdk.String("facilis"), + Destination: &shared.Subject{}, + Metadata: map[string]interface{}{ + "tempore": "labore", + }, + Pending: formancegosdk.Bool(false), + }, + ID: "f63c969e-9a3e-4fa7-bdfb-14cd66ae395e", + }) + if err != nil { + log.Fatal(err) + } + + if res.DebitWalletResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DebitWalletRequest](../../models/operations/debitwalletrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DebitWalletResponse](../../models/operations/debitwalletresponse.md), error** + + +## GetBalance + +Get detailed balance + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.GetBalance(ctx, operations.GetBalanceRequest{ + BalanceName: "delectus", + ID: "b9ba88f3-a669-4970-b4ba-4469b6e21419", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetBalanceResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetBalanceRequest](../../models/operations/getbalancerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetBalanceResponse](../../models/operations/getbalanceresponse.md), error** + + +## GetHold + +Get a hold + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.GetHold(ctx, operations.GetHoldRequest{ + HoldID: "ullam", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetHoldResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetHoldRequest](../../models/operations/getholdrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetHoldResponse](../../models/operations/getholdresponse.md), error** + + +## GetHolds + +Get all holds for a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.GetHolds(ctx, operations.GetHoldsRequest{ + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Metadata: &operations.GetHoldsMetadata{}, + PageSize: formancegosdk.Int64(590873), + WalletID: formancegosdk.String("quos"), + }) + if err != nil { + log.Fatal(err) + } + + if res.GetHoldsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetHoldsRequest](../../models/operations/getholdsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetHoldsResponse](../../models/operations/getholdsresponse.md), error** + + +## GetTransactions + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.GetTransactions(ctx, operations.GetTransactionsRequest{ + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + PageSize: formancegosdk.Int64(574325), + WalletID: formancegosdk.String("accusantium"), + }) + if err != nil { + log.Fatal(err) + } + + if res.GetTransactionsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetTransactionsRequest](../../models/operations/gettransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetTransactionsResponse](../../models/operations/gettransactionsresponse.md), error** + + +## GetWallet + +Get a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.GetWallet(ctx, operations.GetWalletRequest{ + ID: "afa563e2-516f-4e4c-8b71-1e5b7fd2ed02", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWalletResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetWalletRequest](../../models/operations/getwalletrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetWalletResponse](../../models/operations/getwalletresponse.md), error** + + +## ListBalances + +List balances of a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.ListBalances(ctx, operations.ListBalancesRequest{ + ID: "8921cddc-6926-401f-b576-b0d5f0d30c5f", + }) + if err != nil { + log.Fatal(err) + } + + if res.ListBalancesResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListBalancesRequest](../../models/operations/listbalancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListBalancesResponse](../../models/operations/listbalancesresponse.md), error** + + +## ListWallets + +List all wallets + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.ListWallets(ctx, operations.ListWalletsRequest{ + Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Metadata: &operations.ListWalletsMetadata{}, + Name: formancegosdk.String("Robin D'Amore"), + PageSize: formancegosdk.Int64(489549), + }) + if err != nil { + log.Fatal(err) + } + + if res.ListWalletsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListWalletsRequest](../../models/operations/listwalletsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListWalletsResponse](../../models/operations/listwalletsresponse.md), error** + + +## UpdateWallet + +Update a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ + RequestBody: &operations.UpdateWalletRequestBody{ + Metadata: map[string]interface{}{ + "eaque": "quis", + }, + }, + ID: "3202c73d-5fe9-4b90-8289-09b3fe49a8d9", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.UpdateWalletRequest](../../models/operations/updatewalletrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.UpdateWalletResponse](../../models/operations/updatewalletresponse.md), error** + + +## VoidHold + +Cancel a hold + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.VoidHold(ctx, operations.VoidHoldRequest{ + HoldID: "nobis", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.VoidHoldRequest](../../models/operations/voidholdrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.VoidHoldResponse](../../models/operations/voidholdresponse.md), error** + + +## WalletsgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Wallets.WalletsgetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.WalletsgetServerInfoResponse](../../models/operations/walletsgetserverinforesponse.md), error** + diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md new file mode 100755 index 0000000..4f00fc2 --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,392 @@ +# Webhooks + +## Overview + +Everything related to Webhooks + +### Available Operations + +* [ActivateConfig](#activateconfig) - Activate one config +* [ChangeConfigSecret](#changeconfigsecret) - Change the signing secret of a config +* [DeactivateConfig](#deactivateconfig) - Deactivate one config +* [DeleteConfig](#deleteconfig) - Delete one config +* [GetManyConfigs](#getmanyconfigs) - Get many configs +* [InsertConfig](#insertconfig) - Insert a new config +* [TestConfig](#testconfig) - Test one config + +## ActivateConfig + +Activate a webhooks config by ID, to start receiving webhooks to its endpoint. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.ActivateConfig(ctx, operations.ActivateConfigRequest{ + ID: "4997257d-dfb6-445b-929c-cbe2ab182818", + }) + if err != nil { + log.Fatal(err) + } + + if res.ConfigResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ActivateConfigRequest](../../models/operations/activateconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ActivateConfigResponse](../../models/operations/activateconfigresponse.md), error** + + +## ChangeConfigSecret + +Change the signing secret of the endpoint of a webhooks config. + +If not passed or empty, a secret is automatically generated. +The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding) + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.ChangeConfigSecret(ctx, operations.ChangeConfigSecretRequest{ + ConfigChangeSecret: &shared.ConfigChangeSecret{ + Secret: formancegosdk.String("V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"), + }, + ID: "4997257d-dfb6-445b-929c-cbe2ab182818", + }) + if err != nil { + log.Fatal(err) + } + + if res.ConfigResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ChangeConfigSecretRequest](../../models/operations/changeconfigsecretrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ChangeConfigSecretResponse](../../models/operations/changeconfigsecretresponse.md), error** + + +## DeactivateConfig + +Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.DeactivateConfig(ctx, operations.DeactivateConfigRequest{ + ID: "4997257d-dfb6-445b-929c-cbe2ab182818", + }) + if err != nil { + log.Fatal(err) + } + + if res.ConfigResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeactivateConfigRequest](../../models/operations/deactivateconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeactivateConfigResponse](../../models/operations/deactivateconfigresponse.md), error** + + +## DeleteConfig + +Delete a webhooks config by ID. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.DeleteConfig(ctx, operations.DeleteConfigRequest{ + ID: "4997257d-dfb6-445b-929c-cbe2ab182818", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.DeleteConfigRequest](../../models/operations/deleteconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteConfigResponse](../../models/operations/deleteconfigresponse.md), error** + + +## GetManyConfigs + +Sorted by updated date descending + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.GetManyConfigs(ctx, operations.GetManyConfigsRequest{ + Endpoint: formancegosdk.String("https://example.com"), + ID: formancegosdk.String("4997257d-dfb6-445b-929c-cbe2ab182818"), + }) + if err != nil { + log.Fatal(err) + } + + if res.ConfigsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetManyConfigsRequest](../../models/operations/getmanyconfigsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetManyConfigsResponse](../../models/operations/getmanyconfigsresponse.md), error** + + +## InsertConfig + +Insert a new webhooks config. + +The endpoint should be a valid https URL and be unique. + +The secret is the endpoint's verification secret. +If not passed or empty, a secret is automatically generated. +The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding) + +All eventTypes are converted to lower-case when inserted. + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.InsertConfig(ctx, shared.ConfigUser{ + Endpoint: "https://example.com", + EventTypes: []string{ + "TYPE1", + }, + Secret: formancegosdk.String("V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"), + }) + if err != nil { + log.Fatal(err) + } + + if res.ConfigResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [shared.ConfigUser](../../models/shared/configuser.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.InsertConfigResponse](../../models/operations/insertconfigresponse.md), error** + + +## TestConfig + +Test a config by sending a webhook to its endpoint. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(shared.Security{ + Authorization: "", + }), + ) + + ctx := context.Background() + res, err := s.Webhooks.TestConfig(ctx, operations.TestConfigRequest{ + ID: "4997257d-dfb6-445b-929c-cbe2ab182818", + }) + if err != nil { + log.Fatal(err) + } + + if res.AttemptResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.TestConfigRequest](../../models/operations/testconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.TestConfigResponse](../../models/operations/testconfigresponse.md), error** + diff --git a/files.gen b/files.gen index e443061..4a633f7 100755 --- a/files.gen +++ b/files.gen @@ -18,10 +18,16 @@ webhooks.go formance.go go.mod go.sum +pkg/models/sdkerrors/sdkerror.go +pkg/types/bigint.go pkg/types/date.go +pkg/types/datetime.go +pkg/types/decimal.go +pkg/types/pointers.go pkg/utils/contenttype.go pkg/utils/form.go pkg/utils/headers.go +pkg/utils/json.go pkg/utils/pathparams.go pkg/utils/queryparams.go pkg/utils/requestbody.go @@ -112,7 +118,7 @@ pkg/models/operations/getserverinfo.go pkg/models/operations/paymentsgetserverinfo.go pkg/models/operations/searchgetserverinfo.go pkg/models/shared/errorresponse.go -pkg/models/shared/errorsenumenum.go +pkg/models/shared/errorsenum.go pkg/models/shared/accountresponse.go pkg/models/shared/accountwithvolumesandbalances.go pkg/models/shared/accountscursorresponse.go @@ -130,6 +136,9 @@ pkg/models/shared/listclientsresponse.go pkg/models/shared/readclientresponse.go pkg/models/shared/updateclientresponse.go pkg/models/shared/updateclientrequest.go +pkg/models/shared/ledgerinforesponse.go +pkg/models/shared/ledgerinfo.go +pkg/models/shared/migrationinfo.go pkg/models/shared/logscursorresponse.go pkg/models/shared/log.go pkg/models/shared/mappingresponse.go @@ -145,23 +154,26 @@ pkg/models/shared/getworkflowoccurrenceresponse.go pkg/models/shared/workflowoccurrence.go pkg/models/shared/stagestatus.go pkg/models/shared/listworkflowsresponse.go +pkg/models/shared/listrunsresponse.go pkg/models/shared/serverinfo.go pkg/models/shared/runworkflowresponse.go +pkg/models/shared/stripetransferresponse.go pkg/models/shared/stripetransferrequest.go pkg/models/shared/taskresponse.go pkg/models/shared/taskstripe.go -pkg/models/shared/paymentstatusenum.go +pkg/models/shared/paymentstatus.go pkg/models/shared/taskwise.go pkg/models/shared/taskcurrencycloud.go pkg/models/shared/taskdummypay.go pkg/models/shared/taskmodulr.go pkg/models/shared/taskbankingcircle.go -pkg/models/shared/connectorenum.go +pkg/models/shared/connector.go pkg/models/shared/paymentresponse.go pkg/models/shared/payment.go pkg/models/shared/paymentmetadata.go pkg/models/shared/paymentmetadatachangelog.go pkg/models/shared/paymentadjustment.go +pkg/models/shared/connectorconfig.go pkg/models/shared/stripeconfig.go pkg/models/shared/dummypayconfig.go pkg/models/shared/wiseconfig.go @@ -213,6 +225,9 @@ pkg/models/shared/createwalletresponse.go pkg/models/shared/wallet.go pkg/models/shared/createwalletrequest.go pkg/models/shared/creditwalletrequest.go +pkg/models/shared/subject.go +pkg/models/shared/ledgeraccountsubject.go +pkg/models/shared/walletsubject.go pkg/models/shared/monetary.go pkg/models/shared/debitwalletresponse.go pkg/models/shared/hold.go @@ -231,9 +246,374 @@ pkg/models/shared/assetholder.go pkg/models/shared/listbalancesresponse.go pkg/models/shared/listwalletsresponse.go pkg/models/shared/configresponse.go +pkg/models/shared/webhooksconfig.go pkg/models/shared/configchangesecret.go pkg/models/shared/configsresponse.go pkg/models/shared/configuser.go pkg/models/shared/attemptresponse.go +pkg/models/shared/attempt.go pkg/models/shared/security.go -USAGE.md \ No newline at end of file +USAGE.md +docs/models/operations/addmetadatatoaccountrequest.md +docs/models/operations/addmetadatatoaccountresponse.md +docs/models/operations/countaccountsmetadata.md +docs/models/operations/countaccountsrequest.md +docs/models/operations/countaccountsresponse.md +docs/models/operations/getaccountrequest.md +docs/models/operations/getaccountresponse.md +docs/models/operations/listaccountsbalanceoperator.md +docs/models/operations/listaccountsmetadata.md +docs/models/operations/listaccountsrequest.md +docs/models/operations/listaccountsresponse.md +docs/models/operations/getbalancesrequest.md +docs/models/operations/getbalancesresponse.md +docs/models/operations/getbalancesaggregatedrequest.md +docs/models/operations/getbalancesaggregatedresponse.md +docs/models/operations/addscopetoclientrequest.md +docs/models/operations/addscopetoclientresponse.md +docs/models/operations/createclientresponse.md +docs/models/operations/createsecretrequest.md +docs/models/operations/createsecretresponse.md +docs/models/operations/deleteclientrequest.md +docs/models/operations/deleteclientresponse.md +docs/models/operations/deletescopefromclientrequest.md +docs/models/operations/deletescopefromclientresponse.md +docs/models/operations/deletesecretrequest.md +docs/models/operations/deletesecretresponse.md +docs/models/operations/listclientsresponse.md +docs/models/operations/readclientrequest.md +docs/models/operations/readclientresponse.md +docs/models/operations/updateclientrequest.md +docs/models/operations/updateclientresponse.md +docs/models/operations/getledgerinforequest.md +docs/models/operations/getledgerinforesponse.md +docs/models/operations/listlogsrequest.md +docs/models/operations/listlogsresponse.md +docs/models/operations/getmappingrequest.md +docs/models/operations/getmappingresponse.md +docs/models/operations/updatemappingrequest.md +docs/models/operations/updatemappingresponse.md +docs/models/operations/createworkflowresponse.md +docs/models/operations/getflowrequest.md +docs/models/operations/getflowresponse.md +docs/models/operations/getworkflowoccurrencerequest.md +docs/models/operations/getworkflowoccurrenceresponse.md +docs/models/operations/listflowsresponse.md +docs/models/operations/listrunsrequest.md +docs/models/operations/listrunsresponse.md +docs/models/operations/orchestrationgetserverinforesponse.md +docs/models/operations/runworkflowrequest.md +docs/models/operations/runworkflowresponse.md +docs/models/operations/connectorsstripetransferresponse.md +docs/models/operations/getconnectortaskrequest.md +docs/models/operations/getconnectortaskresponse.md +docs/models/operations/getpaymentrequest.md +docs/models/operations/getpaymentresponse.md +docs/models/operations/installconnectorrequest.md +docs/models/operations/installconnectorresponse.md +docs/models/operations/listallconnectorsresponse.md +docs/models/operations/listconfigsavailableconnectorsresponse.md +docs/models/operations/listconnectortasksrequest.md +docs/models/operations/listconnectortasksresponse.md +docs/models/operations/listpaymentsrequest.md +docs/models/operations/listpaymentsresponse.md +docs/models/operations/paymentslistaccountsrequest.md +docs/models/operations/paymentslistaccountsresponse.md +docs/models/operations/readconnectorconfigrequest.md +docs/models/operations/readconnectorconfigresponse.md +docs/models/operations/resetconnectorrequest.md +docs/models/operations/resetconnectorresponse.md +docs/models/operations/uninstallconnectorrequest.md +docs/models/operations/uninstallconnectorresponse.md +docs/models/operations/addtransientscoperequest.md +docs/models/operations/addtransientscoperesponse.md +docs/models/operations/createscoperesponse.md +docs/models/operations/deletescoperequest.md +docs/models/operations/deletescoperesponse.md +docs/models/operations/deletetransientscoperequest.md +docs/models/operations/deletetransientscoperesponse.md +docs/models/operations/listscopesresponse.md +docs/models/operations/readscoperequest.md +docs/models/operations/readscoperesponse.md +docs/models/operations/updatescoperequest.md +docs/models/operations/updatescoperesponse.md +docs/models/operations/runscriptrequest.md +docs/models/operations/runscriptresponse.md +docs/models/operations/searchresponse.md +docs/models/operations/getinforesponse.md +docs/models/operations/readstatsrequest.md +docs/models/operations/readstatsresponse.md +docs/models/operations/createtransactionsrequest.md +docs/models/operations/createtransactionsresponse.md +docs/models/operations/addmetadataontransactionrequest.md +docs/models/operations/addmetadataontransactionresponse.md +docs/models/operations/counttransactionsmetadata.md +docs/models/operations/counttransactionsrequest.md +docs/models/operations/counttransactionsresponse.md +docs/models/operations/createtransactionrequest.md +docs/models/operations/createtransactionresponse.md +docs/models/operations/gettransactionrequest.md +docs/models/operations/gettransactionresponse.md +docs/models/operations/listtransactionsmetadata.md +docs/models/operations/listtransactionsrequest.md +docs/models/operations/listtransactionsresponse.md +docs/models/operations/reverttransactionrequest.md +docs/models/operations/reverttransactionresponse.md +docs/models/operations/listusersresponse.md +docs/models/operations/readuserrequest.md +docs/models/operations/readuserresponse.md +docs/models/operations/confirmholdrequest.md +docs/models/operations/confirmholdresponse.md +docs/models/operations/createbalancerequest.md +docs/models/operations/createbalanceresponse.md +docs/models/operations/createwalletresponse.md +docs/models/operations/creditwalletrequest.md +docs/models/operations/creditwalletresponse.md +docs/models/operations/debitwalletrequest.md +docs/models/operations/debitwalletresponse.md +docs/models/operations/getbalancerequest.md +docs/models/operations/getbalanceresponse.md +docs/models/operations/getholdrequest.md +docs/models/operations/getholdresponse.md +docs/models/operations/getholdsmetadata.md +docs/models/operations/getholdsrequest.md +docs/models/operations/getholdsresponse.md +docs/models/operations/gettransactionsrequest.md +docs/models/operations/gettransactionsresponse.md +docs/models/operations/getwalletrequest.md +docs/models/operations/getwalletresponse.md +docs/models/operations/listbalancesrequest.md +docs/models/operations/listbalancesresponse.md +docs/models/operations/listwalletsmetadata.md +docs/models/operations/listwalletsrequest.md +docs/models/operations/listwalletsresponse.md +docs/models/operations/updatewalletrequestbody.md +docs/models/operations/updatewalletrequest.md +docs/models/operations/updatewalletresponse.md +docs/models/operations/voidholdrequest.md +docs/models/operations/voidholdresponse.md +docs/models/operations/walletsgetserverinforesponse.md +docs/models/operations/activateconfigrequest.md +docs/models/operations/activateconfigresponse.md +docs/models/operations/changeconfigsecretrequest.md +docs/models/operations/changeconfigsecretresponse.md +docs/models/operations/deactivateconfigrequest.md +docs/models/operations/deactivateconfigresponse.md +docs/models/operations/deleteconfigrequest.md +docs/models/operations/deleteconfigresponse.md +docs/models/operations/getmanyconfigsrequest.md +docs/models/operations/getmanyconfigsresponse.md +docs/models/operations/insertconfigresponse.md +docs/models/operations/testconfigrequest.md +docs/models/operations/testconfigresponse.md +docs/models/operations/getserverinforesponse.md +docs/models/operations/paymentsgetserverinforesponse.md +docs/models/operations/searchgetserverinforesponse.md +docs/models/shared/errorresponse.md +docs/models/shared/errorsenum.md +docs/models/shared/accountresponse.md +docs/models/shared/accountwithvolumesandbalancesmetadata.md +docs/models/shared/accountwithvolumesandbalances.md +docs/models/shared/accountscursorresponsecursor.md +docs/models/shared/accountscursorresponse.md +docs/models/shared/accountmetadata.md +docs/models/shared/account.md +docs/models/shared/balancescursorresponsecursor.md +docs/models/shared/balancescursorresponse.md +docs/models/shared/aggregatebalancesresponse.md +docs/models/shared/createclientresponse.md +docs/models/shared/client.md +docs/models/shared/clientsecret.md +docs/models/shared/createclientrequest.md +docs/models/shared/createsecretresponse.md +docs/models/shared/secret.md +docs/models/shared/createsecretrequest.md +docs/models/shared/listclientsresponse.md +docs/models/shared/readclientresponse.md +docs/models/shared/updateclientresponse.md +docs/models/shared/updateclientrequest.md +docs/models/shared/ledgerinforesponse.md +docs/models/shared/ledgerinfostorage.md +docs/models/shared/ledgerinfo.md +docs/models/shared/migrationinfostate.md +docs/models/shared/migrationinfo.md +docs/models/shared/logscursorresponsecursor.md +docs/models/shared/logscursorresponse.md +docs/models/shared/logdata.md +docs/models/shared/logtype.md +docs/models/shared/log.md +docs/models/shared/mappingresponse.md +docs/models/shared/mapping.md +docs/models/shared/contractexpr.md +docs/models/shared/contract.md +docs/models/shared/error.md +docs/models/shared/createworkflowresponse.md +docs/models/shared/workflow.md +docs/models/shared/workflowconfig.md +docs/models/shared/createworkflowrequest.md +docs/models/shared/getworkflowresponse.md +docs/models/shared/getworkflowoccurrenceresponse.md +docs/models/shared/workflowoccurrence.md +docs/models/shared/stagestatus.md +docs/models/shared/listworkflowsresponse.md +docs/models/shared/listrunsresponsecursor.md +docs/models/shared/listrunsresponse.md +docs/models/shared/serverinfo.md +docs/models/shared/runworkflowresponse.md +docs/models/shared/stripetransferresponse.md +docs/models/shared/stripetransferrequestmetadata.md +docs/models/shared/stripetransferrequest.md +docs/models/shared/taskresponsedata.md +docs/models/shared/taskresponse.md +docs/models/shared/taskstripedescriptor.md +docs/models/shared/taskstripestate.md +docs/models/shared/taskstripe.md +docs/models/shared/paymentstatus.md +docs/models/shared/taskwisedescriptor.md +docs/models/shared/taskwisestate.md +docs/models/shared/taskwise.md +docs/models/shared/taskcurrencyclouddescriptor.md +docs/models/shared/taskcurrencycloudstate.md +docs/models/shared/taskcurrencycloud.md +docs/models/shared/taskdummypaydescriptor.md +docs/models/shared/taskdummypaystate.md +docs/models/shared/taskdummypay.md +docs/models/shared/taskmodulrdescriptor.md +docs/models/shared/taskmodulrstate.md +docs/models/shared/taskmodulr.md +docs/models/shared/taskbankingcircledescriptor.md +docs/models/shared/taskbankingcirclestate.md +docs/models/shared/taskbankingcircle.md +docs/models/shared/connector.md +docs/models/shared/paymentresponse.md +docs/models/shared/paymentraw.md +docs/models/shared/paymentscheme.md +docs/models/shared/paymenttype.md +docs/models/shared/payment.md +docs/models/shared/paymentmetadata.md +docs/models/shared/paymentmetadatachangelog.md +docs/models/shared/paymentadjustmentraw.md +docs/models/shared/paymentadjustment.md +docs/models/shared/connectorconfig.md +docs/models/shared/stripeconfig.md +docs/models/shared/dummypayconfig.md +docs/models/shared/wiseconfig.md +docs/models/shared/modulrconfig.md +docs/models/shared/currencycloudconfig.md +docs/models/shared/bankingcircleconfig.md +docs/models/shared/connectorsresponsedata.md +docs/models/shared/connectorsresponse.md +docs/models/shared/connectorsconfigsresponsedataconnectorkey.md +docs/models/shared/connectorsconfigsresponsedataconnector.md +docs/models/shared/connectorsconfigsresponsedata.md +docs/models/shared/connectorsconfigsresponse.md +docs/models/shared/taskscursorcursordata.md +docs/models/shared/taskscursorcursor.md +docs/models/shared/taskscursor.md +docs/models/shared/paymentscursorcursor.md +docs/models/shared/paymentscursor.md +docs/models/shared/accountscursorcursor.md +docs/models/shared/accountscursor.md +docs/models/shared/paymentsaccounttype.md +docs/models/shared/paymentsaccount.md +docs/models/shared/connectorconfigresponse.md +docs/models/shared/createscoperesponse.md +docs/models/shared/scope.md +docs/models/shared/createscoperequest.md +docs/models/shared/listscopesresponse.md +docs/models/shared/readscoperesponse.md +docs/models/shared/updatescoperesponse.md +docs/models/shared/updatescoperequest.md +docs/models/shared/scriptresponse.md +docs/models/shared/transaction.md +docs/models/shared/volume.md +docs/models/shared/posting.md +docs/models/shared/scriptvars.md +docs/models/shared/script.md +docs/models/shared/responsecursordata.md +docs/models/shared/responsecursortotal.md +docs/models/shared/responsecursor.md +docs/models/shared/responsedata.md +docs/models/shared/response.md +docs/models/shared/query.md +docs/models/shared/configinforesponse.md +docs/models/shared/configinfo.md +docs/models/shared/config.md +docs/models/shared/ledgerstorage.md +docs/models/shared/statsresponse.md +docs/models/shared/stats.md +docs/models/shared/transactionsresponse.md +docs/models/shared/transactions.md +docs/models/shared/transactiondata.md +docs/models/shared/posttransactionscriptvars.md +docs/models/shared/posttransactionscript.md +docs/models/shared/posttransaction.md +docs/models/shared/transactionresponse.md +docs/models/shared/transactionscursorresponsecursor.md +docs/models/shared/transactionscursorresponse.md +docs/models/shared/listusersresponse.md +docs/models/shared/user.md +docs/models/shared/readuserresponse.md +docs/models/shared/walletserrorresponse.md +docs/models/shared/confirmholdrequest.md +docs/models/shared/createbalanceresponse.md +docs/models/shared/balance.md +docs/models/shared/createbalancerequest.md +docs/models/shared/createwalletresponse.md +docs/models/shared/wallet.md +docs/models/shared/createwalletrequest.md +docs/models/shared/creditwalletrequest.md +docs/models/shared/subject.md +docs/models/shared/ledgeraccountsubject.md +docs/models/shared/walletsubject.md +docs/models/shared/monetary.md +docs/models/shared/debitwalletresponse.md +docs/models/shared/hold.md +docs/models/shared/debitwalletrequest.md +docs/models/shared/getbalanceresponse.md +docs/models/shared/balancewithassets.md +docs/models/shared/getholdresponse.md +docs/models/shared/expandeddebithold.md +docs/models/shared/getholdsresponsecursor.md +docs/models/shared/getholdsresponse.md +docs/models/shared/gettransactionsresponsecursor.md +docs/models/shared/gettransactionsresponse.md +docs/models/shared/walletstransaction.md +docs/models/shared/walletsvolume.md +docs/models/shared/getwalletresponse.md +docs/models/shared/walletwithbalancesbalances.md +docs/models/shared/walletwithbalances.md +docs/models/shared/assetholder.md +docs/models/shared/listbalancesresponsecursor.md +docs/models/shared/listbalancesresponse.md +docs/models/shared/listwalletsresponsecursor.md +docs/models/shared/listwalletsresponse.md +docs/models/shared/configresponse.md +docs/models/shared/webhooksconfig.md +docs/models/shared/configchangesecret.md +docs/models/shared/configsresponsecursor.md +docs/models/shared/configsresponse.md +docs/models/shared/configuser.md +docs/models/shared/attemptresponse.md +docs/models/shared/attempt.md +docs/models/shared/security.md +docs/sdks/formance/README.md +docs/sdks/accounts/README.md +docs/sdks/balances/README.md +docs/sdks/clients/README.md +docs/sdks/ledger/README.md +docs/sdks/logs/README.md +docs/sdks/mapping/README.md +docs/sdks/orchestration/README.md +docs/sdks/payments/README.md +docs/sdks/scopes/README.md +docs/sdks/script/README.md +docs/sdks/search/README.md +docs/sdks/server/README.md +docs/sdks/stats/README.md +docs/sdks/transactions/README.md +docs/sdks/users/README.md +docs/sdks/wallets/README.md +docs/sdks/webhooks/README.md +pkg/models/operations/options.go +.gitattributes \ No newline at end of file diff --git a/formance.go b/formance.go index b7d30f1..d7382bc 100755 --- a/formance.go +++ b/formance.go @@ -1,21 +1,30 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" "time" ) +// ServerList contains the list of servers available to the SDK var ServerList = []string{ + // local server "http://localhost", + // sandbox server "https://{organization}.sandbox.formance.cloud", } +// HTTPClient provides an interface for suplying the SDK with a custom HTTP client type HTTPClient interface { Do(req *http.Request) (*http.Response, error) } @@ -23,7 +32,44 @@ type HTTPClient interface { // String provides a helper function to return a pointer to a string func String(s string) *string { return &s } -// SDK Documentation: Open, modular foundation for unique payments flows +// Bool provides a helper function to return a pointer to a bool +func Bool(b bool) *bool { return &b } + +// Int provides a helper function to return a pointer to an int +func Int(i int) *int { return &i } + +// Int64 provides a helper function to return a pointer to an int64 +func Int64(i int64) *int64 { return &i } + +// Float32 provides a helper function to return a pointer to a float32 +func Float32(f float32) *float32 { return &f } + +// Float64 provides a helper function to return a pointer to a float64 +func Float64(f float64) *float64 { return &f } + +type sdkConfiguration struct { + DefaultClient HTTPClient + SecurityClient HTTPClient + Security *shared.Security + ServerURL string + ServerIndex int + ServerDefaults []map[string]string + Language string + OpenAPIDocVersion string + SDKVersion string + GenVersion string + RetryConfig *utils.RetryConfig +} + +func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { + if c.ServerURL != "" { + return c.ServerURL, nil + } + + return ServerList[c.ServerIndex], c.ServerDefaults[c.ServerIndex] +} + +// Formance Stack API: Open, modular foundation for unique payments flows // // # Introduction // This API is documented in **OpenAPI format**. @@ -36,257 +82,190 @@ func String(s string) *string { return &s } // and standard method from web, mobile and desktop applications. // type Formance struct { - Accounts *accounts - Balances *balances - Clients *clients - Ledger *ledger - Logs *logs - Mapping *mapping + // Everything related to Accounts + Accounts *accounts + // Everything related to Balances + Balances *balances + // Everything related to Clients + Clients *clients + // Everything related to Ledger + Ledger *ledger + // Everything related to Logs + Logs *logs + // Everything related to Mapping + Mapping *mapping + // Everything related to Orchestration Orchestration *orchestration - Payments *payments - Scopes *scopes - Script *script - Search *search - Server *server - Stats *stats - Transactions *transactions - Users *users - Wallets *wallets - Webhooks *webhooks - - // Non-idiomatic field names below are to namespace fields from the fields names above to avoid name conflicts - _defaultClient HTTPClient - _securityClient HTTPClient - _security *shared.Security - _serverURL string - _language string - _sdkVersion string - _genVersion string + // Everything related to Payments + Payments *payments + // Everything related to Scopes + Scopes *scopes + // Everything related to Script + Script *script + // Everything related to Search + Search *search + // Everything related to Server + Server *server + // Everything related to Stats + Stats *stats + // Everything related to Transactions + Transactions *transactions + // Everything related to Users + Users *users + // Everything related to Wallets + Wallets *wallets + // Everything related to Webhooks + Webhooks *webhooks + + sdkConfiguration sdkConfiguration } type SDKOption func(*Formance) +// WithServerURL allows the overriding of the default server URL func WithServerURL(serverURL string) SDKOption { return func(sdk *Formance) { - sdk._serverURL = serverURL + sdk.sdkConfiguration.ServerURL = serverURL } } +// WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption { return func(sdk *Formance) { if params != nil { serverURL = utils.ReplaceParameters(serverURL, params) } - sdk._serverURL = serverURL + sdk.sdkConfiguration.ServerURL = serverURL + } +} + +// WithServerIndex allows the overriding of the default server by index +func WithServerIndex(serverIndex int) SDKOption { + return func(sdk *Formance) { + if serverIndex < 0 || serverIndex >= len(ServerList) { + panic(fmt.Errorf("server index %d out of range", serverIndex)) + } + + sdk.sdkConfiguration.ServerIndex = serverIndex } } +// WithOrganization allows setting the organization variable for url substitution +func WithOrganization(organization string) SDKOption { + return func(sdk *Formance) { + for idx := range sdk.sdkConfiguration.ServerDefaults { + if _, ok := sdk.sdkConfiguration.ServerDefaults[idx]["organization"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerDefaults[idx]["organization"] = fmt.Sprintf("%v", organization) + } + } +} + +// WithClient allows the overriding of the default HTTP client used by the SDK func WithClient(client HTTPClient) SDKOption { return func(sdk *Formance) { - sdk._defaultClient = client + sdk.sdkConfiguration.DefaultClient = client } } +// WithSecurity configures the SDK to use the provided security details func WithSecurity(security shared.Security) SDKOption { return func(sdk *Formance) { - sdk._security = &security + sdk.sdkConfiguration.Security = &security + } +} + +func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption { + return func(sdk *Formance) { + sdk.sdkConfiguration.RetryConfig = &retryConfig } } +// New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *Formance { sdk := &Formance{ - _language: "go", - _sdkVersion: "0.3.1", - _genVersion: "1.12.0", + sdkConfiguration: sdkConfiguration{ + Language: "go", + OpenAPIDocVersion: "v1.0.0-rc.5", + SDKVersion: "0.4.0", + GenVersion: "2.125.1", + ServerDefaults: []map[string]string{ + {}, + { + "organization": "", + }, + }, + }, } for _, opt := range opts { opt(sdk) } // Use WithClient to override the default client if you would like to customize the timeout - if sdk._defaultClient == nil { - sdk._defaultClient = &http.Client{Timeout: 60 * time.Second} + if sdk.sdkConfiguration.DefaultClient == nil { + sdk.sdkConfiguration.DefaultClient = &http.Client{Timeout: 60 * time.Second} } - if sdk._securityClient == nil { - if sdk._security != nil { - sdk._securityClient = utils.ConfigureSecurityClient(sdk._defaultClient, sdk._security) + if sdk.sdkConfiguration.SecurityClient == nil { + if sdk.sdkConfiguration.Security != nil { + sdk.sdkConfiguration.SecurityClient = utils.ConfigureSecurityClient(sdk.sdkConfiguration.DefaultClient, sdk.sdkConfiguration.Security) } else { - sdk._securityClient = sdk._defaultClient + sdk.sdkConfiguration.SecurityClient = sdk.sdkConfiguration.DefaultClient } } - if sdk._serverURL == "" { - sdk._serverURL = ServerList[0] - } + sdk.Accounts = newAccounts(sdk.sdkConfiguration) - sdk.Accounts = newAccounts( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Balances = newBalances( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Clients = newClients( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Ledger = newLedger( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Logs = newLogs( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Mapping = newMapping( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Orchestration = newOrchestration( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Payments = newPayments( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Scopes = newScopes( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Script = newScript( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Search = newSearch( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Server = newServer( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Stats = newStats( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Transactions = newTransactions( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Users = newUsers( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Wallets = newWallets( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Webhooks = newWebhooks( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) + sdk.Balances = newBalances(sdk.sdkConfiguration) + + sdk.Clients = newClients(sdk.sdkConfiguration) + + sdk.Ledger = newLedger(sdk.sdkConfiguration) + + sdk.Logs = newLogs(sdk.sdkConfiguration) + + sdk.Mapping = newMapping(sdk.sdkConfiguration) + + sdk.Orchestration = newOrchestration(sdk.sdkConfiguration) + + sdk.Payments = newPayments(sdk.sdkConfiguration) + + sdk.Scopes = newScopes(sdk.sdkConfiguration) + + sdk.Script = newScript(sdk.sdkConfiguration) + + sdk.Search = newSearch(sdk.sdkConfiguration) + + sdk.Server = newServer(sdk.sdkConfiguration) + + sdk.Stats = newStats(sdk.sdkConfiguration) + + sdk.Transactions = newTransactions(sdk.sdkConfiguration) + + sdk.Users = newUsers(sdk.sdkConfiguration) + + sdk.Wallets = newWallets(sdk.sdkConfiguration) + + sdk.Webhooks = newWebhooks(sdk.sdkConfiguration) return sdk } // GetServerInfo - Get server info func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfoResponse, error) { - baseURL := s._serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s._securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -295,7 +274,13 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -308,12 +293,14 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ServerInfo = out + res.ServerInfo = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -322,15 +309,17 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo // PaymentsgetServerInfo - Get server info func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.PaymentsgetServerInfoResponse, error) { - baseURL := s._serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s._securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -339,7 +328,13 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -352,12 +347,14 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ServerInfo = out + res.ServerInfo = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -366,15 +363,17 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme // SearchgetServerInfo - Get server info func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.SearchgetServerInfoResponse, error) { - baseURL := s._serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/search/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s._securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -383,7 +382,13 @@ func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.Searchg if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -396,12 +401,14 @@ func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.Searchg case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ServerInfo = out + res.ServerInfo = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/gen.yaml b/gen.yaml index 8386a3a..94bf870 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,11 +2,23 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.12.0 + speakeasyVersion: 1.89.0 + generationVersion: 2.125.1 generation: - telemetryEnabled: false sdkClassName: formance sdkFlattening: true + singleTagPerOp: false + telemetryEnabled: false +features: + go: + constsAndDefaults: 0.1.0 + core: 2.88.4 + deprecations: 2.81.1 + globalSecurity: 2.81.1 + globalServerURLs: 2.82.0 + nameOverrides: 2.81.1 + unions: 2.83.0 go: - version: 0.3.1 + version: 0.4.0 + maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk diff --git a/go.mod b/go.mod index 0d306de..13fed1e 100755 --- a/go.mod +++ b/go.mod @@ -4,4 +4,7 @@ go 1.14 require ( github.com/cenkalti/backoff/v4 v4.2.0 + github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/mitchellh/mapstructure v1.5.0 + github.com/spyzhov/ajson v0.8.0 ) diff --git a/go.sum b/go.sum index 2307997..ae03a47 100755 --- a/go.sum +++ b/go.sum @@ -1,2 +1,8 @@ github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/spyzhov/ajson v0.8.0 h1:sFXyMbi4Y/BKjrsfkUZHSjA2JM1184enheSjjoT/zCc= +github.com/spyzhov/ajson v0.8.0/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA= diff --git a/ledger.go b/ledger.go index c275343..29d5c44 100755 --- a/ledger.go +++ b/ledger.go @@ -1,45 +1,46 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// ledger - Everything related to Ledger type ledger struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newLedger(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *ledger { +func newLedger(sdkConfig sdkConfiguration) *ledger { return &ledger{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // GetLedgerInfo - Get information about a ledger func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedgerInfoRequest) (*operations.GetLedgerInfoResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/_info", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/_info", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -48,7 +49,13 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -61,22 +68,26 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out interface{} - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.LedgerInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.LedgerInfoResponse = out + res.LedgerInfoResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/logs.go b/logs.go index 6920f47..abd07bb 100755 --- a/logs.go +++ b/logs.go @@ -1,50 +1,51 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// logs - Everything related to Logs type logs struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newLogs(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *logs { +func newLogs(sdkConfig sdkConfiguration) *logs { return &logs{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ListLogs - List the logs from a ledger // List the logs from a ledger, sorted by ID in descending order. func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) (*operations.ListLogsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/log", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/log", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -53,7 +54,13 @@ func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -66,22 +73,26 @@ func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.LogsCursorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.LogsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.LogsCursorResponse = out + res.LogsCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/mapping.go b/mapping.go index 9fbd9ae..7708576 100755 --- a/mapping.go +++ b/mapping.go @@ -1,45 +1,46 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// mapping - Everything related to Mapping type mapping struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newMapping(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *mapping { +func newMapping(sdkConfig sdkConfiguration) *mapping { return &mapping{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // GetMapping - Get the mapping of a ledger func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingRequest) (*operations.GetMappingResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/mapping", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/mapping", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -48,7 +49,13 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -61,22 +68,26 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.MappingResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.MappingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.MappingResponse = out + res.MappingResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -85,10 +96,13 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR // UpdateMapping - Update the mapping of a ledger func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMappingRequest) (*operations.UpdateMappingResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/mapping", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/mapping", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Mapping", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, false, "Mapping", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -100,10 +114,12 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -112,7 +128,13 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -125,22 +147,26 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.MappingResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.MappingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.MappingResponse = out + res.MappingResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/orchestration.go b/orchestration.go index d1dce38..25ed5aa 100755 --- a/orchestration.go +++ b/orchestration.go @@ -1,42 +1,38 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// orchestration - Everything related to Orchestration type orchestration struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newOrchestration(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *orchestration { +func newOrchestration(sdkConfig sdkConfiguration) *orchestration { return &orchestration{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // CreateWorkflow - Create workflow // Create a workflow -func (s *orchestration) CreateWorkflow(ctx context.Context, request shared.CreateWorkflowRequest) (*operations.CreateWorkflowResponse, error) { - baseURL := s.serverURL +func (s *orchestration) CreateWorkflow(ctx context.Context, request *shared.CreateWorkflowRequest) (*operations.CreateWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/flows" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -45,10 +41,12 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request shared.Creat if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -57,7 +55,13 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request shared.Creat if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -70,22 +74,26 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request shared.Creat case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateWorkflowResponse = out + res.CreateWorkflowResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -95,15 +103,20 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request shared.Creat // GetFlow - Get a flow by id // Get a flow by id func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowRequest) (*operations.GetFlowResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -112,7 +125,13 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -125,22 +144,26 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetWorkflowResponse = out + res.GetWorkflowResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -150,15 +173,20 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR // GetWorkflowOccurrence - Get a workflow occurrence by id // Get a workflow occurrence by id func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request operations.GetWorkflowOccurrenceRequest) (*operations.GetWorkflowOccurrenceResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs/{runId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs/{runId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -167,7 +195,13 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -180,22 +214,26 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowOccurrenceResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetWorkflowOccurrenceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetWorkflowOccurrenceResponse = out + res.GetWorkflowOccurrenceResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -205,15 +243,17 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera // ListFlows - List registered flows // List registered flows func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/flows" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -222,7 +262,13 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -235,22 +281,26 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListWorkflowsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListWorkflowsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListWorkflowsResponse = out + res.ListWorkflowsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -260,15 +310,20 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes // ListRuns - List occurrences of a workflow // List occurrences of a workflow func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRunsRequest) (*operations.ListRunsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -277,7 +332,13 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -290,22 +351,26 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out interface{} - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListRunsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListRunsResponse = out + res.ListRunsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -314,15 +379,17 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun // OrchestrationgetServerInfo - Get server info func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operations.OrchestrationgetServerInfoResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -331,7 +398,13 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -344,22 +417,26 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ServerInfo = out + res.ServerInfo = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -369,10 +446,13 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat // RunWorkflow - Run workflow // Run workflow func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunWorkflowRequest) (*operations.RunWorkflowResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/flows/{flowId}/runs", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -381,6 +461,8 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -388,7 +470,7 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -397,7 +479,13 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -410,22 +498,26 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.RunWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.RunWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.RunWorkflowResponse = out + res.RunWorkflowResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Error = out + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/payments.go b/payments.go index 3ea006d..8585c94 100755 --- a/payments.go +++ b/payments.go @@ -1,42 +1,38 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// payments - Everything related to Payments type payments struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newPayments(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *payments { +func newPayments(sdkConfig sdkConfiguration) *payments { return &payments{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ConnectorsStripeTransfer - Transfer funds between Stripe accounts // Execute a transfer between two Stripe accounts. func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared.StripeTransferRequest) (*operations.ConnectorsStripeTransferResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/connectors/stripe/transfer" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -48,10 +44,12 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -60,7 +58,13 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -73,12 +77,14 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out map[string]interface{} - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.StripeTransferResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.StripeTransferResponse = out + res.StripeTransferResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -88,15 +94,20 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. // GetConnectorTask - Read a specific task of the connector // Get a specific task associated to the connector. func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetConnectorTaskRequest) (*operations.GetConnectorTaskResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/tasks/{taskId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/tasks/{taskId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -105,7 +116,13 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -118,12 +135,14 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TaskResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TaskResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TaskResponse = out + res.TaskResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -132,15 +151,20 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC // GetPayment - Get a payment func (s *payments) GetPayment(ctx context.Context, request operations.GetPaymentRequest) (*operations.GetPaymentResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/payments/{paymentId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/payments/{paymentId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -149,7 +173,13 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -162,12 +192,14 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.PaymentResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.PaymentResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.PaymentResponse = out + res.PaymentResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -177,10 +209,13 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment // InstallConnector - Install a connector // Install a connector by its name and config. func (s *payments) InstallConnector(ctx context.Context, request operations.InstallConnectorRequest) (*operations.InstallConnectorResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ConnectorConfig", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -192,10 +227,12 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -204,7 +241,13 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -223,15 +266,17 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst // ListAllConnectors - List all installed connectors // List all installed connectors. func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllConnectorsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/connectors" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -240,7 +285,13 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -253,12 +304,14 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConnectorsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConnectorsResponse = out + res.ConnectorsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -268,15 +321,17 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo // ListConfigsAvailableConnectors - List the configs of each available connector // List the configs of each available connector. func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operations.ListConfigsAvailableConnectorsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/connectors/configs" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -285,7 +340,13 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -298,12 +359,14 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorsConfigsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConnectorsConfigsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConnectorsConfigsResponse = out + res.ConnectorsConfigsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -313,19 +376,24 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati // ListConnectorTasks - List tasks from a connector // List all tasks associated with this connector. func (s *payments) ListConnectorTasks(ctx context.Context, request operations.ListConnectorTasksRequest) (*operations.ListConnectorTasksResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/tasks", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/tasks", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -334,7 +402,13 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -347,12 +421,14 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TasksCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TasksCursor + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TasksCursor = out + res.TasksCursor = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -361,19 +437,21 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li // ListPayments - List payments func (s *payments) ListPayments(ctx context.Context, request operations.ListPaymentsRequest) (*operations.ListPaymentsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/payments" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -382,7 +460,13 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -395,12 +479,14 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.PaymentsCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.PaymentsCursor + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.PaymentsCursor = out + res.PaymentsCursor = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -409,19 +495,21 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym // PaymentslistAccounts - List accounts func (s *payments) PaymentslistAccounts(ctx context.Context, request operations.PaymentslistAccountsRequest) (*operations.PaymentslistAccountsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/payments/accounts" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -430,7 +518,13 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -443,12 +537,14 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountsCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.AccountsCursor + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountsCursor = out + res.AccountsCursor = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -458,15 +554,20 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. // ReadConnectorConfig - Read the config of a connector // Read connector config func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.ReadConnectorConfigRequest) (*operations.ReadConnectorConfigResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/config", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/config", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -475,7 +576,13 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -488,12 +595,14 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConnectorConfigResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConnectorConfigResponse = out + res.ConnectorConfigResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -504,15 +613,20 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R // Reset a connector by its name. // It will remove the connector and ALL PAYMENTS generated with it. func (s *payments) ResetConnector(ctx context.Context, request operations.ResetConnectorRequest) (*operations.ResetConnectorResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/reset", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/reset", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "POST", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -521,7 +635,13 @@ func (s *payments) ResetConnector(ctx context.Context, request operations.ResetC if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -540,15 +660,20 @@ func (s *payments) ResetConnector(ctx context.Context, request operations.ResetC // UninstallConnector - Uninstall a connector // Uninstall a connector by its name. func (s *payments) UninstallConnector(ctx context.Context, request operations.UninstallConnectorRequest) (*operations.UninstallConnectorResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -557,7 +682,13 @@ func (s *payments) UninstallConnector(ctx context.Context, request operations.Un if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") diff --git a/pkg/models/operations/activateconfig.go b/pkg/models/operations/activateconfig.go index 223e355..8f37a57 100755 --- a/pkg/models/operations/activateconfig.go +++ b/pkg/models/operations/activateconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type ActivateConfigRequest struct { + // Config ID ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *ActivateConfigRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type ActivateConfigResponse struct { + // Config successfully activated. ConfigResponse *shared.ConfigResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *ActivateConfigResponse) GetConfigResponse() *shared.ConfigResponse { + if o == nil { + return nil + } + return o.ConfigResponse +} + +func (o *ActivateConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ActivateConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ActivateConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/addmetadataontransaction.go b/pkg/models/operations/addmetadataontransaction.go index 865627a..ea65db6 100755 --- a/pkg/models/operations/addmetadataontransaction.go +++ b/pkg/models/operations/addmetadataontransaction.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,67 @@ import ( ) type AddMetadataOnTransactionRequest struct { + // metadata RequestBody map[string]interface{} `request:"mediaType=application/json"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Transaction ID. + Txid int64 `pathParam:"style=simple,explode=false,name=txid"` +} + +func (o *AddMetadataOnTransactionRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *AddMetadataOnTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *AddMetadataOnTransactionRequest) GetTxid() int64 { + if o == nil { + return 0 + } + return o.Txid } type AddMetadataOnTransactionResponse struct { - ContentType string + ContentType string + // Error ErrorResponse *shared.ErrorResponse StatusCode int RawResponse *http.Response } + +func (o *AddMetadataOnTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddMetadataOnTransactionResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *AddMetadataOnTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddMetadataOnTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/addmetadatatoaccount.go b/pkg/models/operations/addmetadatatoaccount.go index 88a9abc..007bc53 100755 --- a/pkg/models/operations/addmetadatatoaccount.go +++ b/pkg/models/operations/addmetadatatoaccount.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,71 @@ import ( ) type AddMetadataToAccountRequest struct { + // metadata RequestBody map[string]interface{} `request:"mediaType=application/json"` - Address string `pathParam:"style=simple,explode=false,name=address"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Exact address of the account. It must match the following regular expressions pattern: + // ``` + // ^\w+(:\w+)*$ + // ``` + // + Address string `pathParam:"style=simple,explode=false,name=address"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *AddMetadataToAccountRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *AddMetadataToAccountRequest) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *AddMetadataToAccountRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger } type AddMetadataToAccountResponse struct { - ContentType string + ContentType string + // Error ErrorResponse *shared.ErrorResponse StatusCode int RawResponse *http.Response } + +func (o *AddMetadataToAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddMetadataToAccountResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *AddMetadataToAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddMetadataToAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/addscopetoclient.go b/pkg/models/operations/addscopetoclient.go index 2d74b07..e5e88ed 100755 --- a/pkg/models/operations/addscopetoclient.go +++ b/pkg/models/operations/addscopetoclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,8 +7,24 @@ import ( ) type AddScopeToClientRequest struct { + // Client ID ClientID string `pathParam:"style=simple,explode=false,name=clientId"` - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Scope ID + ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` +} + +func (o *AddScopeToClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + +func (o *AddScopeToClientRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID } type AddScopeToClientResponse struct { @@ -14,3 +32,24 @@ type AddScopeToClientResponse struct { StatusCode int RawResponse *http.Response } + +func (o *AddScopeToClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddScopeToClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddScopeToClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/addtransientscope.go b/pkg/models/operations/addtransientscope.go index c55c64e..4763a8b 100755 --- a/pkg/models/operations/addtransientscope.go +++ b/pkg/models/operations/addtransientscope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,12 +7,49 @@ import ( ) type AddTransientScopeRequest struct { - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Scope ID + ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Transient scope ID TransientScopeID string `pathParam:"style=simple,explode=false,name=transientScopeId"` } +func (o *AddTransientScopeRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID +} + +func (o *AddTransientScopeRequest) GetTransientScopeID() string { + if o == nil { + return "" + } + return o.TransientScopeID +} + type AddTransientScopeResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *AddTransientScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddTransientScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddTransientScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/changeconfigsecret.go b/pkg/models/operations/changeconfigsecret.go index 95ff8e3..f883374 100755 --- a/pkg/models/operations/changeconfigsecret.go +++ b/pkg/models/operations/changeconfigsecret.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,12 +9,56 @@ import ( type ChangeConfigSecretRequest struct { ConfigChangeSecret *shared.ConfigChangeSecret `request:"mediaType=application/json"` - ID string `pathParam:"style=simple,explode=false,name=id"` + // Config ID + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (o *ChangeConfigSecretRequest) GetConfigChangeSecret() *shared.ConfigChangeSecret { + if o == nil { + return nil + } + return o.ConfigChangeSecret +} + +func (o *ChangeConfigSecretRequest) GetID() string { + if o == nil { + return "" + } + return o.ID } type ChangeConfigSecretResponse struct { + // Secret successfully changed. ConfigResponse *shared.ConfigResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *ChangeConfigSecretResponse) GetConfigResponse() *shared.ConfigResponse { + if o == nil { + return nil + } + return o.ConfigResponse +} + +func (o *ChangeConfigSecretResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ChangeConfigSecretResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ChangeConfigSecretResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/confirmhold.go b/pkg/models/operations/confirmhold.go index ecd9b3e..1033616 100755 --- a/pkg/models/operations/confirmhold.go +++ b/pkg/models/operations/confirmhold.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -10,9 +12,52 @@ type ConfirmHoldRequest struct { HoldID string `pathParam:"style=simple,explode=false,name=hold_id"` } +func (o *ConfirmHoldRequest) GetConfirmHoldRequest() *shared.ConfirmHoldRequest { + if o == nil { + return nil + } + return o.ConfirmHoldRequest +} + +func (o *ConfirmHoldRequest) GetHoldID() string { + if o == nil { + return "" + } + return o.HoldID +} + type ConfirmHoldResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *ConfirmHoldResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ConfirmHoldResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ConfirmHoldResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ConfirmHoldResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/connectorsstripetransfer.go b/pkg/models/operations/connectorsstripetransfer.go index 42d5667..01bff42 100755 --- a/pkg/models/operations/connectorsstripetransfer.go +++ b/pkg/models/operations/connectorsstripetransfer.go @@ -1,12 +1,44 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "net/http" ) type ConnectorsStripeTransferResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - StripeTransferResponse map[string]interface{} + ContentType string + StatusCode int + RawResponse *http.Response + // OK + StripeTransferResponse *shared.StripeTransferResponse +} + +func (o *ConnectorsStripeTransferResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ConnectorsStripeTransferResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ConnectorsStripeTransferResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ConnectorsStripeTransferResponse) GetStripeTransferResponse() *shared.StripeTransferResponse { + if o == nil { + return nil + } + return o.StripeTransferResponse } diff --git a/pkg/models/operations/countaccounts.go b/pkg/models/operations/countaccounts.go index 17f1962..b94a75d 100755 --- a/pkg/models/operations/countaccounts.go +++ b/pkg/models/operations/countaccounts.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,16 +7,80 @@ import ( "net/http" ) +// CountAccountsMetadata - Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. +type CountAccountsMetadata struct { +} + type CountAccountsRequest struct { - Address *string `queryParam:"style=form,explode=true,name=address"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` + // Filter accounts by address pattern (regular expression placed between ^ and $). + Address *string `queryParam:"style=form,explode=true,name=address"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *CountAccountsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` +} + +func (o *CountAccountsRequest) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *CountAccountsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *CountAccountsRequest) GetMetadata() *CountAccountsMetadata { + if o == nil { + return nil + } + return o.Metadata } type CountAccountsResponse struct { - ContentType string + ContentType string + // Error ErrorResponse *shared.ErrorResponse Headers map[string][]string StatusCode int RawResponse *http.Response } + +func (o *CountAccountsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CountAccountsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *CountAccountsResponse) GetHeaders() map[string][]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *CountAccountsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CountAccountsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/counttransactions.go b/pkg/models/operations/counttransactions.go index 6e74b61..bc95ab8 100755 --- a/pkg/models/operations/counttransactions.go +++ b/pkg/models/operations/counttransactions.go @@ -1,28 +1,176 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" "time" ) +// CountTransactionsMetadata - Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. +type CountTransactionsMetadata struct { +} + type CountTransactionsRequest struct { - Account *string `queryParam:"style=form,explode=true,name=account"` - Destination *string `queryParam:"style=form,explode=true,name=destination"` - EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` - EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` - Reference *string `queryParam:"style=form,explode=true,name=reference"` - Source *string `queryParam:"style=form,explode=true,name=source"` - StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` - StartTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=start_time"` + // Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). + Account *string `queryParam:"style=form,explode=true,name=account"` + // Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). + Destination *string `queryParam:"style=form,explode=true,name=destination"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // + EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // Deprecated, please use `endTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *CountTransactionsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` + // Filter transactions by reference field. + Reference *string `queryParam:"style=form,explode=true,name=reference"` + // Filter transactions with postings involving given account at source (regular expression placed between ^ and $). + Source *string `queryParam:"style=form,explode=true,name=source"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // + StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // Deprecated, please use `startTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + StartTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=start_time"` +} + +func (c CountTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CountTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CountTransactionsRequest) GetAccount() *string { + if o == nil { + return nil + } + return o.Account +} + +func (o *CountTransactionsRequest) GetDestination() *string { + if o == nil { + return nil + } + return o.Destination +} + +func (o *CountTransactionsRequest) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *CountTransactionsRequest) GetEndTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.EndTimeDeprecated +} + +func (o *CountTransactionsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *CountTransactionsRequest) GetMetadata() *CountTransactionsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CountTransactionsRequest) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *CountTransactionsRequest) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} + +func (o *CountTransactionsRequest) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *CountTransactionsRequest) GetStartTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.StartTimeDeprecated } type CountTransactionsResponse struct { - ContentType string + ContentType string + // Error ErrorResponse *shared.ErrorResponse Headers map[string][]string StatusCode int RawResponse *http.Response } + +func (o *CountTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CountTransactionsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *CountTransactionsResponse) GetHeaders() map[string][]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *CountTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CountTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/createbalance.go b/pkg/models/operations/createbalance.go index dfccf31..6fd457c 100755 --- a/pkg/models/operations/createbalance.go +++ b/pkg/models/operations/createbalance.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -10,10 +12,61 @@ type CreateBalanceRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *CreateBalanceRequest) GetCreateBalanceRequest() *shared.CreateBalanceRequest { + if o == nil { + return nil + } + return o.CreateBalanceRequest +} + +func (o *CreateBalanceRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type CreateBalanceResponse struct { - ContentType string + ContentType string + // Created balance CreateBalanceResponse *shared.CreateBalanceResponse StatusCode int RawResponse *http.Response - WalletsErrorResponse *shared.WalletsErrorResponse + // Error + WalletsErrorResponse *shared.WalletsErrorResponse +} + +func (o *CreateBalanceResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateBalanceResponse) GetCreateBalanceResponse() *shared.CreateBalanceResponse { + if o == nil { + return nil + } + return o.CreateBalanceResponse +} + +func (o *CreateBalanceResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateBalanceResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreateBalanceResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse } diff --git a/pkg/models/operations/createclient.go b/pkg/models/operations/createclient.go index 4f03d62..1589e04 100755 --- a/pkg/models/operations/createclient.go +++ b/pkg/models/operations/createclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type CreateClientResponse struct { - ContentType string + ContentType string + // Client created CreateClientResponse *shared.CreateClientResponse StatusCode int RawResponse *http.Response } + +func (o *CreateClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateClientResponse) GetCreateClientResponse() *shared.CreateClientResponse { + if o == nil { + return nil + } + return o.CreateClientResponse +} + +func (o *CreateClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/createscope.go b/pkg/models/operations/createscope.go index 938931f..f0dadcc 100755 --- a/pkg/models/operations/createscope.go +++ b/pkg/models/operations/createscope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type CreateScopeResponse struct { - ContentType string + ContentType string + // Created scope CreateScopeResponse *shared.CreateScopeResponse StatusCode int RawResponse *http.Response } + +func (o *CreateScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateScopeResponse) GetCreateScopeResponse() *shared.CreateScopeResponse { + if o == nil { + return nil + } + return o.CreateScopeResponse +} + +func (o *CreateScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/createsecret.go b/pkg/models/operations/createsecret.go index 6abca63..faa671d 100755 --- a/pkg/models/operations/createsecret.go +++ b/pkg/models/operations/createsecret.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,12 +9,56 @@ import ( type CreateSecretRequest struct { CreateSecretRequest *shared.CreateSecretRequest `request:"mediaType=application/json"` - ClientID string `pathParam:"style=simple,explode=false,name=clientId"` + // Client ID + ClientID string `pathParam:"style=simple,explode=false,name=clientId"` +} + +func (o *CreateSecretRequest) GetCreateSecretRequest() *shared.CreateSecretRequest { + if o == nil { + return nil + } + return o.CreateSecretRequest +} + +func (o *CreateSecretRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID } type CreateSecretResponse struct { - ContentType string + ContentType string + // Created secret CreateSecretResponse *shared.CreateSecretResponse StatusCode int RawResponse *http.Response } + +func (o *CreateSecretResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateSecretResponse) GetCreateSecretResponse() *shared.CreateSecretResponse { + if o == nil { + return nil + } + return o.CreateSecretResponse +} + +func (o *CreateSecretResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateSecretResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/createtransaction.go b/pkg/models/operations/createtransaction.go index cb02142..f8a1e49 100755 --- a/pkg/models/operations/createtransaction.go +++ b/pkg/models/operations/createtransaction.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,15 +8,79 @@ import ( ) type CreateTransactionRequest struct { + // The request body must contain at least one of the following objects: + // - `postings`: suitable for simple transactions + // - `script`: enabling more complex transactions with Numscript + // PostTransaction shared.PostTransaction `request:"mediaType=application/json"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Preview *bool `queryParam:"style=form,explode=true,name=preview"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. + Preview *bool `queryParam:"style=form,explode=true,name=preview"` +} + +func (o *CreateTransactionRequest) GetPostTransaction() shared.PostTransaction { + if o == nil { + return shared.PostTransaction{} + } + return o.PostTransaction +} + +func (o *CreateTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *CreateTransactionRequest) GetPreview() *bool { + if o == nil { + return nil + } + return o.Preview } type CreateTransactionResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response + // OK TransactionsResponse *shared.TransactionsResponse } + +func (o *CreateTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateTransactionResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *CreateTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreateTransactionResponse) GetTransactionsResponse() *shared.TransactionsResponse { + if o == nil { + return nil + } + return o.TransactionsResponse +} diff --git a/pkg/models/operations/createtransactions.go b/pkg/models/operations/createtransactions.go index b851121..dba2303 100755 --- a/pkg/models/operations/createtransactions.go +++ b/pkg/models/operations/createtransactions.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,13 +9,65 @@ import ( type CreateTransactionsRequest struct { Transactions shared.Transactions `request:"mediaType=application/json"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *CreateTransactionsRequest) GetTransactions() shared.Transactions { + if o == nil { + return shared.Transactions{} + } + return o.Transactions +} + +func (o *CreateTransactionsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger } type CreateTransactionsResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response + // OK TransactionsResponse *shared.TransactionsResponse } + +func (o *CreateTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateTransactionsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *CreateTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreateTransactionsResponse) GetTransactionsResponse() *shared.TransactionsResponse { + if o == nil { + return nil + } + return o.TransactionsResponse +} diff --git a/pkg/models/operations/createwallet.go b/pkg/models/operations/createwallet.go index 033bde9..eeca23e 100755 --- a/pkg/models/operations/createwallet.go +++ b/pkg/models/operations/createwallet.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type CreateWalletResponse struct { - ContentType string + ContentType string + // Wallet created CreateWalletResponse *shared.CreateWalletResponse StatusCode int RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *CreateWalletResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateWalletResponse) GetCreateWalletResponse() *shared.CreateWalletResponse { + if o == nil { + return nil + } + return o.CreateWalletResponse +} + +func (o *CreateWalletResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateWalletResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreateWalletResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/createworkflow.go b/pkg/models/operations/createworkflow.go index 908fbbf..a359139 100755 --- a/pkg/models/operations/createworkflow.go +++ b/pkg/models/operations/createworkflow.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type CreateWorkflowResponse struct { - ContentType string + ContentType string + // Created workflow CreateWorkflowResponse *shared.CreateWorkflowResponse - Error *shared.Error - StatusCode int - RawResponse *http.Response + // General error + Error *shared.Error + StatusCode int + RawResponse *http.Response +} + +func (o *CreateWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateWorkflowResponse) GetCreateWorkflowResponse() *shared.CreateWorkflowResponse { + if o == nil { + return nil + } + return o.CreateWorkflowResponse +} + +func (o *CreateWorkflowResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *CreateWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/creditwallet.go b/pkg/models/operations/creditwallet.go index 3368a7d..af37c7e 100755 --- a/pkg/models/operations/creditwallet.go +++ b/pkg/models/operations/creditwallet.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -10,9 +12,52 @@ type CreditWalletRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *CreditWalletRequest) GetCreditWalletRequest() *shared.CreditWalletRequest { + if o == nil { + return nil + } + return o.CreditWalletRequest +} + +func (o *CreditWalletRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type CreditWalletResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *CreditWalletResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreditWalletResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreditWalletResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreditWalletResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/deactivateconfig.go b/pkg/models/operations/deactivateconfig.go index c1959dd..0c944c9 100755 --- a/pkg/models/operations/deactivateconfig.go +++ b/pkg/models/operations/deactivateconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type DeactivateConfigRequest struct { + // Config ID ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *DeactivateConfigRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type DeactivateConfigResponse struct { + // Config successfully deactivated. ConfigResponse *shared.ConfigResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeactivateConfigResponse) GetConfigResponse() *shared.ConfigResponse { + if o == nil { + return nil + } + return o.ConfigResponse +} + +func (o *DeactivateConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeactivateConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeactivateConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/debitwallet.go b/pkg/models/operations/debitwallet.go index f62176f..15588c2 100755 --- a/pkg/models/operations/debitwallet.go +++ b/pkg/models/operations/debitwallet.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -10,10 +12,61 @@ type DebitWalletRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *DebitWalletRequest) GetDebitWalletRequest() *shared.DebitWalletRequest { + if o == nil { + return nil + } + return o.DebitWalletRequest +} + +func (o *DebitWalletRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type DebitWalletResponse struct { - ContentType string - DebitWalletResponse *shared.DebitWalletResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Wallet successfully debited as a pending hold + DebitWalletResponse *shared.DebitWalletResponse + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *DebitWalletResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DebitWalletResponse) GetDebitWalletResponse() *shared.DebitWalletResponse { + if o == nil { + return nil + } + return o.DebitWalletResponse +} + +func (o *DebitWalletResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DebitWalletResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *DebitWalletResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/deleteclient.go b/pkg/models/operations/deleteclient.go index ba8f1e3..f5855a9 100755 --- a/pkg/models/operations/deleteclient.go +++ b/pkg/models/operations/deleteclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,11 +7,40 @@ import ( ) type DeleteClientRequest struct { + // Client ID ClientID string `pathParam:"style=simple,explode=false,name=clientId"` } +func (o *DeleteClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + type DeleteClientResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeleteClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deleteconfig.go b/pkg/models/operations/deleteconfig.go index 267bf61..57abca9 100755 --- a/pkg/models/operations/deleteconfig.go +++ b/pkg/models/operations/deleteconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,11 +7,40 @@ import ( ) type DeleteConfigRequest struct { + // Config ID ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *DeleteConfigRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type DeleteConfigResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeleteConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deletescope.go b/pkg/models/operations/deletescope.go index b3ee6b6..8c92051 100755 --- a/pkg/models/operations/deletescope.go +++ b/pkg/models/operations/deletescope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,11 +7,40 @@ import ( ) type DeleteScopeRequest struct { + // Scope ID ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` } +func (o *DeleteScopeRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID +} + type DeleteScopeResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeleteScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deletescopefromclient.go b/pkg/models/operations/deletescopefromclient.go index dcbce27..dbabd97 100755 --- a/pkg/models/operations/deletescopefromclient.go +++ b/pkg/models/operations/deletescopefromclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,8 +7,24 @@ import ( ) type DeleteScopeFromClientRequest struct { + // Client ID ClientID string `pathParam:"style=simple,explode=false,name=clientId"` - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Scope ID + ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` +} + +func (o *DeleteScopeFromClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + +func (o *DeleteScopeFromClientRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID } type DeleteScopeFromClientResponse struct { @@ -14,3 +32,24 @@ type DeleteScopeFromClientResponse struct { StatusCode int RawResponse *http.Response } + +func (o *DeleteScopeFromClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteScopeFromClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteScopeFromClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deletesecret.go b/pkg/models/operations/deletesecret.go index ed6a73c..7bc6d6c 100755 --- a/pkg/models/operations/deletesecret.go +++ b/pkg/models/operations/deletesecret.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,12 +7,49 @@ import ( ) type DeleteSecretRequest struct { + // Client ID ClientID string `pathParam:"style=simple,explode=false,name=clientId"` + // Secret ID SecretID string `pathParam:"style=simple,explode=false,name=secretId"` } +func (o *DeleteSecretRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + +func (o *DeleteSecretRequest) GetSecretID() string { + if o == nil { + return "" + } + return o.SecretID +} + type DeleteSecretResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeleteSecretResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteSecretResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteSecretResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deletetransientscope.go b/pkg/models/operations/deletetransientscope.go index 7dc7ad9..3443d01 100755 --- a/pkg/models/operations/deletetransientscope.go +++ b/pkg/models/operations/deletetransientscope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -5,12 +7,49 @@ import ( ) type DeleteTransientScopeRequest struct { - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Scope ID + ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Transient scope ID TransientScopeID string `pathParam:"style=simple,explode=false,name=transientScopeId"` } +func (o *DeleteTransientScopeRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID +} + +func (o *DeleteTransientScopeRequest) GetTransientScopeID() string { + if o == nil { + return "" + } + return o.TransientScopeID +} + type DeleteTransientScopeResponse struct { ContentType string StatusCode int RawResponse *http.Response } + +func (o *DeleteTransientScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteTransientScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteTransientScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/getaccount.go b/pkg/models/operations/getaccount.go index 81bd994..0b4a366 100755 --- a/pkg/models/operations/getaccount.go +++ b/pkg/models/operations/getaccount.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,71 @@ import ( ) type GetAccountRequest struct { + // Exact address of the account. It must match the following regular expressions pattern: + // ``` + // ^\w+(:\w+)*$ + // ``` + // Address string `pathParam:"style=simple,explode=false,name=address"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *GetAccountRequest) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *GetAccountRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger } type GetAccountResponse struct { + // OK AccountResponse *shared.AccountResponse ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response +} + +func (o *GetAccountResponse) GetAccountResponse() *shared.AccountResponse { + if o == nil { + return nil + } + return o.AccountResponse +} + +func (o *GetAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetAccountResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getbalance.go b/pkg/models/operations/getbalance.go index ebe5546..b819a6f 100755 --- a/pkg/models/operations/getbalance.go +++ b/pkg/models/operations/getbalance.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -10,10 +12,61 @@ type GetBalanceRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *GetBalanceRequest) GetBalanceName() string { + if o == nil { + return "" + } + return o.BalanceName +} + +func (o *GetBalanceRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type GetBalanceResponse struct { - ContentType string - GetBalanceResponse *shared.GetBalanceResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Balance summary + GetBalanceResponse *shared.GetBalanceResponse + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *GetBalanceResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetBalanceResponse) GetGetBalanceResponse() *shared.GetBalanceResponse { + if o == nil { + return nil + } + return o.GetBalanceResponse +} + +func (o *GetBalanceResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBalanceResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetBalanceResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/getbalances.go b/pkg/models/operations/getbalances.go index 7b1ed05..05ee63f 100755 --- a/pkg/models/operations/getbalances.go +++ b/pkg/models/operations/getbalances.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,17 +8,103 @@ import ( ) type GetBalancesRequest struct { - Address *string `queryParam:"style=form,explode=true,name=address"` - After *string `queryParam:"style=form,explode=true,name=after"` - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Filter balances involving given account, either as source or destination. + Address *string `queryParam:"style=form,explode=true,name=address"` + // Pagination cursor, will return accounts after given address, in descending order. + After *string `queryParam:"style=form,explode=true,name=after"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Parameter used in pagination requests. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // Deprecated, please use `cursor` instead. + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` } +func (o *GetBalancesRequest) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *GetBalancesRequest) GetAfter() *string { + if o == nil { + return nil + } + return o.After +} + +func (o *GetBalancesRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *GetBalancesRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *GetBalancesRequest) GetPaginationToken() *string { + if o == nil { + return nil + } + return o.PaginationToken +} + type GetBalancesResponse struct { + // OK BalancesCursorResponse *shared.BalancesCursorResponse ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response +} + +func (o *GetBalancesResponse) GetBalancesCursorResponse() *shared.BalancesCursorResponse { + if o == nil { + return nil + } + return o.BalancesCursorResponse +} + +func (o *GetBalancesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetBalancesResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetBalancesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBalancesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getbalancesaggregated.go b/pkg/models/operations/getbalancesaggregated.go index 40b1582..c7eda7f 100755 --- a/pkg/models/operations/getbalancesaggregated.go +++ b/pkg/models/operations/getbalancesaggregated.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,67 @@ import ( ) type GetBalancesAggregatedRequest struct { + // Filter balances involving given account, either as source or destination. Address *string `queryParam:"style=form,explode=true,name=address"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *GetBalancesAggregatedRequest) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *GetBalancesAggregatedRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger } type GetBalancesAggregatedResponse struct { + // OK AggregateBalancesResponse *shared.AggregateBalancesResponse ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response +} + +func (o *GetBalancesAggregatedResponse) GetAggregateBalancesResponse() *shared.AggregateBalancesResponse { + if o == nil { + return nil + } + return o.AggregateBalancesResponse +} + +func (o *GetBalancesAggregatedResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetBalancesAggregatedResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetBalancesAggregatedResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBalancesAggregatedResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getconnectortask.go b/pkg/models/operations/getconnectortask.go index def9d60..817742e 100755 --- a/pkg/models/operations/getconnectortask.go +++ b/pkg/models/operations/getconnectortask.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetConnectorTaskRequest struct { - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` - TaskID string `pathParam:"style=simple,explode=false,name=taskId"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` + // The task ID. + TaskID string `pathParam:"style=simple,explode=false,name=taskId"` +} + +func (o *GetConnectorTaskRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector +} + +func (o *GetConnectorTaskRequest) GetTaskID() string { + if o == nil { + return "" + } + return o.TaskID } type GetConnectorTaskResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // OK TaskResponse *shared.TaskResponse } + +func (o *GetConnectorTaskResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetConnectorTaskResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetConnectorTaskResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetConnectorTaskResponse) GetTaskResponse() *shared.TaskResponse { + if o == nil { + return nil + } + return o.TaskResponse +} diff --git a/pkg/models/operations/getflow.go b/pkg/models/operations/getflow.go index 3199e26..02953ea 100755 --- a/pkg/models/operations/getflow.go +++ b/pkg/models/operations/getflow.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetFlowRequest struct { + // The flow id FlowID string `pathParam:"style=simple,explode=false,name=flowId"` } +func (o *GetFlowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + type GetFlowResponse struct { - ContentType string - Error *shared.Error + ContentType string + // General error + Error *shared.Error + // The workflow GetWorkflowResponse *shared.GetWorkflowResponse StatusCode int RawResponse *http.Response } + +func (o *GetFlowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetFlowResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetFlowResponse) GetGetWorkflowResponse() *shared.GetWorkflowResponse { + if o == nil { + return nil + } + return o.GetWorkflowResponse +} + +func (o *GetFlowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetFlowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/gethold.go b/pkg/models/operations/gethold.go index 06485d1..30a2583 100755 --- a/pkg/models/operations/gethold.go +++ b/pkg/models/operations/gethold.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetHoldRequest struct { + // The hold ID HoldID string `pathParam:"style=simple,explode=false,name=holdID"` } +func (o *GetHoldRequest) GetHoldID() string { + if o == nil { + return "" + } + return o.HoldID +} + type GetHoldResponse struct { - ContentType string - GetHoldResponse *shared.GetHoldResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Holds + GetHoldResponse *shared.GetHoldResponse + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *GetHoldResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetHoldResponse) GetGetHoldResponse() *shared.GetHoldResponse { + if o == nil { + return nil + } + return o.GetHoldResponse +} + +func (o *GetHoldResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetHoldResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetHoldResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/getholds.go b/pkg/models/operations/getholds.go index 3d58e3f..60fa1f4 100755 --- a/pkg/models/operations/getholds.go +++ b/pkg/models/operations/getholds.go @@ -1,21 +1,112 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) +// GetHoldsMetadata - Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. +type GetHoldsMetadata struct { +} + type GetHoldsRequest struct { - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - WalletID *string `queryParam:"style=form,explode=true,name=walletID"` + // Parameter used in pagination requests. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when the pagination token is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *GetHoldsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` + // The maximum number of results to return per page + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // The wallet to filter on + WalletID *string `queryParam:"style=form,explode=true,name=walletID"` +} + +func (g GetHoldsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetHoldsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetHoldsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *GetHoldsRequest) GetMetadata() *GetHoldsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *GetHoldsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *GetHoldsRequest) GetWalletID() *string { + if o == nil { + return nil + } + return o.WalletID } type GetHoldsResponse struct { - ContentType string - GetHoldsResponse *shared.GetHoldsResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Holds + GetHoldsResponse *shared.GetHoldsResponse + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *GetHoldsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetHoldsResponse) GetGetHoldsResponse() *shared.GetHoldsResponse { + if o == nil { + return nil + } + return o.GetHoldsResponse +} + +func (o *GetHoldsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetHoldsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetHoldsResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/getinfo.go b/pkg/models/operations/getinfo.go index 1d1e212..0dd44d0 100755 --- a/pkg/models/operations/getinfo.go +++ b/pkg/models/operations/getinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type GetInfoResponse struct { + // OK ConfigInfoResponse *shared.ConfigInfoResponse ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response +} + +func (o *GetInfoResponse) GetConfigInfoResponse() *shared.ConfigInfoResponse { + if o == nil { + return nil + } + return o.ConfigInfoResponse +} + +func (o *GetInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetInfoResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getledgerinfo.go b/pkg/models/operations/getledgerinfo.go index 3a3be1f..391fd4a 100755 --- a/pkg/models/operations/getledgerinfo.go +++ b/pkg/models/operations/getledgerinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetLedgerInfoRequest struct { + // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *GetLedgerInfoRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + type GetLedgerInfoResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - LedgerInfoResponse interface{} + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + // OK + LedgerInfoResponse *shared.LedgerInfoResponse StatusCode int RawResponse *http.Response } + +func (o *GetLedgerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLedgerInfoResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetLedgerInfoResponse) GetLedgerInfoResponse() *shared.LedgerInfoResponse { + if o == nil { + return nil + } + return o.LedgerInfoResponse +} + +func (o *GetLedgerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLedgerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/getmanyconfigs.go b/pkg/models/operations/getmanyconfigs.go index ed2e938..0143107 100755 --- a/pkg/models/operations/getmanyconfigs.go +++ b/pkg/models/operations/getmanyconfigs.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetManyConfigsRequest struct { + // Optional filter by endpoint URL Endpoint *string `queryParam:"style=form,explode=true,name=endpoint"` - ID *string `queryParam:"style=form,explode=true,name=id"` + // Optional filter by Config ID + ID *string `queryParam:"style=form,explode=true,name=id"` +} + +func (o *GetManyConfigsRequest) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *GetManyConfigsRequest) GetID() *string { + if o == nil { + return nil + } + return o.ID } type GetManyConfigsResponse struct { + // OK ConfigsResponse *shared.ConfigsResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *GetManyConfigsResponse) GetConfigsResponse() *shared.ConfigsResponse { + if o == nil { + return nil + } + return o.ConfigsResponse +} + +func (o *GetManyConfigsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetManyConfigsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetManyConfigsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/getmapping.go b/pkg/models/operations/getmapping.go index 4705bca..7e3040b 100755 --- a/pkg/models/operations/getmapping.go +++ b/pkg/models/operations/getmapping.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type GetMappingRequest struct { + // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *GetMappingRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + type GetMappingResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + // OK MappingResponse *shared.MappingResponse StatusCode int RawResponse *http.Response } + +func (o *GetMappingResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetMappingResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetMappingResponse) GetMappingResponse() *shared.MappingResponse { + if o == nil { + return nil + } + return o.MappingResponse +} + +func (o *GetMappingResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetMappingResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/getpayment.go b/pkg/models/operations/getpayment.go index cd1d07e..8908b01 100755 --- a/pkg/models/operations/getpayment.go +++ b/pkg/models/operations/getpayment.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type GetPaymentRequest struct { + // The payment ID. PaymentID string `pathParam:"style=simple,explode=false,name=paymentId"` } +func (o *GetPaymentRequest) GetPaymentID() string { + if o == nil { + return "" + } + return o.PaymentID +} + type GetPaymentResponse struct { - ContentType string + ContentType string + // OK PaymentResponse *shared.PaymentResponse StatusCode int RawResponse *http.Response } + +func (o *GetPaymentResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPaymentResponse) GetPaymentResponse() *shared.PaymentResponse { + if o == nil { + return nil + } + return o.PaymentResponse +} + +func (o *GetPaymentResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPaymentResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/getserverinfo.go b/pkg/models/operations/getserverinfo.go index f797500..df56bab 100755 --- a/pkg/models/operations/getserverinfo.go +++ b/pkg/models/operations/getserverinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,7 +9,36 @@ import ( type GetServerInfoResponse struct { ContentType string + // Server information ServerInfo *shared.ServerInfo StatusCode int RawResponse *http.Response } + +func (o *GetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *GetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/gettransaction.go b/pkg/models/operations/gettransaction.go index 104817d..d2d0843 100755 --- a/pkg/models/operations/gettransaction.go +++ b/pkg/models/operations/gettransaction.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,67 @@ import ( ) type GetTransactionRequest struct { + // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + // Transaction ID. + Txid int64 `pathParam:"style=simple,explode=false,name=txid"` +} + +func (o *GetTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *GetTransactionRequest) GetTxid() int64 { + if o == nil { + return 0 + } + return o.Txid } type GetTransactionResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response + // OK TransactionResponse *shared.TransactionResponse } + +func (o *GetTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetTransactionResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *GetTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetTransactionResponse) GetTransactionResponse() *shared.TransactionResponse { + if o == nil { + return nil + } + return o.TransactionResponse +} diff --git a/pkg/models/operations/gettransactions.go b/pkg/models/operations/gettransactions.go index 12a7369..f9748ae 100755 --- a/pkg/models/operations/gettransactions.go +++ b/pkg/models/operations/gettransactions.go @@ -1,20 +1,99 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) type GetTransactionsRequest struct { - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Parameter used in pagination requests. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when the cursor is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // The maximum number of results to return per page + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // A wallet ID to filter on WalletID *string `queryParam:"style=form,explode=true,name=wallet_id"` } +func (g GetTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetTransactionsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *GetTransactionsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *GetTransactionsRequest) GetWalletID() *string { + if o == nil { + return nil + } + return o.WalletID +} + type GetTransactionsResponse struct { - ContentType string + ContentType string + // OK GetTransactionsResponse *shared.GetTransactionsResponse StatusCode int RawResponse *http.Response - WalletsErrorResponse *shared.WalletsErrorResponse + // Error + WalletsErrorResponse *shared.WalletsErrorResponse +} + +func (o *GetTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetTransactionsResponse) GetGetTransactionsResponse() *shared.GetTransactionsResponse { + if o == nil { + return nil + } + return o.GetTransactionsResponse +} + +func (o *GetTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetTransactionsResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse } diff --git a/pkg/models/operations/getwallet.go b/pkg/models/operations/getwallet.go index f3533ab..e13ff35 100755 --- a/pkg/models/operations/getwallet.go +++ b/pkg/models/operations/getwallet.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -9,10 +11,54 @@ type GetWalletRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *GetWalletRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type GetWalletResponse struct { - ContentType string - GetWalletResponse *shared.GetWalletResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Wallet + GetWalletResponse *shared.GetWalletResponse + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *GetWalletResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetWalletResponse) GetGetWalletResponse() *shared.GetWalletResponse { + if o == nil { + return nil + } + return o.GetWalletResponse +} + +func (o *GetWalletResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetWalletResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetWalletResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/getworkflowoccurrence.go b/pkg/models/operations/getworkflowoccurrence.go index 05d5f98..2e07a2f 100755 --- a/pkg/models/operations/getworkflowoccurrence.go +++ b/pkg/models/operations/getworkflowoccurrence.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,67 @@ import ( ) type GetWorkflowOccurrenceRequest struct { + // The flow id FlowID string `pathParam:"style=simple,explode=false,name=flowId"` - RunID string `pathParam:"style=simple,explode=false,name=runId"` + // The occurrence id + RunID string `pathParam:"style=simple,explode=false,name=runId"` +} + +func (o *GetWorkflowOccurrenceRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + +func (o *GetWorkflowOccurrenceRequest) GetRunID() string { + if o == nil { + return "" + } + return o.RunID } type GetWorkflowOccurrenceResponse struct { - ContentType string - Error *shared.Error + ContentType string + // General error + Error *shared.Error + // The workflow occurrence GetWorkflowOccurrenceResponse *shared.GetWorkflowOccurrenceResponse StatusCode int RawResponse *http.Response } + +func (o *GetWorkflowOccurrenceResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetWorkflowOccurrenceResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetWorkflowOccurrenceResponse) GetGetWorkflowOccurrenceResponse() *shared.GetWorkflowOccurrenceResponse { + if o == nil { + return nil + } + return o.GetWorkflowOccurrenceResponse +} + +func (o *GetWorkflowOccurrenceResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetWorkflowOccurrenceResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/insertconfig.go b/pkg/models/operations/insertconfig.go index 20647ee..dcde300 100755 --- a/pkg/models/operations/insertconfig.go +++ b/pkg/models/operations/insertconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type InsertConfigResponse struct { - ConfigResponse *shared.ConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // Config created successfully. + ConfigResponse *shared.ConfigResponse + ContentType string + StatusCode int + RawResponse *http.Response + // Bad Request InsertConfig400TextPlainString *string } + +func (o *InsertConfigResponse) GetConfigResponse() *shared.ConfigResponse { + if o == nil { + return nil + } + return o.ConfigResponse +} + +func (o *InsertConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *InsertConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *InsertConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *InsertConfigResponse) GetInsertConfig400TextPlainString() *string { + if o == nil { + return nil + } + return o.InsertConfig400TextPlainString +} diff --git a/pkg/models/operations/installconnector.go b/pkg/models/operations/installconnector.go index dd88116..4918f8e 100755 --- a/pkg/models/operations/installconnector.go +++ b/pkg/models/operations/installconnector.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,23 @@ import ( ) type InstallConnectorRequest struct { - RequestBody interface{} `request:"mediaType=application/json"` - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` + ConnectorConfig shared.ConnectorConfig `request:"mediaType=application/json"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` +} + +func (o *InstallConnectorRequest) GetConnectorConfig() shared.ConnectorConfig { + if o == nil { + return shared.ConnectorConfig{} + } + return o.ConnectorConfig +} + +func (o *InstallConnectorRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector } type InstallConnectorResponse struct { @@ -15,3 +32,24 @@ type InstallConnectorResponse struct { StatusCode int RawResponse *http.Response } + +func (o *InstallConnectorResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *InstallConnectorResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *InstallConnectorResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listaccounts.go b/pkg/models/operations/listaccounts.go index a7a5112..5de159b 100755 --- a/pkg/models/operations/listaccounts.go +++ b/pkg/models/operations/listaccounts.go @@ -1,39 +1,234 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( + "encoding/json" + "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) -type ListAccountsBalanceOperatorEnum string +// ListAccountsBalanceOperator - Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. +type ListAccountsBalanceOperator string const ( - ListAccountsBalanceOperatorEnumGte ListAccountsBalanceOperatorEnum = "gte" - ListAccountsBalanceOperatorEnumLte ListAccountsBalanceOperatorEnum = "lte" - ListAccountsBalanceOperatorEnumGt ListAccountsBalanceOperatorEnum = "gt" - ListAccountsBalanceOperatorEnumLt ListAccountsBalanceOperatorEnum = "lt" - ListAccountsBalanceOperatorEnumE ListAccountsBalanceOperatorEnum = "e" - ListAccountsBalanceOperatorEnumNe ListAccountsBalanceOperatorEnum = "ne" + ListAccountsBalanceOperatorGte ListAccountsBalanceOperator = "gte" + ListAccountsBalanceOperatorLte ListAccountsBalanceOperator = "lte" + ListAccountsBalanceOperatorGt ListAccountsBalanceOperator = "gt" + ListAccountsBalanceOperatorLt ListAccountsBalanceOperator = "lt" + ListAccountsBalanceOperatorE ListAccountsBalanceOperator = "e" + ListAccountsBalanceOperatorNe ListAccountsBalanceOperator = "ne" ) +func (e ListAccountsBalanceOperator) ToPointer() *ListAccountsBalanceOperator { + return &e +} + +func (e *ListAccountsBalanceOperator) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "gte": + fallthrough + case "lte": + fallthrough + case "gt": + fallthrough + case "lt": + fallthrough + case "e": + fallthrough + case "ne": + *e = ListAccountsBalanceOperator(v) + return nil + default: + return fmt.Errorf("invalid value for ListAccountsBalanceOperator: %v", v) + } +} + +// ListAccountsMetadata - Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. +type ListAccountsMetadata struct { +} + type ListAccountsRequest struct { - Address *string `queryParam:"style=form,explode=true,name=address"` - After *string `queryParam:"style=form,explode=true,name=after"` - Balance *int64 `queryParam:"style=form,explode=true,name=balance"` - BalanceOperator *ListAccountsBalanceOperatorEnum `queryParam:"style=form,explode=true,name=balanceOperator"` - BalanceOperatorDeprecated *ListAccountsBalanceOperatorEnum `queryParam:"style=form,explode=true,name=balance_operator"` - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - PageSizeDeprecated *int64 `queryParam:"style=form,explode=true,name=page_size"` - PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` + // Filter accounts by address pattern (regular expression placed between ^ and $). + Address *string `queryParam:"style=form,explode=true,name=address"` + // Pagination cursor, will return accounts after given address, in descending order. + After *string `queryParam:"style=form,explode=true,name=after"` + // Filter accounts by their balance (default operator is gte) + Balance *int64 `queryParam:"style=form,explode=true,name=balance"` + // Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. + // + BalanceOperator *ListAccountsBalanceOperator `queryParam:"style=form,explode=true,name=balanceOperator"` + // Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. + // Deprecated, please use `balanceOperator` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + BalanceOperatorDeprecated *ListAccountsBalanceOperator `queryParam:"style=form,explode=true,name=balance_operator"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *ListAccountsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // The maximum number of results to return per page. + // Deprecated, please use `pageSize` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PageSizeDeprecated *int64 `default:"15" queryParam:"style=form,explode=true,name=page_size"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // Deprecated, please use `cursor` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` +} + +func (l ListAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListAccountsRequest) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *ListAccountsRequest) GetAfter() *string { + if o == nil { + return nil + } + return o.After +} + +func (o *ListAccountsRequest) GetBalance() *int64 { + if o == nil { + return nil + } + return o.Balance +} + +func (o *ListAccountsRequest) GetBalanceOperator() *ListAccountsBalanceOperator { + if o == nil { + return nil + } + return o.BalanceOperator +} + +func (o *ListAccountsRequest) GetBalanceOperatorDeprecated() *ListAccountsBalanceOperator { + if o == nil { + return nil + } + return o.BalanceOperatorDeprecated +} + +func (o *ListAccountsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListAccountsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *ListAccountsRequest) GetMetadata() *ListAccountsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ListAccountsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListAccountsRequest) GetPageSizeDeprecated() *int64 { + if o == nil { + return nil + } + return o.PageSizeDeprecated +} + +func (o *ListAccountsRequest) GetPaginationToken() *string { + if o == nil { + return nil + } + return o.PaginationToken } type ListAccountsResponse struct { + // OK AccountsCursorResponse *shared.AccountsCursorResponse ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response +} + +func (o *ListAccountsResponse) GetAccountsCursorResponse() *shared.AccountsCursorResponse { + if o == nil { + return nil + } + return o.AccountsCursorResponse +} + +func (o *ListAccountsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListAccountsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *ListAccountsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListAccountsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/listallconnectors.go b/pkg/models/operations/listallconnectors.go index 2c9620d..f2499ab 100755 --- a/pkg/models/operations/listallconnectors.go +++ b/pkg/models/operations/listallconnectors.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type ListAllConnectorsResponse struct { + // OK ConnectorsResponse *shared.ConnectorsResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *ListAllConnectorsResponse) GetConnectorsResponse() *shared.ConnectorsResponse { + if o == nil { + return nil + } + return o.ConnectorsResponse +} + +func (o *ListAllConnectorsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListAllConnectorsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListAllConnectorsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listbalances.go b/pkg/models/operations/listbalances.go index 769ce0b..f833a66 100755 --- a/pkg/models/operations/listbalances.go +++ b/pkg/models/operations/listbalances.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -9,9 +11,45 @@ type ListBalancesRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *ListBalancesRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type ListBalancesResponse struct { - ContentType string + ContentType string + // Balances list ListBalancesResponse *shared.ListBalancesResponse StatusCode int RawResponse *http.Response } + +func (o *ListBalancesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListBalancesResponse) GetListBalancesResponse() *shared.ListBalancesResponse { + if o == nil { + return nil + } + return o.ListBalancesResponse +} + +func (o *ListBalancesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListBalancesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listclients.go b/pkg/models/operations/listclients.go index d03b605..780f4e9 100755 --- a/pkg/models/operations/listclients.go +++ b/pkg/models/operations/listclients.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type ListClientsResponse struct { - ContentType string + ContentType string + // List of clients ListClientsResponse *shared.ListClientsResponse StatusCode int RawResponse *http.Response } + +func (o *ListClientsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListClientsResponse) GetListClientsResponse() *shared.ListClientsResponse { + if o == nil { + return nil + } + return o.ListClientsResponse +} + +func (o *ListClientsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListClientsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listconfigsavailableconnectors.go b/pkg/models/operations/listconfigsavailableconnectors.go index 97df0a9..60a1eab 100755 --- a/pkg/models/operations/listconfigsavailableconnectors.go +++ b/pkg/models/operations/listconfigsavailableconnectors.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type ListConfigsAvailableConnectorsResponse struct { + // OK ConnectorsConfigsResponse *shared.ConnectorsConfigsResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *ListConfigsAvailableConnectorsResponse) GetConnectorsConfigsResponse() *shared.ConnectorsConfigsResponse { + if o == nil { + return nil + } + return o.ConnectorsConfigsResponse +} + +func (o *ListConfigsAvailableConnectorsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListConfigsAvailableConnectorsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListConfigsAvailableConnectorsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listconnectortasks.go b/pkg/models/operations/listconnectortasks.go index 4e93344..7268c21 100755 --- a/pkg/models/operations/listconnectortasks.go +++ b/pkg/models/operations/listconnectortasks.go @@ -1,19 +1,91 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) type ListConnectorTasksRequest struct { - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` +} + +func (l ListConnectorTasksRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListConnectorTasksRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListConnectorTasksRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector +} + +func (o *ListConnectorTasksRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListConnectorTasksRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize } type ListConnectorTasksResponse struct { ContentType string StatusCode int RawResponse *http.Response + // OK TasksCursor *shared.TasksCursor } + +func (o *ListConnectorTasksResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListConnectorTasksResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListConnectorTasksResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListConnectorTasksResponse) GetTasksCursor() *shared.TasksCursor { + if o == nil { + return nil + } + return o.TasksCursor +} diff --git a/pkg/models/operations/listflows.go b/pkg/models/operations/listflows.go index 60f2052..34e412d 100755 --- a/pkg/models/operations/listflows.go +++ b/pkg/models/operations/listflows.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type ListFlowsResponse struct { - ContentType string - Error *shared.Error + ContentType string + // General error + Error *shared.Error + // List of workflows ListWorkflowsResponse *shared.ListWorkflowsResponse StatusCode int RawResponse *http.Response } + +func (o *ListFlowsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListFlowsResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListFlowsResponse) GetListWorkflowsResponse() *shared.ListWorkflowsResponse { + if o == nil { + return nil + } + return o.ListWorkflowsResponse +} + +func (o *ListFlowsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListFlowsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listlogs.go b/pkg/models/operations/listlogs.go index 5d04365..9385efc 100755 --- a/pkg/models/operations/listlogs.go +++ b/pkg/models/operations/listlogs.go @@ -1,28 +1,189 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" "time" ) type ListLogsRequest struct { - After *string `queryParam:"style=form,explode=true,name=after"` - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` - EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - PageSizeDeprecated *int64 `queryParam:"style=form,explode=true,name=page_size"` - PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` - StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` + // Pagination cursor, will return the logs after a given ID. (in descending order). + After *string `queryParam:"style=form,explode=true,name=after"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // + EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // Deprecated, please use `endTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // The maximum number of results to return per page. + // Deprecated, please use `pageSize` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PageSizeDeprecated *int64 `default:"15" queryParam:"style=form,explode=true,name=page_size"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // Deprecated, please use `cursor` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // + StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // Deprecated, please use `startTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. StartTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=start_time"` } +func (l ListLogsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListLogsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListLogsRequest) GetAfter() *string { + if o == nil { + return nil + } + return o.After +} + +func (o *ListLogsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListLogsRequest) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *ListLogsRequest) GetEndTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.EndTimeDeprecated +} + +func (o *ListLogsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *ListLogsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListLogsRequest) GetPageSizeDeprecated() *int64 { + if o == nil { + return nil + } + return o.PageSizeDeprecated +} + +func (o *ListLogsRequest) GetPaginationToken() *string { + if o == nil { + return nil + } + return o.PaginationToken +} + +func (o *ListLogsRequest) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *ListLogsRequest) GetStartTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.StartTimeDeprecated +} + type ListLogsResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + // OK LogsCursorResponse *shared.LogsCursorResponse StatusCode int RawResponse *http.Response } + +func (o *ListLogsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListLogsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *ListLogsResponse) GetLogsCursorResponse() *shared.LogsCursorResponse { + if o == nil { + return nil + } + return o.LogsCursorResponse +} + +func (o *ListLogsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListLogsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listpayments.go b/pkg/models/operations/listpayments.go index f4d5176..6b8ce2a 100755 --- a/pkg/models/operations/listpayments.go +++ b/pkg/models/operations/listpayments.go @@ -1,19 +1,91 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) type ListPaymentsRequest struct { - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - Sort []string `queryParam:"style=form,explode=true,name=sort"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // Fields used to sort payments (default is date:desc). + Sort []string `queryParam:"style=form,explode=true,name=sort"` +} + +func (l ListPaymentsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPaymentsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListPaymentsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListPaymentsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListPaymentsRequest) GetSort() []string { + if o == nil { + return nil + } + return o.Sort } type ListPaymentsResponse struct { - ContentType string + ContentType string + // OK PaymentsCursor *shared.PaymentsCursor StatusCode int RawResponse *http.Response } + +func (o *ListPaymentsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListPaymentsResponse) GetPaymentsCursor() *shared.PaymentsCursor { + if o == nil { + return nil + } + return o.PaymentsCursor +} + +func (o *ListPaymentsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListPaymentsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listruns.go b/pkg/models/operations/listruns.go index d9a74e9..5e18bbd 100755 --- a/pkg/models/operations/listruns.go +++ b/pkg/models/operations/listruns.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type ListRunsRequest struct { + // The flow id FlowID string `pathParam:"style=simple,explode=false,name=flowId"` } +func (o *ListRunsRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + type ListRunsResponse struct { - ContentType string - Error *shared.Error - ListRunsResponse interface{} + ContentType string + // General error + Error *shared.Error + // List of workflow occurrences + ListRunsResponse *shared.ListRunsResponse StatusCode int RawResponse *http.Response } + +func (o *ListRunsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListRunsResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListRunsResponse) GetListRunsResponse() *shared.ListRunsResponse { + if o == nil { + return nil + } + return o.ListRunsResponse +} + +func (o *ListRunsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListRunsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listscopes.go b/pkg/models/operations/listscopes.go index 3b567c0..298ec70 100755 --- a/pkg/models/operations/listscopes.go +++ b/pkg/models/operations/listscopes.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type ListScopesResponse struct { - ContentType string + ContentType string + // List of scopes ListScopesResponse *shared.ListScopesResponse StatusCode int RawResponse *http.Response } + +func (o *ListScopesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListScopesResponse) GetListScopesResponse() *shared.ListScopesResponse { + if o == nil { + return nil + } + return o.ListScopesResponse +} + +func (o *ListScopesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListScopesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listtransactions.go b/pkg/models/operations/listtransactions.go index cd9afe9..2ddf126 100755 --- a/pkg/models/operations/listtransactions.go +++ b/pkg/models/operations/listtransactions.go @@ -1,33 +1,238 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" "time" ) +// ListTransactionsMetadata - Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. +type ListTransactionsMetadata struct { +} + type ListTransactionsRequest struct { - Account *string `queryParam:"style=form,explode=true,name=account"` - After *string `queryParam:"style=form,explode=true,name=after"` - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - Destination *string `queryParam:"style=form,explode=true,name=destination"` - EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` - EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - PageSizeDeprecated *int64 `queryParam:"style=form,explode=true,name=page_size"` - PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` - Reference *string `queryParam:"style=form,explode=true,name=reference"` - Source *string `queryParam:"style=form,explode=true,name=source"` - StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` - StartTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=start_time"` + // Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). + Account *string `queryParam:"style=form,explode=true,name=account"` + // Pagination cursor, will return transactions after given txid (in descending order). + After *string `queryParam:"style=form,explode=true,name=after"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). + Destination *string `queryParam:"style=form,explode=true,name=destination"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // + EndTime *time.Time `queryParam:"style=form,explode=true,name=endTime"` + // Filter transactions that occurred before this timestamp. + // The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). + // Deprecated, please use `endTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + EndTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=end_time"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *ListTransactionsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // The maximum number of results to return per page. + // Deprecated, please use `pageSize` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PageSizeDeprecated *int64 `default:"15" queryParam:"style=form,explode=true,name=page_size"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // Deprecated, please use `cursor` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + PaginationToken *string `queryParam:"style=form,explode=true,name=pagination_token"` + // Find transactions by reference field. + Reference *string `queryParam:"style=form,explode=true,name=reference"` + // Filter transactions with postings involving given account at source (regular expression placed between ^ and $). + Source *string `queryParam:"style=form,explode=true,name=source"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // + StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` + // Filter transactions that occurred after this timestamp. + // The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). + // Deprecated, please use `startTime` instead. + // + // + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + StartTimeDeprecated *time.Time `queryParam:"style=form,explode=true,name=start_time"` +} + +func (l ListTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListTransactionsRequest) GetAccount() *string { + if o == nil { + return nil + } + return o.Account +} + +func (o *ListTransactionsRequest) GetAfter() *string { + if o == nil { + return nil + } + return o.After +} + +func (o *ListTransactionsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListTransactionsRequest) GetDestination() *string { + if o == nil { + return nil + } + return o.Destination +} + +func (o *ListTransactionsRequest) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *ListTransactionsRequest) GetEndTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.EndTimeDeprecated +} + +func (o *ListTransactionsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *ListTransactionsRequest) GetMetadata() *ListTransactionsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ListTransactionsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListTransactionsRequest) GetPageSizeDeprecated() *int64 { + if o == nil { + return nil + } + return o.PageSizeDeprecated +} + +func (o *ListTransactionsRequest) GetPaginationToken() *string { + if o == nil { + return nil + } + return o.PaginationToken +} + +func (o *ListTransactionsRequest) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *ListTransactionsRequest) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} + +func (o *ListTransactionsRequest) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *ListTransactionsRequest) GetStartTimeDeprecated() *time.Time { + if o == nil { + return nil + } + return o.StartTimeDeprecated } type ListTransactionsResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response + // OK TransactionsCursorResponse *shared.TransactionsCursorResponse } + +func (o *ListTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListTransactionsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *ListTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListTransactionsResponse) GetTransactionsCursorResponse() *shared.TransactionsCursorResponse { + if o == nil { + return nil + } + return o.TransactionsCursorResponse +} diff --git a/pkg/models/operations/listusers.go b/pkg/models/operations/listusers.go index b970961..9cbe508 100755 --- a/pkg/models/operations/listusers.go +++ b/pkg/models/operations/listusers.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,8 +8,37 @@ import ( ) type ListUsersResponse struct { - ContentType string + ContentType string + // List of users ListUsersResponse *shared.ListUsersResponse StatusCode int RawResponse *http.Response } + +func (o *ListUsersResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListUsersResponse) GetListUsersResponse() *shared.ListUsersResponse { + if o == nil { + return nil + } + return o.ListUsersResponse +} + +func (o *ListUsersResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListUsersResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listwallets.go b/pkg/models/operations/listwallets.go index c770006..40ae8ce 100755 --- a/pkg/models/operations/listwallets.go +++ b/pkg/models/operations/listwallets.go @@ -1,20 +1,103 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) +// ListWalletsMetadata - Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below. +type ListWalletsMetadata struct { +} + type ListWalletsRequest struct { - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` - Name *string `queryParam:"style=form,explode=true,name=name"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + // Parameter used in pagination requests. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when the pagination token is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below. + Metadata *ListWalletsMetadata `queryParam:"style=deepObject,explode=true,name=metadata"` + // Filter on wallet name + Name *string `queryParam:"style=form,explode=true,name=name"` + // The maximum number of results to return per page + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` +} + +func (l ListWalletsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListWalletsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListWalletsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListWalletsRequest) GetMetadata() *ListWalletsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ListWalletsRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ListWalletsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize } type ListWalletsResponse struct { - ContentType string + ContentType string + // OK ListWalletsResponse *shared.ListWalletsResponse StatusCode int RawResponse *http.Response } + +func (o *ListWalletsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListWalletsResponse) GetListWalletsResponse() *shared.ListWalletsResponse { + if o == nil { + return nil + } + return o.ListWalletsResponse +} + +func (o *ListWalletsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListWalletsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/options.go b/pkg/models/operations/options.go new file mode 100755 index 0000000..aa398ab --- /dev/null +++ b/pkg/models/operations/options.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "errors" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + +var ErrUnsupportedOption = errors.New("unsupported option") + +const ( + SupportedOptionServerURL = "serverURL" + SupportedOptionRetries = "retries" + SupportedOptionAcceptHeaderOverride = "acceptHeaderOverride" +) + +type AcceptHeaderEnum string + +const ( + AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" + AcceptHeaderEnumWildcardWildcard AcceptHeaderEnum = "*/*" + AcceptHeaderEnumTextPlain AcceptHeaderEnum = "text/plain" +) + +func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum { + return &e +} + +type Options struct { + ServerURL *string + Retries *utils.RetryConfig + AcceptHeaderOverride *AcceptHeaderEnum +} + +type Option func(*Options, ...string) error + +// WithServerURL allows providing an alternative server URL. +func WithServerURL(serverURL string) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionServerURL) { + return ErrUnsupportedOption + } + + opts.ServerURL = &serverURL + return nil + } +} + +// WithTemplatedServerURL allows providing an alternative server URL with templated parameters. +func WithTemplatedServerURL(serverURL string, params map[string]string) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionServerURL) { + return ErrUnsupportedOption + } + + if params != nil { + serverURL = utils.ReplaceParameters(serverURL, params) + } + + opts.ServerURL = &serverURL + return nil + } +} + +// WithRetries allows customizing the default retry configuration. +func WithRetries(config utils.RetryConfig) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionRetries) { + return ErrUnsupportedOption + } + + opts.Retries = &config + return nil + } +} + +func WithAcceptHeaderOverride(acceptHeaderOverride AcceptHeaderEnum) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionAcceptHeaderOverride) { + return ErrUnsupportedOption + } + + opts.AcceptHeaderOverride = &acceptHeaderOverride + return nil + } +} diff --git a/pkg/models/operations/orchestrationgetserverinfo.go b/pkg/models/operations/orchestrationgetserverinfo.go index a4d3d0a..bf40c7d 100755 --- a/pkg/models/operations/orchestrationgetserverinfo.go +++ b/pkg/models/operations/orchestrationgetserverinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,8 +9,45 @@ import ( type OrchestrationgetServerInfoResponse struct { ContentType string - Error *shared.Error + // General error + Error *shared.Error + // Server information ServerInfo *shared.ServerInfo StatusCode int RawResponse *http.Response } + +func (o *OrchestrationgetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *OrchestrationgetServerInfoResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *OrchestrationgetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *OrchestrationgetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *OrchestrationgetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/paymentsgetserverinfo.go b/pkg/models/operations/paymentsgetserverinfo.go index b8127a6..7bb63ef 100755 --- a/pkg/models/operations/paymentsgetserverinfo.go +++ b/pkg/models/operations/paymentsgetserverinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,7 +9,36 @@ import ( type PaymentsgetServerInfoResponse struct { ContentType string + // Server information ServerInfo *shared.ServerInfo StatusCode int RawResponse *http.Response } + +func (o *PaymentsgetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *PaymentsgetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *PaymentsgetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *PaymentsgetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/paymentslistaccounts.go b/pkg/models/operations/paymentslistaccounts.go index e1325be..21bedfb 100755 --- a/pkg/models/operations/paymentslistaccounts.go +++ b/pkg/models/operations/paymentslistaccounts.go @@ -1,19 +1,91 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "net/http" ) type PaymentslistAccountsRequest struct { - Cursor *string `queryParam:"style=form,explode=true,name=cursor"` - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - Sort []string `queryParam:"style=form,explode=true,name=sort"` + // Parameter used in pagination requests. Maximum page size is set to 15. + // Set to the value of next for the next page of results. + // Set to the value of previous for the previous page of results. + // No other parameters can be set when this parameter is set. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // The maximum number of results to return per page. + // + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` + // Fields used to sort payments (default is date:desc). + Sort []string `queryParam:"style=form,explode=true,name=sort"` +} + +func (p PaymentslistAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentslistAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentslistAccountsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *PaymentslistAccountsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PaymentslistAccountsRequest) GetSort() []string { + if o == nil { + return nil + } + return o.Sort } type PaymentslistAccountsResponse struct { + // OK AccountsCursor *shared.AccountsCursor ContentType string StatusCode int RawResponse *http.Response } + +func (o *PaymentslistAccountsResponse) GetAccountsCursor() *shared.AccountsCursor { + if o == nil { + return nil + } + return o.AccountsCursor +} + +func (o *PaymentslistAccountsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *PaymentslistAccountsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *PaymentslistAccountsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/readclient.go b/pkg/models/operations/readclient.go index 27b7cde..8c07ba2 100755 --- a/pkg/models/operations/readclient.go +++ b/pkg/models/operations/readclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type ReadClientRequest struct { + // Client ID ClientID string `pathParam:"style=simple,explode=false,name=clientId"` } +func (o *ReadClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + type ReadClientResponse struct { - ContentType string + ContentType string + // Retrieved client ReadClientResponse *shared.ReadClientResponse StatusCode int RawResponse *http.Response } + +func (o *ReadClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadClientResponse) GetReadClientResponse() *shared.ReadClientResponse { + if o == nil { + return nil + } + return o.ReadClientResponse +} + +func (o *ReadClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/readconnectorconfig.go b/pkg/models/operations/readconnectorconfig.go index 9704ec8..a21396f 100755 --- a/pkg/models/operations/readconnectorconfig.go +++ b/pkg/models/operations/readconnectorconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type ReadConnectorConfigRequest struct { - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` +} + +func (o *ReadConnectorConfigRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector } type ReadConnectorConfigResponse struct { + // OK ConnectorConfigResponse *shared.ConnectorConfigResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *ReadConnectorConfigResponse) GetConnectorConfigResponse() *shared.ConnectorConfigResponse { + if o == nil { + return nil + } + return o.ConnectorConfigResponse +} + +func (o *ReadConnectorConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadConnectorConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadConnectorConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/readscope.go b/pkg/models/operations/readscope.go index 8ab6a9e..429abd5 100755 --- a/pkg/models/operations/readscope.go +++ b/pkg/models/operations/readscope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type ReadScopeRequest struct { + // Scope ID ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` } +func (o *ReadScopeRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID +} + type ReadScopeResponse struct { - ContentType string + ContentType string + // Retrieved scope ReadScopeResponse *shared.ReadScopeResponse StatusCode int RawResponse *http.Response } + +func (o *ReadScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadScopeResponse) GetReadScopeResponse() *shared.ReadScopeResponse { + if o == nil { + return nil + } + return o.ReadScopeResponse +} + +func (o *ReadScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/readstats.go b/pkg/models/operations/readstats.go index f0ce2f6..1074ecc 100755 --- a/pkg/models/operations/readstats.go +++ b/pkg/models/operations/readstats.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,13 +8,58 @@ import ( ) type ReadStatsRequest struct { + // name of the ledger Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *ReadStatsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + type ReadStatsResponse struct { - ContentType string + ContentType string + // Error ErrorResponse *shared.ErrorResponse + // OK StatsResponse *shared.StatsResponse StatusCode int RawResponse *http.Response } + +func (o *ReadStatsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadStatsResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *ReadStatsResponse) GetStatsResponse() *shared.StatsResponse { + if o == nil { + return nil + } + return o.StatsResponse +} + +func (o *ReadStatsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadStatsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/readuser.go b/pkg/models/operations/readuser.go index 9ec2814..d3dff55 100755 --- a/pkg/models/operations/readuser.go +++ b/pkg/models/operations/readuser.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type ReadUserRequest struct { + // User ID UserID string `pathParam:"style=simple,explode=false,name=userId"` } +func (o *ReadUserRequest) GetUserID() string { + if o == nil { + return "" + } + return o.UserID +} + type ReadUserResponse struct { - ContentType string + ContentType string + // Retrieved user ReadUserResponse *shared.ReadUserResponse StatusCode int RawResponse *http.Response } + +func (o *ReadUserResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadUserResponse) GetReadUserResponse() *shared.ReadUserResponse { + if o == nil { + return nil + } + return o.ReadUserResponse +} + +func (o *ReadUserResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadUserResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/resetconnector.go b/pkg/models/operations/resetconnector.go index 30709ba..b5a04a8 100755 --- a/pkg/models/operations/resetconnector.go +++ b/pkg/models/operations/resetconnector.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,7 +8,15 @@ import ( ) type ResetConnectorRequest struct { - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` +} + +func (o *ResetConnectorRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector } type ResetConnectorResponse struct { @@ -14,3 +24,24 @@ type ResetConnectorResponse struct { StatusCode int RawResponse *http.Response } + +func (o *ResetConnectorResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ResetConnectorResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ResetConnectorResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/reverttransaction.go b/pkg/models/operations/reverttransaction.go index 268f16a..d78de40 100755 --- a/pkg/models/operations/reverttransaction.go +++ b/pkg/models/operations/reverttransaction.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,67 @@ import ( ) type RevertTransactionRequest struct { + // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + // Transaction ID. + Txid int64 `pathParam:"style=simple,explode=false,name=txid"` +} + +func (o *RevertTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *RevertTransactionRequest) GetTxid() int64 { + if o == nil { + return 0 + } + return o.Txid } type RevertTransactionResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + StatusCode int + RawResponse *http.Response + // OK TransactionResponse *shared.TransactionResponse } + +func (o *RevertTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *RevertTransactionResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *RevertTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *RevertTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *RevertTransactionResponse) GetTransactionResponse() *shared.TransactionResponse { + if o == nil { + return nil + } + return o.TransactionResponse +} diff --git a/pkg/models/operations/runscript.go b/pkg/models/operations/runscript.go index 0a0eebc..7b38b08 100755 --- a/pkg/models/operations/runscript.go +++ b/pkg/models/operations/runscript.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,72 @@ import ( ) type RunScriptRequest struct { - Script shared.Script `request:"mediaType=application/json"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` - Preview *bool `queryParam:"style=form,explode=true,name=preview"` + Script shared.Script `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. + Preview *bool `queryParam:"style=form,explode=true,name=preview"` +} + +func (o *RunScriptRequest) GetScript() shared.Script { + if o == nil { + return shared.Script{} + } + return o.Script +} + +func (o *RunScriptRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *RunScriptRequest) GetPreview() *bool { + if o == nil { + return nil + } + return o.Preview } type RunScriptResponse struct { - ContentType string + ContentType string + // On success, it will return a 200 status code, and the resulting transaction under the `transaction` field. + // + // On failure, it will also return a 200 status code, and the following fields: + // - `details`: contains a URL. When there is an error parsing Numscript, the result can be difficult to read—the provided URL will render the error in an easy-to-read format. + // - `errorCode` and `error_code` (deprecated): contains the string code of the error + // - `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript. + // ScriptResponse *shared.ScriptResponse StatusCode int RawResponse *http.Response } + +func (o *RunScriptResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *RunScriptResponse) GetScriptResponse() *shared.ScriptResponse { + if o == nil { + return nil + } + return o.ScriptResponse +} + +func (o *RunScriptResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *RunScriptResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/runworkflow.go b/pkg/models/operations/runworkflow.go index c4e6e03..d443fce 100755 --- a/pkg/models/operations/runworkflow.go +++ b/pkg/models/operations/runworkflow.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,14 +9,74 @@ import ( type RunWorkflowRequest struct { RequestBody map[string]string `request:"mediaType=application/json"` - FlowID string `pathParam:"style=simple,explode=false,name=flowId"` - Wait *bool `queryParam:"style=form,explode=true,name=wait"` + // The flow id + FlowID string `pathParam:"style=simple,explode=false,name=flowId"` + // Wait end of the workflow before return + Wait *bool `queryParam:"style=form,explode=true,name=wait"` +} + +func (o *RunWorkflowRequest) GetRequestBody() map[string]string { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *RunWorkflowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + +func (o *RunWorkflowRequest) GetWait() *bool { + if o == nil { + return nil + } + return o.Wait } type RunWorkflowResponse struct { - ContentType string - Error *shared.Error + ContentType string + // General error + Error *shared.Error + // The workflow occurrence RunWorkflowResponse *shared.RunWorkflowResponse StatusCode int RawResponse *http.Response } + +func (o *RunWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *RunWorkflowResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *RunWorkflowResponse) GetRunWorkflowResponse() *shared.RunWorkflowResponse { + if o == nil { + return nil + } + return o.RunWorkflowResponse +} + +func (o *RunWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *RunWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/search.go b/pkg/models/operations/search.go index b322e08..45aff2e 100755 --- a/pkg/models/operations/search.go +++ b/pkg/models/operations/search.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,7 +9,36 @@ import ( type SearchResponse struct { ContentType string + // Success Response *shared.Response StatusCode int RawResponse *http.Response } + +func (o *SearchResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *SearchResponse) GetResponse() *shared.Response { + if o == nil { + return nil + } + return o.Response +} + +func (o *SearchResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *SearchResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/searchgetserverinfo.go b/pkg/models/operations/searchgetserverinfo.go index e0a7cb5..589d611 100755 --- a/pkg/models/operations/searchgetserverinfo.go +++ b/pkg/models/operations/searchgetserverinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,7 +9,36 @@ import ( type SearchgetServerInfoResponse struct { ContentType string + // Server information ServerInfo *shared.ServerInfo StatusCode int RawResponse *http.Response } + +func (o *SearchgetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *SearchgetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *SearchgetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *SearchgetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/testconfig.go b/pkg/models/operations/testconfig.go index 06a91e0..c630b0d 100755 --- a/pkg/models/operations/testconfig.go +++ b/pkg/models/operations/testconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,12 +8,49 @@ import ( ) type TestConfigRequest struct { + // Config ID ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *TestConfigRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type TestConfigResponse struct { + // OK AttemptResponse *shared.AttemptResponse ContentType string StatusCode int RawResponse *http.Response } + +func (o *TestConfigResponse) GetAttemptResponse() *shared.AttemptResponse { + if o == nil { + return nil + } + return o.AttemptResponse +} + +func (o *TestConfigResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *TestConfigResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *TestConfigResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/uninstallconnector.go b/pkg/models/operations/uninstallconnector.go index 829f909..9aece6f 100755 --- a/pkg/models/operations/uninstallconnector.go +++ b/pkg/models/operations/uninstallconnector.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,7 +8,15 @@ import ( ) type UninstallConnectorRequest struct { - Connector shared.ConnectorEnum `pathParam:"style=simple,explode=false,name=connector"` + // The name of the connector. + Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` +} + +func (o *UninstallConnectorRequest) GetConnector() shared.Connector { + if o == nil { + return shared.Connector("") + } + return o.Connector } type UninstallConnectorResponse struct { @@ -14,3 +24,24 @@ type UninstallConnectorResponse struct { StatusCode int RawResponse *http.Response } + +func (o *UninstallConnectorResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UninstallConnectorResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UninstallConnectorResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/updateclient.go b/pkg/models/operations/updateclient.go index a18e46d..3a0196f 100755 --- a/pkg/models/operations/updateclient.go +++ b/pkg/models/operations/updateclient.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,12 +9,56 @@ import ( type UpdateClientRequest struct { UpdateClientRequest *shared.UpdateClientRequest `request:"mediaType=application/json"` - ClientID string `pathParam:"style=simple,explode=false,name=clientId"` + // Client ID + ClientID string `pathParam:"style=simple,explode=false,name=clientId"` +} + +func (o *UpdateClientRequest) GetUpdateClientRequest() *shared.UpdateClientRequest { + if o == nil { + return nil + } + return o.UpdateClientRequest +} + +func (o *UpdateClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID } type UpdateClientResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Updated client UpdateClientResponse *shared.UpdateClientResponse } + +func (o *UpdateClientResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdateClientResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdateClientResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpdateClientResponse) GetUpdateClientResponse() *shared.UpdateClientResponse { + if o == nil { + return nil + } + return o.UpdateClientResponse +} diff --git a/pkg/models/operations/updatemapping.go b/pkg/models/operations/updatemapping.go index 1c490ed..65429b3 100755 --- a/pkg/models/operations/updatemapping.go +++ b/pkg/models/operations/updatemapping.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,14 +8,66 @@ import ( ) type UpdateMappingRequest struct { - Mapping shared.Mapping `request:"mediaType=application/json"` - Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Mapping *shared.Mapping `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *UpdateMappingRequest) GetMapping() *shared.Mapping { + if o == nil { + return nil + } + return o.Mapping +} + +func (o *UpdateMappingRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger } type UpdateMappingResponse struct { - ContentType string - ErrorResponse *shared.ErrorResponse + ContentType string + // Error + ErrorResponse *shared.ErrorResponse + // OK MappingResponse *shared.MappingResponse StatusCode int RawResponse *http.Response } + +func (o *UpdateMappingResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdateMappingResponse) GetErrorResponse() *shared.ErrorResponse { + if o == nil { + return nil + } + return o.ErrorResponse +} + +func (o *UpdateMappingResponse) GetMappingResponse() *shared.MappingResponse { + if o == nil { + return nil + } + return o.MappingResponse +} + +func (o *UpdateMappingResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdateMappingResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/updatescope.go b/pkg/models/operations/updatescope.go index 2676366..3bc14bd 100755 --- a/pkg/models/operations/updatescope.go +++ b/pkg/models/operations/updatescope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -7,12 +9,56 @@ import ( type UpdateScopeRequest struct { UpdateScopeRequest *shared.UpdateScopeRequest `request:"mediaType=application/json"` - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` + // Scope ID + ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` +} + +func (o *UpdateScopeRequest) GetUpdateScopeRequest() *shared.UpdateScopeRequest { + if o == nil { + return nil + } + return o.UpdateScopeRequest +} + +func (o *UpdateScopeRequest) GetScopeID() string { + if o == nil { + return "" + } + return o.ScopeID } type UpdateScopeResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Updated scope UpdateScopeResponse *shared.UpdateScopeResponse } + +func (o *UpdateScopeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdateScopeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdateScopeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpdateScopeResponse) GetUpdateScopeResponse() *shared.UpdateScopeResponse { + if o == nil { + return nil + } + return o.UpdateScopeResponse +} diff --git a/pkg/models/operations/updatewallet.go b/pkg/models/operations/updatewallet.go index 12ba43b..6c8852f 100755 --- a/pkg/models/operations/updatewallet.go +++ b/pkg/models/operations/updatewallet.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,17 +8,68 @@ import ( ) type UpdateWalletRequestBody struct { + // Custom metadata to attach to this wallet. Metadata map[string]interface{} `json:"metadata,omitempty"` } +func (o *UpdateWalletRequestBody) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + type UpdateWalletRequest struct { RequestBody *UpdateWalletRequestBody `request:"mediaType=application/json"` ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *UpdateWalletRequest) GetRequestBody() *UpdateWalletRequestBody { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *UpdateWalletRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type UpdateWalletResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *UpdateWalletResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdateWalletResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdateWalletResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpdateWalletResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/voidhold.go b/pkg/models/operations/voidhold.go index 872c6e1..90fd439 100755 --- a/pkg/models/operations/voidhold.go +++ b/pkg/models/operations/voidhold.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -9,9 +11,45 @@ type VoidHoldRequest struct { HoldID string `pathParam:"style=simple,explode=false,name=hold_id"` } +func (o *VoidHoldRequest) GetHoldID() string { + if o == nil { + return "" + } + return o.HoldID +} + type VoidHoldResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response + ContentType string + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *VoidHoldResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *VoidHoldResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *VoidHoldResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *VoidHoldResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/walletsgetserverinfo.go b/pkg/models/operations/walletsgetserverinfo.go index 613dcc9..15eb25c 100755 --- a/pkg/models/operations/walletsgetserverinfo.go +++ b/pkg/models/operations/walletsgetserverinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package operations import ( @@ -6,9 +8,46 @@ import ( ) type WalletsgetServerInfoResponse struct { - ContentType string - ServerInfo *shared.ServerInfo - StatusCode int - RawResponse *http.Response + ContentType string + // Server information + ServerInfo *shared.ServerInfo + StatusCode int + RawResponse *http.Response + // Error WalletsErrorResponse *shared.WalletsErrorResponse } + +func (o *WalletsgetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *WalletsgetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *WalletsgetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *WalletsgetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *WalletsgetServerInfoResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/sdkerrors/sdkerror.go b/pkg/models/sdkerrors/sdkerror.go new file mode 100755 index 0000000..5c1affd --- /dev/null +++ b/pkg/models/sdkerrors/sdkerror.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "fmt" + "net/http" +) + +type SDKError struct { + Message string + StatusCode int + Body string + RawResponse *http.Response +} + +var _ error = &SDKError{} + +func NewSDKError(message string, statusCode int, body string, httpRes *http.Response) *SDKError { + return &SDKError{ + Message: message, + StatusCode: statusCode, + Body: body, + RawResponse: httpRes, + } +} + +func (e *SDKError) Error() string { + body := "" + if len(e.Body) > 0 { + body = fmt.Sprintf("\n%s", e.Body) + } + + return fmt.Sprintf("%s: Status %d%s", e.Message, e.StatusCode, body) +} diff --git a/pkg/models/shared/account.go b/pkg/models/shared/account.go index 05d6a7d..c9ab67b 100755 --- a/pkg/models/shared/account.go +++ b/pkg/models/shared/account.go @@ -1,7 +1,33 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +type AccountMetadata struct { +} + type Account struct { - Address string `json:"address"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Type *string `json:"type,omitempty"` + Address string `json:"address"` + Metadata *AccountMetadata `json:"metadata,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *Account) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *Account) GetMetadata() *AccountMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Account) GetType() *string { + if o == nil { + return nil + } + return o.Type } diff --git a/pkg/models/shared/accountresponse.go b/pkg/models/shared/accountresponse.go index 202a9ee..f49384a 100755 --- a/pkg/models/shared/accountresponse.go +++ b/pkg/models/shared/accountresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AccountResponse struct { Data AccountWithVolumesAndBalances `json:"data"` } + +func (o *AccountResponse) GetData() AccountWithVolumesAndBalances { + if o == nil { + return AccountWithVolumesAndBalances{} + } + return o.Data +} diff --git a/pkg/models/shared/accountscursor.go b/pkg/models/shared/accountscursor.go index 89f52e9..3a585a4 100755 --- a/pkg/models/shared/accountscursor.go +++ b/pkg/models/shared/accountscursor.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AccountsCursorCursor struct { @@ -8,6 +10,48 @@ type AccountsCursorCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *AccountsCursorCursor) GetData() []PaymentsAccount { + if o == nil { + return []PaymentsAccount{} + } + return o.Data +} + +func (o *AccountsCursorCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *AccountsCursorCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *AccountsCursorCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *AccountsCursorCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type AccountsCursor struct { Cursor AccountsCursorCursor `json:"cursor"` } + +func (o *AccountsCursor) GetCursor() AccountsCursorCursor { + if o == nil { + return AccountsCursorCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/accountscursorresponse.go b/pkg/models/shared/accountscursorresponse.go index d9ba80d..4e748b9 100755 --- a/pkg/models/shared/accountscursorresponse.go +++ b/pkg/models/shared/accountscursorresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AccountsCursorResponseCursor struct { @@ -8,6 +10,48 @@ type AccountsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *AccountsCursorResponseCursor) GetData() []Account { + if o == nil { + return []Account{} + } + return o.Data +} + +func (o *AccountsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *AccountsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *AccountsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *AccountsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type AccountsCursorResponse struct { Cursor AccountsCursorResponseCursor `json:"cursor"` } + +func (o *AccountsCursorResponse) GetCursor() AccountsCursorResponseCursor { + if o == nil { + return AccountsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/accountwithvolumesandbalances.go b/pkg/models/shared/accountwithvolumesandbalances.go index 5e1adc4..16361bb 100755 --- a/pkg/models/shared/accountwithvolumesandbalances.go +++ b/pkg/models/shared/accountwithvolumesandbalances.go @@ -1,9 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +type AccountWithVolumesAndBalancesMetadata struct { +} + type AccountWithVolumesAndBalances struct { - Address string `json:"address"` - Balances map[string]int64 `json:"balances,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Type *string `json:"type,omitempty"` - Volumes map[string]map[string]int64 `json:"volumes,omitempty"` + Address string `json:"address"` + Balances map[string]int64 `json:"balances,omitempty"` + Metadata *AccountWithVolumesAndBalancesMetadata `json:"metadata,omitempty"` + Type *string `json:"type,omitempty"` + Volumes map[string]map[string]int64 `json:"volumes,omitempty"` +} + +func (o *AccountWithVolumesAndBalances) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *AccountWithVolumesAndBalances) GetBalances() map[string]int64 { + if o == nil { + return nil + } + return o.Balances +} + +func (o *AccountWithVolumesAndBalances) GetMetadata() *AccountWithVolumesAndBalancesMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *AccountWithVolumesAndBalances) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *AccountWithVolumesAndBalances) GetVolumes() map[string]map[string]int64 { + if o == nil { + return nil + } + return o.Volumes } diff --git a/pkg/models/shared/aggregatebalancesresponse.go b/pkg/models/shared/aggregatebalancesresponse.go index 6ead227..bddd515 100755 --- a/pkg/models/shared/aggregatebalancesresponse.go +++ b/pkg/models/shared/aggregatebalancesresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AggregateBalancesResponse struct { Data map[string]int64 `json:"data"` } + +func (o *AggregateBalancesResponse) GetData() map[string]int64 { + if o == nil { + return map[string]int64{} + } + return o.Data +} diff --git a/pkg/models/shared/assetholder.go b/pkg/models/shared/assetholder.go index 5f4f953..5457422 100755 --- a/pkg/models/shared/assetholder.go +++ b/pkg/models/shared/assetholder.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AssetHolder struct { Assets map[string]float64 `json:"assets"` } + +func (o *AssetHolder) GetAssets() map[string]float64 { + if o == nil { + return map[string]float64{} + } + return o.Assets +} diff --git a/pkg/models/shared/attempt.go b/pkg/models/shared/attempt.go new file mode 100755 index 0000000..9f939f9 --- /dev/null +++ b/pkg/models/shared/attempt.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "time" +) + +type Attempt struct { + Config *WebhooksConfig `json:"config,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + ID *string `json:"id,omitempty"` + NextRetryAfter *time.Time `json:"nextRetryAfter,omitempty"` + Payload *string `json:"payload,omitempty"` + RetryAttempt *int64 `json:"retryAttempt,omitempty"` + Status *string `json:"status,omitempty"` + StatusCode *int64 `json:"statusCode,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + WebhookID *string `json:"webhookID,omitempty"` +} + +func (a Attempt) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *Attempt) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Attempt) GetConfig() *WebhooksConfig { + if o == nil { + return nil + } + return o.Config +} + +func (o *Attempt) GetCreatedAt() *time.Time { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *Attempt) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Attempt) GetNextRetryAfter() *time.Time { + if o == nil { + return nil + } + return o.NextRetryAfter +} + +func (o *Attempt) GetPayload() *string { + if o == nil { + return nil + } + return o.Payload +} + +func (o *Attempt) GetRetryAttempt() *int64 { + if o == nil { + return nil + } + return o.RetryAttempt +} + +func (o *Attempt) GetStatus() *string { + if o == nil { + return nil + } + return o.Status +} + +func (o *Attempt) GetStatusCode() *int64 { + if o == nil { + return nil + } + return o.StatusCode +} + +func (o *Attempt) GetUpdatedAt() *time.Time { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *Attempt) GetWebhookID() *string { + if o == nil { + return nil + } + return o.WebhookID +} diff --git a/pkg/models/shared/attemptresponse.go b/pkg/models/shared/attemptresponse.go index 9ae7acd..3d1c8ee 100755 --- a/pkg/models/shared/attemptresponse.go +++ b/pkg/models/shared/attemptresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type AttemptResponse struct { - Data interface{} `json:"data"` + Data Attempt `json:"data"` +} + +func (o *AttemptResponse) GetData() Attempt { + if o == nil { + return Attempt{} + } + return o.Data } diff --git a/pkg/models/shared/balance.go b/pkg/models/shared/balance.go index e8c92db..9772d28 100755 --- a/pkg/models/shared/balance.go +++ b/pkg/models/shared/balance.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Balance struct { Name string `json:"name"` } + +func (o *Balance) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/balancescursorresponse.go b/pkg/models/shared/balancescursorresponse.go index 1510be0..f88267a 100755 --- a/pkg/models/shared/balancescursorresponse.go +++ b/pkg/models/shared/balancescursorresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type BalancesCursorResponseCursor struct { @@ -8,6 +10,48 @@ type BalancesCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *BalancesCursorResponseCursor) GetData() []map[string]map[string]int64 { + if o == nil { + return []map[string]map[string]int64{} + } + return o.Data +} + +func (o *BalancesCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *BalancesCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *BalancesCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *BalancesCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type BalancesCursorResponse struct { Cursor BalancesCursorResponseCursor `json:"cursor"` } + +func (o *BalancesCursorResponse) GetCursor() BalancesCursorResponseCursor { + if o == nil { + return BalancesCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/balancewithassets.go b/pkg/models/shared/balancewithassets.go index 66912b6..5666248 100755 --- a/pkg/models/shared/balancewithassets.go +++ b/pkg/models/shared/balancewithassets.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type BalanceWithAssets struct { Assets map[string]float64 `json:"assets"` Name string `json:"name"` } + +func (o *BalanceWithAssets) GetAssets() map[string]float64 { + if o == nil { + return map[string]float64{} + } + return o.Assets +} + +func (o *BalanceWithAssets) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/bankingcircleconfig.go b/pkg/models/shared/bankingcircleconfig.go index f1dd43a..a034022 100755 --- a/pkg/models/shared/bankingcircleconfig.go +++ b/pkg/models/shared/bankingcircleconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type BankingCircleConfig struct { @@ -6,3 +8,31 @@ type BankingCircleConfig struct { Password string `json:"password"` Username string `json:"username"` } + +func (o *BankingCircleConfig) GetAuthorizationEndpoint() string { + if o == nil { + return "" + } + return o.AuthorizationEndpoint +} + +func (o *BankingCircleConfig) GetEndpoint() string { + if o == nil { + return "" + } + return o.Endpoint +} + +func (o *BankingCircleConfig) GetPassword() string { + if o == nil { + return "" + } + return o.Password +} + +func (o *BankingCircleConfig) GetUsername() string { + if o == nil { + return "" + } + return o.Username +} diff --git a/pkg/models/shared/client.go b/pkg/models/shared/client.go index a1d609c..54ddd37 100755 --- a/pkg/models/shared/client.go +++ b/pkg/models/shared/client.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Client struct { @@ -12,3 +14,73 @@ type Client struct { Secrets []ClientSecret `json:"secrets,omitempty"` Trusted *bool `json:"trusted,omitempty"` } + +func (o *Client) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Client) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Client) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Client) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Client) GetPostLogoutRedirectUris() []string { + if o == nil { + return nil + } + return o.PostLogoutRedirectUris +} + +func (o *Client) GetPublic() *bool { + if o == nil { + return nil + } + return o.Public +} + +func (o *Client) GetRedirectUris() []string { + if o == nil { + return nil + } + return o.RedirectUris +} + +func (o *Client) GetScopes() []string { + if o == nil { + return nil + } + return o.Scopes +} + +func (o *Client) GetSecrets() []ClientSecret { + if o == nil { + return nil + } + return o.Secrets +} + +func (o *Client) GetTrusted() *bool { + if o == nil { + return nil + } + return o.Trusted +} diff --git a/pkg/models/shared/clientsecret.go b/pkg/models/shared/clientsecret.go index 34ee23e..1d602c2 100755 --- a/pkg/models/shared/clientsecret.go +++ b/pkg/models/shared/clientsecret.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ClientSecret struct { @@ -6,3 +8,31 @@ type ClientSecret struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Name string `json:"name"` } + +func (o *ClientSecret) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ClientSecret) GetLastDigits() string { + if o == nil { + return "" + } + return o.LastDigits +} + +func (o *ClientSecret) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ClientSecret) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/config.go b/pkg/models/shared/config.go index 6a65acd..ee902b8 100755 --- a/pkg/models/shared/config.go +++ b/pkg/models/shared/config.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Config struct { Storage LedgerStorage `json:"storage"` } + +func (o *Config) GetStorage() LedgerStorage { + if o == nil { + return LedgerStorage{} + } + return o.Storage +} diff --git a/pkg/models/shared/configchangesecret.go b/pkg/models/shared/configchangesecret.go index 4c6b316..5abc1f7 100755 --- a/pkg/models/shared/configchangesecret.go +++ b/pkg/models/shared/configchangesecret.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigChangeSecret struct { Secret *string `json:"secret,omitempty"` } + +func (o *ConfigChangeSecret) GetSecret() *string { + if o == nil { + return nil + } + return o.Secret +} diff --git a/pkg/models/shared/configinfo.go b/pkg/models/shared/configinfo.go index b616460..3ea9452 100755 --- a/pkg/models/shared/configinfo.go +++ b/pkg/models/shared/configinfo.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigInfo struct { @@ -5,3 +7,24 @@ type ConfigInfo struct { Server string `json:"server"` Version string `json:"version"` } + +func (o *ConfigInfo) GetConfig() Config { + if o == nil { + return Config{} + } + return o.Config +} + +func (o *ConfigInfo) GetServer() string { + if o == nil { + return "" + } + return o.Server +} + +func (o *ConfigInfo) GetVersion() string { + if o == nil { + return "" + } + return o.Version +} diff --git a/pkg/models/shared/configinforesponse.go b/pkg/models/shared/configinforesponse.go index 733fe2f..1ffc24a 100755 --- a/pkg/models/shared/configinforesponse.go +++ b/pkg/models/shared/configinforesponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigInfoResponse struct { Data ConfigInfo `json:"data"` } + +func (o *ConfigInfoResponse) GetData() ConfigInfo { + if o == nil { + return ConfigInfo{} + } + return o.Data +} diff --git a/pkg/models/shared/configresponse.go b/pkg/models/shared/configresponse.go index 218a332..3be0a42 100755 --- a/pkg/models/shared/configresponse.go +++ b/pkg/models/shared/configresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigResponse struct { - Data interface{} `json:"data"` + Data WebhooksConfig `json:"data"` +} + +func (o *ConfigResponse) GetData() WebhooksConfig { + if o == nil { + return WebhooksConfig{} + } + return o.Data } diff --git a/pkg/models/shared/configsresponse.go b/pkg/models/shared/configsresponse.go index 8d0985d..30d8ed1 100755 --- a/pkg/models/shared/configsresponse.go +++ b/pkg/models/shared/configsresponse.go @@ -1,13 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigsResponseCursor struct { - Data []interface{} `json:"data"` - HasMore *bool `json:"hasMore,omitempty"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` + Data []WebhooksConfig `json:"data"` + HasMore *bool `json:"hasMore,omitempty"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *ConfigsResponseCursor) GetData() []WebhooksConfig { + if o == nil { + return []WebhooksConfig{} + } + return o.Data +} + +func (o *ConfigsResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *ConfigsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ConfigsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ConfigsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous } type ConfigsResponse struct { Cursor ConfigsResponseCursor `json:"cursor"` } + +func (o *ConfigsResponse) GetCursor() ConfigsResponseCursor { + if o == nil { + return ConfigsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/configuser.go b/pkg/models/shared/configuser.go index 533e6d9..8f37fd3 100755 --- a/pkg/models/shared/configuser.go +++ b/pkg/models/shared/configuser.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfigUser struct { @@ -5,3 +7,24 @@ type ConfigUser struct { EventTypes []string `json:"eventTypes"` Secret *string `json:"secret,omitempty"` } + +func (o *ConfigUser) GetEndpoint() string { + if o == nil { + return "" + } + return o.Endpoint +} + +func (o *ConfigUser) GetEventTypes() []string { + if o == nil { + return []string{} + } + return o.EventTypes +} + +func (o *ConfigUser) GetSecret() *string { + if o == nil { + return nil + } + return o.Secret +} diff --git a/pkg/models/shared/confirmholdrequest.go b/pkg/models/shared/confirmholdrequest.go index 0133bcb..ffefdf6 100755 --- a/pkg/models/shared/confirmholdrequest.go +++ b/pkg/models/shared/confirmholdrequest.go @@ -1,6 +1,24 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConfirmHoldRequest struct { + // Define the amount to transfer. Amount *int64 `json:"amount,omitempty"` - Final *bool `json:"final,omitempty"` + // Define a final confirmation. Remaining funds will be returned to the wallet. + Final *bool `json:"final,omitempty"` +} + +func (o *ConfirmHoldRequest) GetAmount() *int64 { + if o == nil { + return nil + } + return o.Amount +} + +func (o *ConfirmHoldRequest) GetFinal() *bool { + if o == nil { + return nil + } + return o.Final } diff --git a/pkg/models/shared/connector.go b/pkg/models/shared/connector.go new file mode 100755 index 0000000..d4ddc38 --- /dev/null +++ b/pkg/models/shared/connector.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type Connector string + +const ( + ConnectorStripe Connector = "STRIPE" + ConnectorDummyPay Connector = "DUMMY-PAY" + ConnectorWise Connector = "WISE" + ConnectorModulr Connector = "MODULR" + ConnectorCurrencyCloud Connector = "CURRENCY-CLOUD" + ConnectorBankingCircle Connector = "BANKING-CIRCLE" +) + +func (e Connector) ToPointer() *Connector { + return &e +} + +func (e *Connector) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "STRIPE": + fallthrough + case "DUMMY-PAY": + fallthrough + case "WISE": + fallthrough + case "MODULR": + fallthrough + case "CURRENCY-CLOUD": + fallthrough + case "BANKING-CIRCLE": + *e = Connector(v) + return nil + default: + return fmt.Errorf("invalid value for Connector: %v", v) + } +} diff --git a/pkg/models/shared/connectorconfig.go b/pkg/models/shared/connectorconfig.go new file mode 100755 index 0000000..df1609f --- /dev/null +++ b/pkg/models/shared/connectorconfig.go @@ -0,0 +1,159 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "errors" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + +type ConnectorConfigType string + +const ( + ConnectorConfigTypeStripeConfig ConnectorConfigType = "StripeConfig" + ConnectorConfigTypeDummyPayConfig ConnectorConfigType = "DummyPayConfig" + ConnectorConfigTypeWiseConfig ConnectorConfigType = "WiseConfig" + ConnectorConfigTypeModulrConfig ConnectorConfigType = "ModulrConfig" + ConnectorConfigTypeCurrencyCloudConfig ConnectorConfigType = "CurrencyCloudConfig" + ConnectorConfigTypeBankingCircleConfig ConnectorConfigType = "BankingCircleConfig" +) + +type ConnectorConfig struct { + StripeConfig *StripeConfig + DummyPayConfig *DummyPayConfig + WiseConfig *WiseConfig + ModulrConfig *ModulrConfig + CurrencyCloudConfig *CurrencyCloudConfig + BankingCircleConfig *BankingCircleConfig + + Type ConnectorConfigType +} + +func CreateConnectorConfigStripeConfig(stripeConfig StripeConfig) ConnectorConfig { + typ := ConnectorConfigTypeStripeConfig + + return ConnectorConfig{ + StripeConfig: &stripeConfig, + Type: typ, + } +} + +func CreateConnectorConfigDummyPayConfig(dummyPayConfig DummyPayConfig) ConnectorConfig { + typ := ConnectorConfigTypeDummyPayConfig + + return ConnectorConfig{ + DummyPayConfig: &dummyPayConfig, + Type: typ, + } +} + +func CreateConnectorConfigWiseConfig(wiseConfig WiseConfig) ConnectorConfig { + typ := ConnectorConfigTypeWiseConfig + + return ConnectorConfig{ + WiseConfig: &wiseConfig, + Type: typ, + } +} + +func CreateConnectorConfigModulrConfig(modulrConfig ModulrConfig) ConnectorConfig { + typ := ConnectorConfigTypeModulrConfig + + return ConnectorConfig{ + ModulrConfig: &modulrConfig, + Type: typ, + } +} + +func CreateConnectorConfigCurrencyCloudConfig(currencyCloudConfig CurrencyCloudConfig) ConnectorConfig { + typ := ConnectorConfigTypeCurrencyCloudConfig + + return ConnectorConfig{ + CurrencyCloudConfig: ¤cyCloudConfig, + Type: typ, + } +} + +func CreateConnectorConfigBankingCircleConfig(bankingCircleConfig BankingCircleConfig) ConnectorConfig { + typ := ConnectorConfigTypeBankingCircleConfig + + return ConnectorConfig{ + BankingCircleConfig: &bankingCircleConfig, + Type: typ, + } +} + +func (u *ConnectorConfig) UnmarshalJSON(data []byte) error { + + wiseConfig := new(WiseConfig) + if err := utils.UnmarshalJSON(data, &wiseConfig, "", true, true); err == nil { + u.WiseConfig = wiseConfig + u.Type = ConnectorConfigTypeWiseConfig + return nil + } + + stripeConfig := new(StripeConfig) + if err := utils.UnmarshalJSON(data, &stripeConfig, "", true, true); err == nil { + u.StripeConfig = stripeConfig + u.Type = ConnectorConfigTypeStripeConfig + return nil + } + + dummyPayConfig := new(DummyPayConfig) + if err := utils.UnmarshalJSON(data, &dummyPayConfig, "", true, true); err == nil { + u.DummyPayConfig = dummyPayConfig + u.Type = ConnectorConfigTypeDummyPayConfig + return nil + } + + modulrConfig := new(ModulrConfig) + if err := utils.UnmarshalJSON(data, &modulrConfig, "", true, true); err == nil { + u.ModulrConfig = modulrConfig + u.Type = ConnectorConfigTypeModulrConfig + return nil + } + + currencyCloudConfig := new(CurrencyCloudConfig) + if err := utils.UnmarshalJSON(data, ¤cyCloudConfig, "", true, true); err == nil { + u.CurrencyCloudConfig = currencyCloudConfig + u.Type = ConnectorConfigTypeCurrencyCloudConfig + return nil + } + + bankingCircleConfig := new(BankingCircleConfig) + if err := utils.UnmarshalJSON(data, &bankingCircleConfig, "", true, true); err == nil { + u.BankingCircleConfig = bankingCircleConfig + u.Type = ConnectorConfigTypeBankingCircleConfig + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u ConnectorConfig) MarshalJSON() ([]byte, error) { + if u.StripeConfig != nil { + return utils.MarshalJSON(u.StripeConfig, "", true) + } + + if u.DummyPayConfig != nil { + return utils.MarshalJSON(u.DummyPayConfig, "", true) + } + + if u.WiseConfig != nil { + return utils.MarshalJSON(u.WiseConfig, "", true) + } + + if u.ModulrConfig != nil { + return utils.MarshalJSON(u.ModulrConfig, "", true) + } + + if u.CurrencyCloudConfig != nil { + return utils.MarshalJSON(u.CurrencyCloudConfig, "", true) + } + + if u.BankingCircleConfig != nil { + return utils.MarshalJSON(u.BankingCircleConfig, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/connectorconfigresponse.go b/pkg/models/shared/connectorconfigresponse.go index 59084b4..be78fc0 100755 --- a/pkg/models/shared/connectorconfigresponse.go +++ b/pkg/models/shared/connectorconfigresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConnectorConfigResponse struct { - Data interface{} `json:"data"` + Data ConnectorConfig `json:"data"` +} + +func (o *ConnectorConfigResponse) GetData() ConnectorConfig { + if o == nil { + return ConnectorConfig{} + } + return o.Data } diff --git a/pkg/models/shared/connectorenum.go b/pkg/models/shared/connectorenum.go deleted file mode 100755 index 492076f..0000000 --- a/pkg/models/shared/connectorenum.go +++ /dev/null @@ -1,12 +0,0 @@ -package shared - -type ConnectorEnum string - -const ( - ConnectorEnumStripe ConnectorEnum = "STRIPE" - ConnectorEnumDummyPay ConnectorEnum = "DUMMY-PAY" - ConnectorEnumWise ConnectorEnum = "WISE" - ConnectorEnumModulr ConnectorEnum = "MODULR" - ConnectorEnumCurrencyCloud ConnectorEnum = "CURRENCY-CLOUD" - ConnectorEnumBankingCircle ConnectorEnum = "BANKING-CIRCLE" -) diff --git a/pkg/models/shared/connectorsconfigsresponse.go b/pkg/models/shared/connectorsconfigsresponse.go index 78313d2..e62e868 100755 --- a/pkg/models/shared/connectorsconfigsresponse.go +++ b/pkg/models/shared/connectorsconfigsresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConnectorsConfigsResponseDataConnectorKey struct { @@ -5,14 +7,49 @@ type ConnectorsConfigsResponseDataConnectorKey struct { Required bool `json:"required"` } +func (o *ConnectorsConfigsResponseDataConnectorKey) GetDataType() string { + if o == nil { + return "" + } + return o.DataType +} + +func (o *ConnectorsConfigsResponseDataConnectorKey) GetRequired() bool { + if o == nil { + return false + } + return o.Required +} + type ConnectorsConfigsResponseDataConnector struct { Key ConnectorsConfigsResponseDataConnectorKey `json:"key"` } +func (o *ConnectorsConfigsResponseDataConnector) GetKey() ConnectorsConfigsResponseDataConnectorKey { + if o == nil { + return ConnectorsConfigsResponseDataConnectorKey{} + } + return o.Key +} + type ConnectorsConfigsResponseData struct { Connector ConnectorsConfigsResponseDataConnector `json:"connector"` } +func (o *ConnectorsConfigsResponseData) GetConnector() ConnectorsConfigsResponseDataConnector { + if o == nil { + return ConnectorsConfigsResponseDataConnector{} + } + return o.Connector +} + type ConnectorsConfigsResponse struct { Data ConnectorsConfigsResponseData `json:"data"` } + +func (o *ConnectorsConfigsResponse) GetData() ConnectorsConfigsResponseData { + if o == nil { + return ConnectorsConfigsResponseData{} + } + return o.Data +} diff --git a/pkg/models/shared/connectorsresponse.go b/pkg/models/shared/connectorsresponse.go index e53f4f6..2a801db 100755 --- a/pkg/models/shared/connectorsresponse.go +++ b/pkg/models/shared/connectorsresponse.go @@ -1,10 +1,33 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ConnectorsResponseData struct { - Enabled *bool `json:"enabled,omitempty"` - Provider *ConnectorEnum `json:"provider,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Provider *Connector `json:"provider,omitempty"` +} + +func (o *ConnectorsResponseData) GetEnabled() *bool { + if o == nil { + return nil + } + return o.Enabled +} + +func (o *ConnectorsResponseData) GetProvider() *Connector { + if o == nil { + return nil + } + return o.Provider } type ConnectorsResponse struct { Data []ConnectorsResponseData `json:"data"` } + +func (o *ConnectorsResponse) GetData() []ConnectorsResponseData { + if o == nil { + return []ConnectorsResponseData{} + } + return o.Data +} diff --git a/pkg/models/shared/contract.go b/pkg/models/shared/contract.go index 349a1f6..1166b48 100755 --- a/pkg/models/shared/contract.go +++ b/pkg/models/shared/contract.go @@ -1,6 +1,25 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +type ContractExpr struct { +} + type Contract struct { - Account *string `json:"account,omitempty"` - Expr map[string]interface{} `json:"expr"` + Account *string `json:"account,omitempty"` + Expr ContractExpr `json:"expr"` +} + +func (o *Contract) GetAccount() *string { + if o == nil { + return nil + } + return o.Account +} + +func (o *Contract) GetExpr() ContractExpr { + if o == nil { + return ContractExpr{} + } + return o.Expr } diff --git a/pkg/models/shared/createbalancerequest.go b/pkg/models/shared/createbalancerequest.go index c2cb41c..bdbe410 100755 --- a/pkg/models/shared/createbalancerequest.go +++ b/pkg/models/shared/createbalancerequest.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateBalanceRequest struct { Name string `json:"name"` } + +func (o *CreateBalanceRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/createbalanceresponse.go b/pkg/models/shared/createbalanceresponse.go index fe16b2b..197672b 100755 --- a/pkg/models/shared/createbalanceresponse.go +++ b/pkg/models/shared/createbalanceresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateBalanceResponse struct { Data Balance `json:"data"` } + +func (o *CreateBalanceResponse) GetData() Balance { + if o == nil { + return Balance{} + } + return o.Data +} diff --git a/pkg/models/shared/createclientrequest.go b/pkg/models/shared/createclientrequest.go index 3de1e52..9bf5269 100755 --- a/pkg/models/shared/createclientrequest.go +++ b/pkg/models/shared/createclientrequest.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateClientRequest struct { @@ -9,3 +11,52 @@ type CreateClientRequest struct { RedirectUris []string `json:"redirectUris,omitempty"` Trusted *bool `json:"trusted,omitempty"` } + +func (o *CreateClientRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CreateClientRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CreateClientRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *CreateClientRequest) GetPostLogoutRedirectUris() []string { + if o == nil { + return nil + } + return o.PostLogoutRedirectUris +} + +func (o *CreateClientRequest) GetPublic() *bool { + if o == nil { + return nil + } + return o.Public +} + +func (o *CreateClientRequest) GetRedirectUris() []string { + if o == nil { + return nil + } + return o.RedirectUris +} + +func (o *CreateClientRequest) GetTrusted() *bool { + if o == nil { + return nil + } + return o.Trusted +} diff --git a/pkg/models/shared/createclientresponse.go b/pkg/models/shared/createclientresponse.go index f7c468b..9b2ead4 100755 --- a/pkg/models/shared/createclientresponse.go +++ b/pkg/models/shared/createclientresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateClientResponse struct { Data *Client `json:"data,omitempty"` } + +func (o *CreateClientResponse) GetData() *Client { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/createscoperequest.go b/pkg/models/shared/createscoperequest.go index 471b78c..2320425 100755 --- a/pkg/models/shared/createscoperequest.go +++ b/pkg/models/shared/createscoperequest.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateScopeRequest struct { Label string `json:"label"` Metadata map[string]interface{} `json:"metadata,omitempty"` } + +func (o *CreateScopeRequest) GetLabel() string { + if o == nil { + return "" + } + return o.Label +} + +func (o *CreateScopeRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/pkg/models/shared/createscoperesponse.go b/pkg/models/shared/createscoperesponse.go index 0813c5b..9acadef 100755 --- a/pkg/models/shared/createscoperesponse.go +++ b/pkg/models/shared/createscoperesponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateScopeResponse struct { Data *Scope `json:"data,omitempty"` } + +func (o *CreateScopeResponse) GetData() *Scope { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/createsecretrequest.go b/pkg/models/shared/createsecretrequest.go index 2447140..bb92766 100755 --- a/pkg/models/shared/createsecretrequest.go +++ b/pkg/models/shared/createsecretrequest.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateSecretRequest struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Name string `json:"name"` } + +func (o *CreateSecretRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CreateSecretRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/createsecretresponse.go b/pkg/models/shared/createsecretresponse.go index 362c957..b663b5a 100755 --- a/pkg/models/shared/createsecretresponse.go +++ b/pkg/models/shared/createsecretresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateSecretResponse struct { Data *Secret `json:"data,omitempty"` } + +func (o *CreateSecretResponse) GetData() *Secret { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/createwalletrequest.go b/pkg/models/shared/createwalletrequest.go index e75abc4..695f1b9 100755 --- a/pkg/models/shared/createwalletrequest.go +++ b/pkg/models/shared/createwalletrequest.go @@ -1,6 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateWalletRequest struct { + // Custom metadata to attach to this wallet. Metadata map[string]interface{} `json:"metadata,omitempty"` Name string `json:"name"` } + +func (o *CreateWalletRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CreateWalletRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/createwalletresponse.go b/pkg/models/shared/createwalletresponse.go index 2ba46a4..e7ac9d5 100755 --- a/pkg/models/shared/createwalletresponse.go +++ b/pkg/models/shared/createwalletresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateWalletResponse struct { Data Wallet `json:"data"` } + +func (o *CreateWalletResponse) GetData() Wallet { + if o == nil { + return Wallet{} + } + return o.Data +} diff --git a/pkg/models/shared/createworkflowrequest.go b/pkg/models/shared/createworkflowrequest.go index ab190f8..e5c4e49 100755 --- a/pkg/models/shared/createworkflowrequest.go +++ b/pkg/models/shared/createworkflowrequest.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateWorkflowRequest struct { Stages []map[string]interface{} `json:"stages"` } + +func (o *CreateWorkflowRequest) GetStages() []map[string]interface{} { + if o == nil { + return []map[string]interface{}{} + } + return o.Stages +} diff --git a/pkg/models/shared/createworkflowresponse.go b/pkg/models/shared/createworkflowresponse.go index cd6336f..6a075a6 100755 --- a/pkg/models/shared/createworkflowresponse.go +++ b/pkg/models/shared/createworkflowresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreateWorkflowResponse struct { Data Workflow `json:"data"` } + +func (o *CreateWorkflowResponse) GetData() Workflow { + if o == nil { + return Workflow{} + } + return o.Data +} diff --git a/pkg/models/shared/creditwalletrequest.go b/pkg/models/shared/creditwalletrequest.go index 65e62fe..c95b9d7 100755 --- a/pkg/models/shared/creditwalletrequest.go +++ b/pkg/models/shared/creditwalletrequest.go @@ -1,9 +1,48 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CreditWalletRequest struct { - Amount Monetary `json:"amount"` - Balance *string `json:"balance,omitempty"` + Amount Monetary `json:"amount"` + // The balance to credit + Balance *string `json:"balance,omitempty"` + // Metadata associated with the wallet. Metadata map[string]interface{} `json:"metadata,omitempty"` Reference *string `json:"reference,omitempty"` - Sources []interface{} `json:"sources"` + Sources []Subject `json:"sources"` +} + +func (o *CreditWalletRequest) GetAmount() Monetary { + if o == nil { + return Monetary{} + } + return o.Amount +} + +func (o *CreditWalletRequest) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *CreditWalletRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CreditWalletRequest) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *CreditWalletRequest) GetSources() []Subject { + if o == nil { + return []Subject{} + } + return o.Sources } diff --git a/pkg/models/shared/currencycloudconfig.go b/pkg/models/shared/currencycloudconfig.go index 6ef2a45..efd31a6 100755 --- a/pkg/models/shared/currencycloudconfig.go +++ b/pkg/models/shared/currencycloudconfig.go @@ -1,8 +1,41 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type CurrencyCloudConfig struct { - APIKey string `json:"apiKey"` - Endpoint *string `json:"endpoint,omitempty"` - LoginID string `json:"loginID"` + APIKey string `json:"apiKey"` + // The endpoint to use for the API. Defaults to https://devapi.currencycloud.com + Endpoint *string `json:"endpoint,omitempty"` + // Username of the API Key holder + LoginID string `json:"loginID"` + // The frequency at which the connector will fetch transactions PollingPeriod *string `json:"pollingPeriod,omitempty"` } + +func (o *CurrencyCloudConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *CurrencyCloudConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *CurrencyCloudConfig) GetLoginID() string { + if o == nil { + return "" + } + return o.LoginID +} + +func (o *CurrencyCloudConfig) GetPollingPeriod() *string { + if o == nil { + return nil + } + return o.PollingPeriod +} diff --git a/pkg/models/shared/debitwalletrequest.go b/pkg/models/shared/debitwalletrequest.go index 528eccd..a203202 100755 --- a/pkg/models/shared/debitwalletrequest.go +++ b/pkg/models/shared/debitwalletrequest.go @@ -1,10 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type DebitWalletRequest struct { - Amount Monetary `json:"amount"` - Balances []string `json:"balances,omitempty"` - Description *string `json:"description,omitempty"` - Destination interface{} `json:"destination,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Pending *bool `json:"pending,omitempty"` + Amount Monetary `json:"amount"` + Balances []string `json:"balances,omitempty"` + Description *string `json:"description,omitempty"` + Destination *Subject `json:"destination,omitempty"` + // Metadata associated with the wallet. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Set to true to create a pending hold. If false, the wallet will be debited immediately. + Pending *bool `json:"pending,omitempty"` +} + +func (o *DebitWalletRequest) GetAmount() Monetary { + if o == nil { + return Monetary{} + } + return o.Amount +} + +func (o *DebitWalletRequest) GetBalances() []string { + if o == nil { + return nil + } + return o.Balances +} + +func (o *DebitWalletRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *DebitWalletRequest) GetDestination() *Subject { + if o == nil { + return nil + } + return o.Destination +} + +func (o *DebitWalletRequest) GetDestinationAccount() *LedgerAccountSubject { + if v := o.GetDestination(); v != nil { + return v.LedgerAccountSubject + } + return nil +} + +func (o *DebitWalletRequest) GetDestinationWallet() *WalletSubject { + if v := o.GetDestination(); v != nil { + return v.WalletSubject + } + return nil +} + +func (o *DebitWalletRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *DebitWalletRequest) GetPending() *bool { + if o == nil { + return nil + } + return o.Pending } diff --git a/pkg/models/shared/debitwalletresponse.go b/pkg/models/shared/debitwalletresponse.go index c75764b..1b9a8a5 100755 --- a/pkg/models/shared/debitwalletresponse.go +++ b/pkg/models/shared/debitwalletresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type DebitWalletResponse struct { Data Hold `json:"data"` } + +func (o *DebitWalletResponse) GetData() Hold { + if o == nil { + return Hold{} + } + return o.Data +} diff --git a/pkg/models/shared/dummypayconfig.go b/pkg/models/shared/dummypayconfig.go index 5aa1a51..1f0ce5c 100755 --- a/pkg/models/shared/dummypayconfig.go +++ b/pkg/models/shared/dummypayconfig.go @@ -1,7 +1,47 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + type DummyPayConfig struct { - Directory string `json:"directory"` - FileGenerationPeriod *string `json:"fileGenerationPeriod,omitempty"` - FilePollingPeriod *string `json:"filePollingPeriod,omitempty"` + Directory string `json:"directory"` + // The frequency at which the connector will create new payment objects in the directory + FileGenerationPeriod *string `default:"10s" json:"fileGenerationPeriod"` + // The frequency at which the connector will try to fetch new payment objects from the directory + FilePollingPeriod *string `default:"10s" json:"filePollingPeriod"` +} + +func (d DummyPayConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DummyPayConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, true); err != nil { + return err + } + return nil +} + +func (o *DummyPayConfig) GetDirectory() string { + if o == nil { + return "" + } + return o.Directory +} + +func (o *DummyPayConfig) GetFileGenerationPeriod() *string { + if o == nil { + return nil + } + return o.FileGenerationPeriod +} + +func (o *DummyPayConfig) GetFilePollingPeriod() *string { + if o == nil { + return nil + } + return o.FilePollingPeriod } diff --git a/pkg/models/shared/error.go b/pkg/models/shared/error.go index 84c6b82..03180f0 100755 --- a/pkg/models/shared/error.go +++ b/pkg/models/shared/error.go @@ -1,12 +1,34 @@ -package shared +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -type ErrorErrorCodeEnum string +package shared -const ( - ErrorErrorCodeEnumValidation ErrorErrorCodeEnum = "VALIDATION" +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" ) type Error struct { - ErrorCode ErrorErrorCodeEnum `json:"errorCode"` - ErrorMessage string `json:"errorMessage"` + errorCode string `const:"VALIDATION" json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (e Error) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *Error) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Error) GetErrorCode() string { + return "VALIDATION" +} + +func (o *Error) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage } diff --git a/pkg/models/shared/errorresponse.go b/pkg/models/shared/errorresponse.go index 34244fc..05e0743 100755 --- a/pkg/models/shared/errorresponse.go +++ b/pkg/models/shared/errorresponse.go @@ -1,7 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ErrorResponse struct { - Details *string `json:"details,omitempty"` - ErrorCode *ErrorsEnumEnum `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` + Details *string `json:"details,omitempty"` + ErrorCode *ErrorsEnum `json:"errorCode,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +func (o *ErrorResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *ErrorResponse) GetErrorCode() *ErrorsEnum { + if o == nil { + return nil + } + return o.ErrorCode +} + +func (o *ErrorResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage } diff --git a/pkg/models/shared/errorsenum.go b/pkg/models/shared/errorsenum.go new file mode 100755 index 0000000..f930c85 --- /dev/null +++ b/pkg/models/shared/errorsenum.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type ErrorsEnum string + +const ( + ErrorsEnumInternal ErrorsEnum = "INTERNAL" + ErrorsEnumInsufficientFund ErrorsEnum = "INSUFFICIENT_FUND" + ErrorsEnumValidation ErrorsEnum = "VALIDATION" + ErrorsEnumConflict ErrorsEnum = "CONFLICT" + ErrorsEnumNoScript ErrorsEnum = "NO_SCRIPT" + ErrorsEnumCompilationFailed ErrorsEnum = "COMPILATION_FAILED" + ErrorsEnumMetadataOverride ErrorsEnum = "METADATA_OVERRIDE" +) + +func (e ErrorsEnum) ToPointer() *ErrorsEnum { + return &e +} + +func (e *ErrorsEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "INTERNAL": + fallthrough + case "INSUFFICIENT_FUND": + fallthrough + case "VALIDATION": + fallthrough + case "CONFLICT": + fallthrough + case "NO_SCRIPT": + fallthrough + case "COMPILATION_FAILED": + fallthrough + case "METADATA_OVERRIDE": + *e = ErrorsEnum(v) + return nil + default: + return fmt.Errorf("invalid value for ErrorsEnum: %v", v) + } +} diff --git a/pkg/models/shared/errorsenumenum.go b/pkg/models/shared/errorsenumenum.go deleted file mode 100755 index 5df135b..0000000 --- a/pkg/models/shared/errorsenumenum.go +++ /dev/null @@ -1,13 +0,0 @@ -package shared - -type ErrorsEnumEnum string - -const ( - ErrorsEnumEnumInternal ErrorsEnumEnum = "INTERNAL" - ErrorsEnumEnumInsufficientFund ErrorsEnumEnum = "INSUFFICIENT_FUND" - ErrorsEnumEnumValidation ErrorsEnumEnum = "VALIDATION" - ErrorsEnumEnumConflict ErrorsEnumEnum = "CONFLICT" - ErrorsEnumEnumNoScript ErrorsEnumEnum = "NO_SCRIPT" - ErrorsEnumEnumCompilationFailed ErrorsEnumEnum = "COMPILATION_FAILED" - ErrorsEnumEnumMetadataOverride ErrorsEnumEnum = "METADATA_OVERRIDE" -) diff --git a/pkg/models/shared/expandeddebithold.go b/pkg/models/shared/expandeddebithold.go index 277993d..8e03eec 100755 --- a/pkg/models/shared/expandeddebithold.go +++ b/pkg/models/shared/expandeddebithold.go @@ -1,11 +1,81 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ExpandedDebitHold struct { - Description string `json:"description"` - Destination interface{} `json:"destination,omitempty"` - ID string `json:"id"` - Metadata map[string]interface{} `json:"metadata"` - OriginalAmount int64 `json:"originalAmount"` - Remaining int64 `json:"remaining"` - WalletID string `json:"walletID"` + Description string `json:"description"` + Destination *Subject `json:"destination,omitempty"` + // The unique ID of the hold. + ID string `json:"id"` + // Metadata associated with the hold. + Metadata map[string]interface{} `json:"metadata"` + // Original amount on hold + OriginalAmount int64 `json:"originalAmount"` + // Remaining amount on hold + Remaining int64 `json:"remaining"` + // The ID of the wallet the hold is associated with. + WalletID string `json:"walletID"` +} + +func (o *ExpandedDebitHold) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *ExpandedDebitHold) GetDestination() *Subject { + if o == nil { + return nil + } + return o.Destination +} + +func (o *ExpandedDebitHold) GetDestinationAccount() *LedgerAccountSubject { + if v := o.GetDestination(); v != nil { + return v.LedgerAccountSubject + } + return nil +} + +func (o *ExpandedDebitHold) GetDestinationWallet() *WalletSubject { + if v := o.GetDestination(); v != nil { + return v.WalletSubject + } + return nil +} + +func (o *ExpandedDebitHold) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ExpandedDebitHold) GetMetadata() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Metadata +} + +func (o *ExpandedDebitHold) GetOriginalAmount() int64 { + if o == nil { + return 0 + } + return o.OriginalAmount +} + +func (o *ExpandedDebitHold) GetRemaining() int64 { + if o == nil { + return 0 + } + return o.Remaining +} + +func (o *ExpandedDebitHold) GetWalletID() string { + if o == nil { + return "" + } + return o.WalletID } diff --git a/pkg/models/shared/getbalanceresponse.go b/pkg/models/shared/getbalanceresponse.go index 70e7445..18ed0b0 100755 --- a/pkg/models/shared/getbalanceresponse.go +++ b/pkg/models/shared/getbalanceresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetBalanceResponse struct { Data BalanceWithAssets `json:"data"` } + +func (o *GetBalanceResponse) GetData() BalanceWithAssets { + if o == nil { + return BalanceWithAssets{} + } + return o.Data +} diff --git a/pkg/models/shared/getholdresponse.go b/pkg/models/shared/getholdresponse.go index 4eb67e5..1d486eb 100755 --- a/pkg/models/shared/getholdresponse.go +++ b/pkg/models/shared/getholdresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetHoldResponse struct { Data ExpandedDebitHold `json:"data"` } + +func (o *GetHoldResponse) GetData() ExpandedDebitHold { + if o == nil { + return ExpandedDebitHold{} + } + return o.Data +} diff --git a/pkg/models/shared/getholdsresponse.go b/pkg/models/shared/getholdsresponse.go index 8d39009..ba11291 100755 --- a/pkg/models/shared/getholdsresponse.go +++ b/pkg/models/shared/getholdsresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetHoldsResponseCursor struct { @@ -8,6 +10,48 @@ type GetHoldsResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *GetHoldsResponseCursor) GetData() []Hold { + if o == nil { + return []Hold{} + } + return o.Data +} + +func (o *GetHoldsResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *GetHoldsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *GetHoldsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *GetHoldsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type GetHoldsResponse struct { Cursor GetHoldsResponseCursor `json:"cursor"` } + +func (o *GetHoldsResponse) GetCursor() GetHoldsResponseCursor { + if o == nil { + return GetHoldsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/gettransactionsresponse.go b/pkg/models/shared/gettransactionsresponse.go index ebcfd55..68a06ed 100755 --- a/pkg/models/shared/gettransactionsresponse.go +++ b/pkg/models/shared/gettransactionsresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetTransactionsResponseCursor struct { @@ -8,6 +10,48 @@ type GetTransactionsResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *GetTransactionsResponseCursor) GetData() []WalletsTransaction { + if o == nil { + return []WalletsTransaction{} + } + return o.Data +} + +func (o *GetTransactionsResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *GetTransactionsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *GetTransactionsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *GetTransactionsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type GetTransactionsResponse struct { Cursor GetTransactionsResponseCursor `json:"cursor"` } + +func (o *GetTransactionsResponse) GetCursor() GetTransactionsResponseCursor { + if o == nil { + return GetTransactionsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/getwalletresponse.go b/pkg/models/shared/getwalletresponse.go index 315e154..9af9f25 100755 --- a/pkg/models/shared/getwalletresponse.go +++ b/pkg/models/shared/getwalletresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetWalletResponse struct { Data WalletWithBalances `json:"data"` } + +func (o *GetWalletResponse) GetData() WalletWithBalances { + if o == nil { + return WalletWithBalances{} + } + return o.Data +} diff --git a/pkg/models/shared/getworkflowoccurrenceresponse.go b/pkg/models/shared/getworkflowoccurrenceresponse.go index 9685224..ad8658f 100755 --- a/pkg/models/shared/getworkflowoccurrenceresponse.go +++ b/pkg/models/shared/getworkflowoccurrenceresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetWorkflowOccurrenceResponse struct { Data WorkflowOccurrence `json:"data"` } + +func (o *GetWorkflowOccurrenceResponse) GetData() WorkflowOccurrence { + if o == nil { + return WorkflowOccurrence{} + } + return o.Data +} diff --git a/pkg/models/shared/getworkflowresponse.go b/pkg/models/shared/getworkflowresponse.go index 1f66e3f..8ac80bd 100755 --- a/pkg/models/shared/getworkflowresponse.go +++ b/pkg/models/shared/getworkflowresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type GetWorkflowResponse struct { Data Workflow `json:"data"` } + +func (o *GetWorkflowResponse) GetData() Workflow { + if o == nil { + return Workflow{} + } + return o.Data +} diff --git a/pkg/models/shared/hold.go b/pkg/models/shared/hold.go index 57ad34a..bbf9f59 100755 --- a/pkg/models/shared/hold.go +++ b/pkg/models/shared/hold.go @@ -1,9 +1,63 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Hold struct { - Description string `json:"description"` - Destination interface{} `json:"destination,omitempty"` - ID string `json:"id"` - Metadata map[string]interface{} `json:"metadata"` - WalletID string `json:"walletID"` + Description string `json:"description"` + Destination *Subject `json:"destination,omitempty"` + // The unique ID of the hold. + ID string `json:"id"` + // Metadata associated with the hold. + Metadata map[string]interface{} `json:"metadata"` + // The ID of the wallet the hold is associated with. + WalletID string `json:"walletID"` +} + +func (o *Hold) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *Hold) GetDestination() *Subject { + if o == nil { + return nil + } + return o.Destination +} + +func (o *Hold) GetDestinationAccount() *LedgerAccountSubject { + if v := o.GetDestination(); v != nil { + return v.LedgerAccountSubject + } + return nil +} + +func (o *Hold) GetDestinationWallet() *WalletSubject { + if v := o.GetDestination(); v != nil { + return v.WalletSubject + } + return nil +} + +func (o *Hold) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Hold) GetMetadata() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Metadata +} + +func (o *Hold) GetWalletID() string { + if o == nil { + return "" + } + return o.WalletID } diff --git a/pkg/models/shared/ledgeraccountsubject.go b/pkg/models/shared/ledgeraccountsubject.go new file mode 100755 index 0000000..cb2b6b1 --- /dev/null +++ b/pkg/models/shared/ledgeraccountsubject.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type LedgerAccountSubject struct { + Identifier string `json:"identifier"` + Type string `json:"type"` +} + +func (o *LedgerAccountSubject) GetIdentifier() string { + if o == nil { + return "" + } + return o.Identifier +} + +func (o *LedgerAccountSubject) GetType() string { + if o == nil { + return "" + } + return o.Type +} diff --git a/pkg/models/shared/ledgerinfo.go b/pkg/models/shared/ledgerinfo.go new file mode 100755 index 0000000..8b4958d --- /dev/null +++ b/pkg/models/shared/ledgerinfo.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type LedgerInfoStorage struct { + Migrations []MigrationInfo `json:"migrations,omitempty"` +} + +func (o *LedgerInfoStorage) GetMigrations() []MigrationInfo { + if o == nil { + return nil + } + return o.Migrations +} + +type LedgerInfo struct { + Name *string `json:"name,omitempty"` + Storage *LedgerInfoStorage `json:"storage,omitempty"` +} + +func (o *LedgerInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *LedgerInfo) GetStorage() *LedgerInfoStorage { + if o == nil { + return nil + } + return o.Storage +} diff --git a/pkg/models/shared/ledgerinforesponse.go b/pkg/models/shared/ledgerinforesponse.go new file mode 100755 index 0000000..d78039b --- /dev/null +++ b/pkg/models/shared/ledgerinforesponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type LedgerInfoResponse struct { + Data *LedgerInfo `json:"data,omitempty"` +} + +func (o *LedgerInfoResponse) GetData() *LedgerInfo { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/ledgerstorage.go b/pkg/models/shared/ledgerstorage.go index 549a806..fbe1048 100755 --- a/pkg/models/shared/ledgerstorage.go +++ b/pkg/models/shared/ledgerstorage.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type LedgerStorage struct { Driver string `json:"driver"` Ledgers []string `json:"ledgers"` } + +func (o *LedgerStorage) GetDriver() string { + if o == nil { + return "" + } + return o.Driver +} + +func (o *LedgerStorage) GetLedgers() []string { + if o == nil { + return []string{} + } + return o.Ledgers +} diff --git a/pkg/models/shared/listbalancesresponse.go b/pkg/models/shared/listbalancesresponse.go index 0d44c73..000e506 100755 --- a/pkg/models/shared/listbalancesresponse.go +++ b/pkg/models/shared/listbalancesresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListBalancesResponseCursor struct { @@ -8,6 +10,48 @@ type ListBalancesResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *ListBalancesResponseCursor) GetData() []Balance { + if o == nil { + return []Balance{} + } + return o.Data +} + +func (o *ListBalancesResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *ListBalancesResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListBalancesResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ListBalancesResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type ListBalancesResponse struct { Cursor ListBalancesResponseCursor `json:"cursor"` } + +func (o *ListBalancesResponse) GetCursor() ListBalancesResponseCursor { + if o == nil { + return ListBalancesResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/listclientsresponse.go b/pkg/models/shared/listclientsresponse.go index fcee65d..fb770bd 100755 --- a/pkg/models/shared/listclientsresponse.go +++ b/pkg/models/shared/listclientsresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListClientsResponse struct { Data []Client `json:"data,omitempty"` } + +func (o *ListClientsResponse) GetData() []Client { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/listrunsresponse.go b/pkg/models/shared/listrunsresponse.go new file mode 100755 index 0000000..de07dd1 --- /dev/null +++ b/pkg/models/shared/listrunsresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ListRunsResponseCursor struct { + Data []WorkflowOccurrence `json:"data"` + HasMore *bool `json:"hasMore,omitempty"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *ListRunsResponseCursor) GetData() []WorkflowOccurrence { + if o == nil { + return []WorkflowOccurrence{} + } + return o.Data +} + +func (o *ListRunsResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *ListRunsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListRunsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ListRunsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type ListRunsResponse struct { + Cursor ListRunsResponseCursor `json:"cursor"` +} + +func (o *ListRunsResponse) GetCursor() ListRunsResponseCursor { + if o == nil { + return ListRunsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/listscopesresponse.go b/pkg/models/shared/listscopesresponse.go index 15cacf7..b38cfee 100755 --- a/pkg/models/shared/listscopesresponse.go +++ b/pkg/models/shared/listscopesresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListScopesResponse struct { Data []Scope `json:"data,omitempty"` } + +func (o *ListScopesResponse) GetData() []Scope { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/listusersresponse.go b/pkg/models/shared/listusersresponse.go index 770448a..39f5dfa 100755 --- a/pkg/models/shared/listusersresponse.go +++ b/pkg/models/shared/listusersresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListUsersResponse struct { Data []User `json:"data,omitempty"` } + +func (o *ListUsersResponse) GetData() []User { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/listwalletsresponse.go b/pkg/models/shared/listwalletsresponse.go index 383d451..e2dfb3d 100755 --- a/pkg/models/shared/listwalletsresponse.go +++ b/pkg/models/shared/listwalletsresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListWalletsResponseCursor struct { @@ -8,6 +10,48 @@ type ListWalletsResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *ListWalletsResponseCursor) GetData() []Wallet { + if o == nil { + return []Wallet{} + } + return o.Data +} + +func (o *ListWalletsResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *ListWalletsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListWalletsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ListWalletsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type ListWalletsResponse struct { Cursor ListWalletsResponseCursor `json:"cursor"` } + +func (o *ListWalletsResponse) GetCursor() ListWalletsResponseCursor { + if o == nil { + return ListWalletsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/listworkflowsresponse.go b/pkg/models/shared/listworkflowsresponse.go index 06c5f2b..fb3642d 100755 --- a/pkg/models/shared/listworkflowsresponse.go +++ b/pkg/models/shared/listworkflowsresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ListWorkflowsResponse struct { Data []Workflow `json:"data"` } + +func (o *ListWorkflowsResponse) GetData() []Workflow { + if o == nil { + return []Workflow{} + } + return o.Data +} diff --git a/pkg/models/shared/log.go b/pkg/models/shared/log.go index a0732c7..3dc72b4 100755 --- a/pkg/models/shared/log.go +++ b/pkg/models/shared/log.go @@ -1,20 +1,94 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "encoding/json" + "fmt" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) -type LogTypeEnum string +type LogData struct { +} + +type LogType string const ( - LogTypeEnumNewTransaction LogTypeEnum = "NEW_TRANSACTION" - LogTypeEnumSetMetadata LogTypeEnum = "SET_METADATA" + LogTypeNewTransaction LogType = "NEW_TRANSACTION" + LogTypeSetMetadata LogType = "SET_METADATA" ) +func (e LogType) ToPointer() *LogType { + return &e +} + +func (e *LogType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NEW_TRANSACTION": + fallthrough + case "SET_METADATA": + *e = LogType(v) + return nil + default: + return fmt.Errorf("invalid value for LogType: %v", v) + } +} + type Log struct { - Data map[string]interface{} `json:"data"` - Date time.Time `json:"date"` - Hash string `json:"hash"` - ID int64 `json:"id"` - Type LogTypeEnum `json:"type"` + Data LogData `json:"data"` + Date time.Time `json:"date"` + Hash string `json:"hash"` + ID int64 `json:"id"` + Type LogType `json:"type"` +} + +func (l Log) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *Log) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Log) GetData() LogData { + if o == nil { + return LogData{} + } + return o.Data +} + +func (o *Log) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *Log) GetHash() string { + if o == nil { + return "" + } + return o.Hash +} + +func (o *Log) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *Log) GetType() LogType { + if o == nil { + return LogType("") + } + return o.Type } diff --git a/pkg/models/shared/logscursorresponse.go b/pkg/models/shared/logscursorresponse.go index ac4dfa6..af9a122 100755 --- a/pkg/models/shared/logscursorresponse.go +++ b/pkg/models/shared/logscursorresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type LogsCursorResponseCursor struct { @@ -8,6 +10,48 @@ type LogsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *LogsCursorResponseCursor) GetData() []Log { + if o == nil { + return []Log{} + } + return o.Data +} + +func (o *LogsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *LogsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *LogsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *LogsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type LogsCursorResponse struct { Cursor LogsCursorResponseCursor `json:"cursor"` } + +func (o *LogsCursorResponse) GetCursor() LogsCursorResponseCursor { + if o == nil { + return LogsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/mapping.go b/pkg/models/shared/mapping.go index e8ab0b2..75dfd6f 100755 --- a/pkg/models/shared/mapping.go +++ b/pkg/models/shared/mapping.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Mapping struct { Contracts []Contract `json:"contracts"` } + +func (o *Mapping) GetContracts() []Contract { + if o == nil { + return []Contract{} + } + return o.Contracts +} diff --git a/pkg/models/shared/mappingresponse.go b/pkg/models/shared/mappingresponse.go index fbb787d..3809391 100755 --- a/pkg/models/shared/mappingresponse.go +++ b/pkg/models/shared/mappingresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type MappingResponse struct { Data *Mapping `json:"data,omitempty"` } + +func (o *MappingResponse) GetData() *Mapping { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/migrationinfo.go b/pkg/models/shared/migrationinfo.go new file mode 100755 index 0000000..5941769 --- /dev/null +++ b/pkg/models/shared/migrationinfo.go @@ -0,0 +1,83 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "time" +) + +type MigrationInfoState string + +const ( + MigrationInfoStateToDo MigrationInfoState = "to do" + MigrationInfoStateDone MigrationInfoState = "done" +) + +func (e MigrationInfoState) ToPointer() *MigrationInfoState { + return &e +} + +func (e *MigrationInfoState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "to do": + fallthrough + case "done": + *e = MigrationInfoState(v) + return nil + default: + return fmt.Errorf("invalid value for MigrationInfoState: %v", v) + } +} + +type MigrationInfo struct { + Date *time.Time `json:"date,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationInfoState `json:"state,omitempty"` + Version *int64 `json:"version,omitempty"` +} + +func (m MigrationInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MigrationInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { + return err + } + return nil +} + +func (o *MigrationInfo) GetDate() *time.Time { + if o == nil { + return nil + } + return o.Date +} + +func (o *MigrationInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *MigrationInfo) GetState() *MigrationInfoState { + if o == nil { + return nil + } + return o.State +} + +func (o *MigrationInfo) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} diff --git a/pkg/models/shared/modulrconfig.go b/pkg/models/shared/modulrconfig.go index e5646f1..0c0b194 100755 --- a/pkg/models/shared/modulrconfig.go +++ b/pkg/models/shared/modulrconfig.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ModulrConfig struct { @@ -5,3 +7,24 @@ type ModulrConfig struct { APISecret string `json:"apiSecret"` Endpoint *string `json:"endpoint,omitempty"` } + +func (o *ModulrConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ModulrConfig) GetAPISecret() string { + if o == nil { + return "" + } + return o.APISecret +} + +func (o *ModulrConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} diff --git a/pkg/models/shared/monetary.go b/pkg/models/shared/monetary.go index b767da9..1681b7c 100755 --- a/pkg/models/shared/monetary.go +++ b/pkg/models/shared/monetary.go @@ -1,6 +1,24 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Monetary struct { - Amount int64 `json:"amount"` - Asset string `json:"asset"` + // The amount of the monetary value. + Amount int64 `json:"amount"` + // The asset of the monetary value. + Asset string `json:"asset"` +} + +func (o *Monetary) GetAmount() int64 { + if o == nil { + return 0 + } + return o.Amount +} + +func (o *Monetary) GetAsset() string { + if o == nil { + return "" + } + return o.Asset } diff --git a/pkg/models/shared/payment.go b/pkg/models/shared/payment.go index 2bc545d..28e0f57 100755 --- a/pkg/models/shared/payment.go +++ b/pkg/models/shared/payment.go @@ -1,53 +1,239 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "encoding/json" + "fmt" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) -type PaymentSchemeEnum string +type PaymentRaw struct { +} + +type PaymentScheme string const ( - PaymentSchemeEnumVisa PaymentSchemeEnum = "visa" - PaymentSchemeEnumMastercard PaymentSchemeEnum = "mastercard" - PaymentSchemeEnumAmex PaymentSchemeEnum = "amex" - PaymentSchemeEnumDiners PaymentSchemeEnum = "diners" - PaymentSchemeEnumDiscover PaymentSchemeEnum = "discover" - PaymentSchemeEnumJcb PaymentSchemeEnum = "jcb" - PaymentSchemeEnumUnionpay PaymentSchemeEnum = "unionpay" - PaymentSchemeEnumSepaDebit PaymentSchemeEnum = "sepa debit" - PaymentSchemeEnumSepaCredit PaymentSchemeEnum = "sepa credit" - PaymentSchemeEnumSepa PaymentSchemeEnum = "sepa" - PaymentSchemeEnumApplePay PaymentSchemeEnum = "apple pay" - PaymentSchemeEnumGooglePay PaymentSchemeEnum = "google pay" - PaymentSchemeEnumA2a PaymentSchemeEnum = "a2a" - PaymentSchemeEnumAchDebit PaymentSchemeEnum = "ach debit" - PaymentSchemeEnumAch PaymentSchemeEnum = "ach" - PaymentSchemeEnumRtp PaymentSchemeEnum = "rtp" - PaymentSchemeEnumUnknown PaymentSchemeEnum = "unknown" - PaymentSchemeEnumOther PaymentSchemeEnum = "other" + PaymentSchemeVisa PaymentScheme = "visa" + PaymentSchemeMastercard PaymentScheme = "mastercard" + PaymentSchemeAmex PaymentScheme = "amex" + PaymentSchemeDiners PaymentScheme = "diners" + PaymentSchemeDiscover PaymentScheme = "discover" + PaymentSchemeJcb PaymentScheme = "jcb" + PaymentSchemeUnionpay PaymentScheme = "unionpay" + PaymentSchemeSepaDebit PaymentScheme = "sepa debit" + PaymentSchemeSepaCredit PaymentScheme = "sepa credit" + PaymentSchemeSepa PaymentScheme = "sepa" + PaymentSchemeApplePay PaymentScheme = "apple pay" + PaymentSchemeGooglePay PaymentScheme = "google pay" + PaymentSchemeA2a PaymentScheme = "a2a" + PaymentSchemeAchDebit PaymentScheme = "ach debit" + PaymentSchemeAch PaymentScheme = "ach" + PaymentSchemeRtp PaymentScheme = "rtp" + PaymentSchemeUnknown PaymentScheme = "unknown" + PaymentSchemeOther PaymentScheme = "other" ) -type PaymentTypeEnum string +func (e PaymentScheme) ToPointer() *PaymentScheme { + return &e +} + +func (e *PaymentScheme) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "visa": + fallthrough + case "mastercard": + fallthrough + case "amex": + fallthrough + case "diners": + fallthrough + case "discover": + fallthrough + case "jcb": + fallthrough + case "unionpay": + fallthrough + case "sepa debit": + fallthrough + case "sepa credit": + fallthrough + case "sepa": + fallthrough + case "apple pay": + fallthrough + case "google pay": + fallthrough + case "a2a": + fallthrough + case "ach debit": + fallthrough + case "ach": + fallthrough + case "rtp": + fallthrough + case "unknown": + fallthrough + case "other": + *e = PaymentScheme(v) + return nil + default: + return fmt.Errorf("invalid value for PaymentScheme: %v", v) + } +} + +type PaymentType string const ( - PaymentTypeEnumPayIn PaymentTypeEnum = "PAY-IN" - PaymentTypeEnumPayout PaymentTypeEnum = "PAYOUT" - PaymentTypeEnumTransfer PaymentTypeEnum = "TRANSFER" - PaymentTypeEnumOther PaymentTypeEnum = "OTHER" + PaymentTypePayIn PaymentType = "PAY-IN" + PaymentTypePayout PaymentType = "PAYOUT" + PaymentTypeTransfer PaymentType = "TRANSFER" + PaymentTypeOther PaymentType = "OTHER" ) +func (e PaymentType) ToPointer() *PaymentType { + return &e +} + +func (e *PaymentType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PAY-IN": + fallthrough + case "PAYOUT": + fallthrough + case "TRANSFER": + fallthrough + case "OTHER": + *e = PaymentType(v) + return nil + default: + return fmt.Errorf("invalid value for PaymentType: %v", v) + } +} + type Payment struct { - AccountID string `json:"accountID"` - Adjustments []PaymentAdjustment `json:"adjustments"` - Asset string `json:"asset"` - CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - InitialAmount int64 `json:"initialAmount"` - Metadata []PaymentMetadata `json:"metadata"` - Provider ConnectorEnum `json:"provider"` - Raw map[string]interface{} `json:"raw"` - Reference string `json:"reference"` - Scheme PaymentSchemeEnum `json:"scheme"` - Status PaymentStatusEnum `json:"status"` - Type PaymentTypeEnum `json:"type"` + AccountID string `json:"accountID"` + Adjustments []PaymentAdjustment `json:"adjustments"` + Asset string `json:"asset"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + InitialAmount int64 `json:"initialAmount"` + Metadata []PaymentMetadata `json:"metadata"` + Provider Connector `json:"provider"` + Raw PaymentRaw `json:"raw"` + Reference string `json:"reference"` + Scheme PaymentScheme `json:"scheme"` + Status PaymentStatus `json:"status"` + Type PaymentType `json:"type"` +} + +func (p Payment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Payment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Payment) GetAccountID() string { + if o == nil { + return "" + } + return o.AccountID +} + +func (o *Payment) GetAdjustments() []PaymentAdjustment { + if o == nil { + return []PaymentAdjustment{} + } + return o.Adjustments +} + +func (o *Payment) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} + +func (o *Payment) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Payment) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Payment) GetInitialAmount() int64 { + if o == nil { + return 0 + } + return o.InitialAmount +} + +func (o *Payment) GetMetadata() []PaymentMetadata { + if o == nil { + return []PaymentMetadata{} + } + return o.Metadata +} + +func (o *Payment) GetProvider() Connector { + if o == nil { + return Connector("") + } + return o.Provider +} + +func (o *Payment) GetRaw() PaymentRaw { + if o == nil { + return PaymentRaw{} + } + return o.Raw +} + +func (o *Payment) GetReference() string { + if o == nil { + return "" + } + return o.Reference +} + +func (o *Payment) GetScheme() PaymentScheme { + if o == nil { + return PaymentScheme("") + } + return o.Scheme +} + +func (o *Payment) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *Payment) GetType() PaymentType { + if o == nil { + return PaymentType("") + } + return o.Type } diff --git a/pkg/models/shared/paymentadjustment.go b/pkg/models/shared/paymentadjustment.go index 44366ad..2179ecf 100755 --- a/pkg/models/shared/paymentadjustment.go +++ b/pkg/models/shared/paymentadjustment.go @@ -1,13 +1,65 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) +type PaymentAdjustmentRaw struct { +} + type PaymentAdjustment struct { - Absolute bool `json:"absolute"` - Amount int64 `json:"amount"` - Date time.Time `json:"date"` - Raw map[string]interface{} `json:"raw"` - Status PaymentStatusEnum `json:"status"` + Absolute bool `json:"absolute"` + Amount int64 `json:"amount"` + Date time.Time `json:"date"` + Raw PaymentAdjustmentRaw `json:"raw"` + Status PaymentStatus `json:"status"` +} + +func (p PaymentAdjustment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentAdjustment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentAdjustment) GetAbsolute() bool { + if o == nil { + return false + } + return o.Absolute +} + +func (o *PaymentAdjustment) GetAmount() int64 { + if o == nil { + return 0 + } + return o.Amount +} + +func (o *PaymentAdjustment) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *PaymentAdjustment) GetRaw() PaymentAdjustmentRaw { + if o == nil { + return PaymentAdjustmentRaw{} + } + return o.Raw +} + +func (o *PaymentAdjustment) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status } diff --git a/pkg/models/shared/paymentmetadata.go b/pkg/models/shared/paymentmetadata.go index fb31155..1df2432 100755 --- a/pkg/models/shared/paymentmetadata.go +++ b/pkg/models/shared/paymentmetadata.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type PaymentMetadata struct { @@ -5,3 +7,24 @@ type PaymentMetadata struct { Key string `json:"key"` Value string `json:"value"` } + +func (o *PaymentMetadata) GetChangelog() *PaymentMetadataChangelog { + if o == nil { + return nil + } + return o.Changelog +} + +func (o *PaymentMetadata) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *PaymentMetadata) GetValue() string { + if o == nil { + return "" + } + return o.Value +} diff --git a/pkg/models/shared/paymentmetadatachangelog.go b/pkg/models/shared/paymentmetadatachangelog.go index e4f6ade..6225cf3 100755 --- a/pkg/models/shared/paymentmetadatachangelog.go +++ b/pkg/models/shared/paymentmetadatachangelog.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -8,3 +11,28 @@ type PaymentMetadataChangelog struct { Timestamp time.Time `json:"timestamp"` Value string `json:"value"` } + +func (p PaymentMetadataChangelog) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentMetadataChangelog) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentMetadataChangelog) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} + +func (o *PaymentMetadataChangelog) GetValue() string { + if o == nil { + return "" + } + return o.Value +} diff --git a/pkg/models/shared/paymentresponse.go b/pkg/models/shared/paymentresponse.go index 0675a2f..c796db9 100755 --- a/pkg/models/shared/paymentresponse.go +++ b/pkg/models/shared/paymentresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type PaymentResponse struct { Data Payment `json:"data"` } + +func (o *PaymentResponse) GetData() Payment { + if o == nil { + return Payment{} + } + return o.Data +} diff --git a/pkg/models/shared/paymentsaccount.go b/pkg/models/shared/paymentsaccount.go index 529e15a..f4a9818 100755 --- a/pkg/models/shared/paymentsaccount.go +++ b/pkg/models/shared/paymentsaccount.go @@ -1,20 +1,91 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "encoding/json" + "fmt" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) -type PaymentsAccountTypeEnum string +type PaymentsAccountType string const ( - PaymentsAccountTypeEnumTarget PaymentsAccountTypeEnum = "TARGET" - PaymentsAccountTypeEnumSource PaymentsAccountTypeEnum = "SOURCE" + PaymentsAccountTypeTarget PaymentsAccountType = "TARGET" + PaymentsAccountTypeSource PaymentsAccountType = "SOURCE" ) +func (e PaymentsAccountType) ToPointer() *PaymentsAccountType { + return &e +} + +func (e *PaymentsAccountType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TARGET": + fallthrough + case "SOURCE": + *e = PaymentsAccountType(v) + return nil + default: + return fmt.Errorf("invalid value for PaymentsAccountType: %v", v) + } +} + type PaymentsAccount struct { - CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - Provider ConnectorEnum `json:"provider"` - Reference string `json:"reference"` - Type PaymentsAccountTypeEnum `json:"type"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Provider Connector `json:"provider"` + Reference string `json:"reference"` + Type PaymentsAccountType `json:"type"` +} + +func (p PaymentsAccount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentsAccount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentsAccount) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PaymentsAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *PaymentsAccount) GetProvider() Connector { + if o == nil { + return Connector("") + } + return o.Provider +} + +func (o *PaymentsAccount) GetReference() string { + if o == nil { + return "" + } + return o.Reference +} + +func (o *PaymentsAccount) GetType() PaymentsAccountType { + if o == nil { + return PaymentsAccountType("") + } + return o.Type } diff --git a/pkg/models/shared/paymentscursor.go b/pkg/models/shared/paymentscursor.go index bbaffa1..673cb36 100755 --- a/pkg/models/shared/paymentscursor.go +++ b/pkg/models/shared/paymentscursor.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type PaymentsCursorCursor struct { @@ -8,6 +10,48 @@ type PaymentsCursorCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *PaymentsCursorCursor) GetData() []Payment { + if o == nil { + return []Payment{} + } + return o.Data +} + +func (o *PaymentsCursorCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PaymentsCursorCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *PaymentsCursorCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *PaymentsCursorCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type PaymentsCursor struct { Cursor PaymentsCursorCursor `json:"cursor"` } + +func (o *PaymentsCursor) GetCursor() PaymentsCursorCursor { + if o == nil { + return PaymentsCursorCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/paymentstatus.go b/pkg/models/shared/paymentstatus.go new file mode 100755 index 0000000..3100059 --- /dev/null +++ b/pkg/models/shared/paymentstatus.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type PaymentStatus string + +const ( + PaymentStatusPending PaymentStatus = "PENDING" + PaymentStatusActive PaymentStatus = "ACTIVE" + PaymentStatusTerminated PaymentStatus = "TERMINATED" + PaymentStatusFailed PaymentStatus = "FAILED" +) + +func (e PaymentStatus) ToPointer() *PaymentStatus { + return &e +} + +func (e *PaymentStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PENDING": + fallthrough + case "ACTIVE": + fallthrough + case "TERMINATED": + fallthrough + case "FAILED": + *e = PaymentStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PaymentStatus: %v", v) + } +} diff --git a/pkg/models/shared/paymentstatusenum.go b/pkg/models/shared/paymentstatusenum.go deleted file mode 100755 index bfdec87..0000000 --- a/pkg/models/shared/paymentstatusenum.go +++ /dev/null @@ -1,10 +0,0 @@ -package shared - -type PaymentStatusEnum string - -const ( - PaymentStatusEnumPending PaymentStatusEnum = "PENDING" - PaymentStatusEnumActive PaymentStatusEnum = "ACTIVE" - PaymentStatusEnumTerminated PaymentStatusEnum = "TERMINATED" - PaymentStatusEnumFailed PaymentStatusEnum = "FAILED" -) diff --git a/pkg/models/shared/posting.go b/pkg/models/shared/posting.go index 61205a3..2b93821 100755 --- a/pkg/models/shared/posting.go +++ b/pkg/models/shared/posting.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Posting struct { @@ -6,3 +8,31 @@ type Posting struct { Destination string `json:"destination"` Source string `json:"source"` } + +func (o *Posting) GetAmount() int64 { + if o == nil { + return 0 + } + return o.Amount +} + +func (o *Posting) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} + +func (o *Posting) GetDestination() string { + if o == nil { + return "" + } + return o.Destination +} + +func (o *Posting) GetSource() string { + if o == nil { + return "" + } + return o.Source +} diff --git a/pkg/models/shared/posttransaction.go b/pkg/models/shared/posttransaction.go index 5aef826..6fde5b5 100755 --- a/pkg/models/shared/posttransaction.go +++ b/pkg/models/shared/posttransaction.go @@ -1,12 +1,32 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) +type PostTransactionScriptVars struct { +} + type PostTransactionScript struct { - Plain string `json:"plain"` - Vars map[string]interface{} `json:"vars,omitempty"` + Plain string `json:"plain"` + Vars *PostTransactionScriptVars `json:"vars,omitempty"` +} + +func (o *PostTransactionScript) GetPlain() string { + if o == nil { + return "" + } + return o.Plain +} + +func (o *PostTransactionScript) GetVars() *PostTransactionScriptVars { + if o == nil { + return nil + } + return o.Vars } type PostTransaction struct { @@ -16,3 +36,49 @@ type PostTransaction struct { Script *PostTransactionScript `json:"script,omitempty"` Timestamp *time.Time `json:"timestamp,omitempty"` } + +func (p PostTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PostTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PostTransaction) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *PostTransaction) GetPostings() []Posting { + if o == nil { + return nil + } + return o.Postings +} + +func (o *PostTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *PostTransaction) GetScript() *PostTransactionScript { + if o == nil { + return nil + } + return o.Script +} + +func (o *PostTransaction) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} diff --git a/pkg/models/shared/query.go b/pkg/models/shared/query.go index c2c9bae..1fab22b 100755 --- a/pkg/models/shared/query.go +++ b/pkg/models/shared/query.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Query struct { @@ -10,3 +12,59 @@ type Query struct { Target *string `json:"target,omitempty"` Terms []string `json:"terms,omitempty"` } + +func (o *Query) GetAfter() []string { + if o == nil { + return nil + } + return o.After +} + +func (o *Query) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *Query) GetLedgers() []string { + if o == nil { + return nil + } + return o.Ledgers +} + +func (o *Query) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *Query) GetPolicy() *string { + if o == nil { + return nil + } + return o.Policy +} + +func (o *Query) GetSort() *string { + if o == nil { + return nil + } + return o.Sort +} + +func (o *Query) GetTarget() *string { + if o == nil { + return nil + } + return o.Target +} + +func (o *Query) GetTerms() []string { + if o == nil { + return nil + } + return o.Terms +} diff --git a/pkg/models/shared/readclientresponse.go b/pkg/models/shared/readclientresponse.go index e21341e..78e7ca6 100755 --- a/pkg/models/shared/readclientresponse.go +++ b/pkg/models/shared/readclientresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ReadClientResponse struct { Data *Client `json:"data,omitempty"` } + +func (o *ReadClientResponse) GetData() *Client { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/readscoperesponse.go b/pkg/models/shared/readscoperesponse.go index f7eeb4f..4949a88 100755 --- a/pkg/models/shared/readscoperesponse.go +++ b/pkg/models/shared/readscoperesponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ReadScopeResponse struct { Data *Scope `json:"data,omitempty"` } + +func (o *ReadScopeResponse) GetData() *Scope { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/readuserresponse.go b/pkg/models/shared/readuserresponse.go index a8944fb..fb511a2 100755 --- a/pkg/models/shared/readuserresponse.go +++ b/pkg/models/shared/readuserresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ReadUserResponse struct { Data *User `json:"data,omitempty"` } + +func (o *ReadUserResponse) GetData() *User { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/response.go b/pkg/models/shared/response.go index 77a8329..e53ef9d 100755 --- a/pkg/models/shared/response.go +++ b/pkg/models/shared/response.go @@ -1,20 +1,100 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +type ResponseCursorData struct { +} + type ResponseCursorTotal struct { Relation *string `json:"relation,omitempty"` Value *int64 `json:"value,omitempty"` } +func (o *ResponseCursorTotal) GetRelation() *string { + if o == nil { + return nil + } + return o.Relation +} + +func (o *ResponseCursorTotal) GetValue() *int64 { + if o == nil { + return nil + } + return o.Value +} + type ResponseCursor struct { - Data []map[string]interface{} `json:"data,omitempty"` - HasMore *bool `json:"hasMore,omitempty"` - Next *string `json:"next,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - Previous *string `json:"previous,omitempty"` - Total *ResponseCursorTotal `json:"total,omitempty"` + Data []ResponseCursorData `json:"data,omitempty"` + HasMore *bool `json:"hasMore,omitempty"` + Next *string `json:"next,omitempty"` + PageSize *int64 `json:"pageSize,omitempty"` + Previous *string `json:"previous,omitempty"` + Total *ResponseCursorTotal `json:"total,omitempty"` +} + +func (o *ResponseCursor) GetData() []ResponseCursorData { + if o == nil { + return nil + } + return o.Data +} + +func (o *ResponseCursor) GetHasMore() *bool { + if o == nil { + return nil + } + return o.HasMore +} + +func (o *ResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ResponseCursor) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +func (o *ResponseCursor) GetTotal() *ResponseCursorTotal { + if o == nil { + return nil + } + return o.Total +} + +// ResponseData - The payload +type ResponseData struct { } type Response struct { - Cursor *ResponseCursor `json:"cursor,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` + Cursor *ResponseCursor `json:"cursor,omitempty"` + // The payload + Data *ResponseData `json:"data,omitempty"` +} + +func (o *Response) GetCursor() *ResponseCursor { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *Response) GetData() *ResponseData { + if o == nil { + return nil + } + return o.Data } diff --git a/pkg/models/shared/runworkflowresponse.go b/pkg/models/shared/runworkflowresponse.go index f650660..788cfa5 100755 --- a/pkg/models/shared/runworkflowresponse.go +++ b/pkg/models/shared/runworkflowresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type RunWorkflowResponse struct { Data WorkflowOccurrence `json:"data"` } + +func (o *RunWorkflowResponse) GetData() WorkflowOccurrence { + if o == nil { + return WorkflowOccurrence{} + } + return o.Data +} diff --git a/pkg/models/shared/scope.go b/pkg/models/shared/scope.go index e1df4b7..5e0e45b 100755 --- a/pkg/models/shared/scope.go +++ b/pkg/models/shared/scope.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Scope struct { @@ -6,3 +8,31 @@ type Scope struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Transient []string `json:"transient,omitempty"` } + +func (o *Scope) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Scope) GetLabel() string { + if o == nil { + return "" + } + return o.Label +} + +func (o *Scope) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Scope) GetTransient() []string { + if o == nil { + return nil + } + return o.Transient +} diff --git a/pkg/models/shared/script.go b/pkg/models/shared/script.go index b31b83f..ec4481c 100755 --- a/pkg/models/shared/script.go +++ b/pkg/models/shared/script.go @@ -1,8 +1,42 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +type ScriptVars struct { +} + type Script struct { - Metadata map[string]interface{} `json:"metadata,omitempty"` - Plain string `json:"plain"` - Reference *string `json:"reference,omitempty"` - Vars map[string]interface{} `json:"vars,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Plain string `json:"plain"` + // Reference to attach to the generated transaction + Reference *string `json:"reference,omitempty"` + Vars *ScriptVars `json:"vars,omitempty"` +} + +func (o *Script) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Script) GetPlain() string { + if o == nil { + return "" + } + return o.Plain +} + +func (o *Script) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *Script) GetVars() *ScriptVars { + if o == nil { + return nil + } + return o.Vars } diff --git a/pkg/models/shared/scriptresponse.go b/pkg/models/shared/scriptresponse.go index bdc344a..caa8c82 100755 --- a/pkg/models/shared/scriptresponse.go +++ b/pkg/models/shared/scriptresponse.go @@ -1,8 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ScriptResponse struct { - Details *string `json:"details,omitempty"` - ErrorCode *ErrorsEnumEnum `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Transaction *Transaction `json:"transaction,omitempty"` + Details *string `json:"details,omitempty"` + ErrorCode *ErrorsEnum `json:"errorCode,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Transaction *Transaction `json:"transaction,omitempty"` +} + +func (o *ScriptResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *ScriptResponse) GetErrorCode() *ErrorsEnum { + if o == nil { + return nil + } + return o.ErrorCode +} + +func (o *ScriptResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *ScriptResponse) GetTransaction() *Transaction { + if o == nil { + return nil + } + return o.Transaction } diff --git a/pkg/models/shared/secret.go b/pkg/models/shared/secret.go index 09486e8..ed84caf 100755 --- a/pkg/models/shared/secret.go +++ b/pkg/models/shared/secret.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Secret struct { @@ -7,3 +9,38 @@ type Secret struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Name string `json:"name"` } + +func (o *Secret) GetClear() string { + if o == nil { + return "" + } + return o.Clear +} + +func (o *Secret) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Secret) GetLastDigits() string { + if o == nil { + return "" + } + return o.LastDigits +} + +func (o *Secret) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Secret) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/security.go b/pkg/models/shared/security.go index 831cc4c..c7f8f6d 100755 --- a/pkg/models/shared/security.go +++ b/pkg/models/shared/security.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Security struct { Authorization string `security:"scheme,type=oauth2,name=Authorization"` } + +func (o *Security) GetAuthorization() string { + if o == nil { + return "" + } + return o.Authorization +} diff --git a/pkg/models/shared/serverinfo.go b/pkg/models/shared/serverinfo.go index 5aa829f..2ce1c10 100755 --- a/pkg/models/shared/serverinfo.go +++ b/pkg/models/shared/serverinfo.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type ServerInfo struct { Version string `json:"version"` } + +func (o *ServerInfo) GetVersion() string { + if o == nil { + return "" + } + return o.Version +} diff --git a/pkg/models/shared/stagestatus.go b/pkg/models/shared/stagestatus.go index fb961fb..ae232c5 100755 --- a/pkg/models/shared/stagestatus.go +++ b/pkg/models/shared/stagestatus.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -11,3 +14,49 @@ type StageStatus struct { StartedAt time.Time `json:"startedAt"` TerminatedAt *time.Time `json:"terminatedAt,omitempty"` } + +func (s StageStatus) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StageStatus) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + +func (o *StageStatus) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *StageStatus) GetOccurrenceID() string { + if o == nil { + return "" + } + return o.OccurrenceID +} + +func (o *StageStatus) GetStage() float64 { + if o == nil { + return 0.0 + } + return o.Stage +} + +func (o *StageStatus) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *StageStatus) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} diff --git a/pkg/models/shared/stats.go b/pkg/models/shared/stats.go index 3159d11..700e240 100755 --- a/pkg/models/shared/stats.go +++ b/pkg/models/shared/stats.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Stats struct { Accounts int64 `json:"accounts"` Transactions int64 `json:"transactions"` } + +func (o *Stats) GetAccounts() int64 { + if o == nil { + return 0 + } + return o.Accounts +} + +func (o *Stats) GetTransactions() int64 { + if o == nil { + return 0 + } + return o.Transactions +} diff --git a/pkg/models/shared/statsresponse.go b/pkg/models/shared/statsresponse.go index 22beb4b..55a24a6 100755 --- a/pkg/models/shared/statsresponse.go +++ b/pkg/models/shared/statsresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type StatsResponse struct { Data Stats `json:"data"` } + +func (o *StatsResponse) GetData() Stats { + if o == nil { + return Stats{} + } + return o.Data +} diff --git a/pkg/models/shared/stripeconfig.go b/pkg/models/shared/stripeconfig.go index 3d2d738..60e0315 100755 --- a/pkg/models/shared/stripeconfig.go +++ b/pkg/models/shared/stripeconfig.go @@ -1,7 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + type StripeConfig struct { - APIKey string `json:"apiKey"` - PageSize *int64 `json:"pageSize,omitempty"` - PollingPeriod *string `json:"pollingPeriod,omitempty"` + APIKey string `json:"apiKey"` + // Number of BalanceTransaction to fetch at each polling interval. + // + PageSize *int64 `default:"10" json:"pageSize"` + // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. + // + PollingPeriod *string `default:"120s" json:"pollingPeriod"` +} + +func (s StripeConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StripeConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil { + return err + } + return nil +} + +func (o *StripeConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *StripeConfig) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *StripeConfig) GetPollingPeriod() *string { + if o == nil { + return nil + } + return o.PollingPeriod } diff --git a/pkg/models/shared/stripetransferrequest.go b/pkg/models/shared/stripetransferrequest.go index c0ed5e6..7a11a20 100755 --- a/pkg/models/shared/stripetransferrequest.go +++ b/pkg/models/shared/stripetransferrequest.go @@ -1,8 +1,46 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +// StripeTransferRequestMetadata - A set of key/value pairs that you can attach to a transfer object. +// It can be useful for storing additional information about the transfer in a structured format. +type StripeTransferRequestMetadata struct { +} + type StripeTransferRequest struct { - Amount *int64 `json:"amount,omitempty"` - Asset *string `json:"asset,omitempty"` - Destination *string `json:"destination,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` + Amount *int64 `json:"amount,omitempty"` + Asset *string `json:"asset,omitempty"` + Destination *string `json:"destination,omitempty"` + // A set of key/value pairs that you can attach to a transfer object. + // It can be useful for storing additional information about the transfer in a structured format. + // + Metadata *StripeTransferRequestMetadata `json:"metadata,omitempty"` +} + +func (o *StripeTransferRequest) GetAmount() *int64 { + if o == nil { + return nil + } + return o.Amount +} + +func (o *StripeTransferRequest) GetAsset() *string { + if o == nil { + return nil + } + return o.Asset +} + +func (o *StripeTransferRequest) GetDestination() *string { + if o == nil { + return nil + } + return o.Destination +} + +func (o *StripeTransferRequest) GetMetadata() *StripeTransferRequestMetadata { + if o == nil { + return nil + } + return o.Metadata } diff --git a/pkg/models/shared/stripetransferresponse.go b/pkg/models/shared/stripetransferresponse.go new file mode 100755 index 0000000..814ee25 --- /dev/null +++ b/pkg/models/shared/stripetransferresponse.go @@ -0,0 +1,6 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type StripeTransferResponse struct { +} diff --git a/pkg/models/shared/subject.go b/pkg/models/shared/subject.go new file mode 100755 index 0000000..64f172e --- /dev/null +++ b/pkg/models/shared/subject.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + +type SubjectType string + +const ( + SubjectTypeAccount SubjectType = "ACCOUNT" + SubjectTypeWallet SubjectType = "WALLET" +) + +type Subject struct { + LedgerAccountSubject *LedgerAccountSubject + WalletSubject *WalletSubject + + Type SubjectType +} + +func CreateSubjectAccount(account LedgerAccountSubject) Subject { + typ := SubjectTypeAccount + typStr := string(typ) + account.Type = typStr + + return Subject{ + LedgerAccountSubject: &account, + Type: typ, + } +} + +func CreateSubjectWallet(wallet WalletSubject) Subject { + typ := SubjectTypeWallet + typStr := string(typ) + wallet.Type = typStr + + return Subject{ + WalletSubject: &wallet, + Type: typ, + } +} + +func (u *Subject) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "ACCOUNT": + ledgerAccountSubject := new(LedgerAccountSubject) + if err := utils.UnmarshalJSON(data, &ledgerAccountSubject, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.LedgerAccountSubject = ledgerAccountSubject + u.Type = SubjectTypeAccount + return nil + case "WALLET": + walletSubject := new(WalletSubject) + if err := utils.UnmarshalJSON(data, &walletSubject, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.WalletSubject = walletSubject + u.Type = SubjectTypeWallet + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u Subject) MarshalJSON() ([]byte, error) { + if u.LedgerAccountSubject != nil { + return utils.MarshalJSON(u.LedgerAccountSubject, "", true) + } + + if u.WalletSubject != nil { + return utils.MarshalJSON(u.WalletSubject, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/taskbankingcircle.go b/pkg/models/shared/taskbankingcircle.go index 8216dbb..b016531 100755 --- a/pkg/models/shared/taskbankingcircle.go +++ b/pkg/models/shared/taskbankingcircle.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -9,13 +12,97 @@ type TaskBankingCircleDescriptor struct { Name *string `json:"name,omitempty"` } +func (o *TaskBankingCircleDescriptor) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *TaskBankingCircleDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +type TaskBankingCircleState struct { +} + type TaskBankingCircle struct { ConnectorID string `json:"connectorId"` CreatedAt time.Time `json:"createdAt"` Descriptor TaskBankingCircleDescriptor `json:"descriptor"` Error *string `json:"error,omitempty"` ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` + State TaskBankingCircleState `json:"state"` + Status PaymentStatus `json:"status"` UpdatedAt time.Time `json:"updatedAt"` } + +func (t TaskBankingCircle) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskBankingCircle) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskBankingCircle) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskBankingCircle) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskBankingCircle) GetDescriptor() TaskBankingCircleDescriptor { + if o == nil { + return TaskBankingCircleDescriptor{} + } + return o.Descriptor +} + +func (o *TaskBankingCircle) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskBankingCircle) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskBankingCircle) GetState() TaskBankingCircleState { + if o == nil { + return TaskBankingCircleState{} + } + return o.State +} + +func (o *TaskBankingCircle) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskBankingCircle) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/taskcurrencycloud.go b/pkg/models/shared/taskcurrencycloud.go index ac36e75..4701a11 100755 --- a/pkg/models/shared/taskcurrencycloud.go +++ b/pkg/models/shared/taskcurrencycloud.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -8,13 +11,90 @@ type TaskCurrencyCloudDescriptor struct { Name *string `json:"name,omitempty"` } +func (o *TaskCurrencyCloudDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +type TaskCurrencyCloudState struct { +} + type TaskCurrencyCloud struct { ConnectorID string `json:"connectorId"` CreatedAt time.Time `json:"createdAt"` Descriptor TaskCurrencyCloudDescriptor `json:"descriptor"` Error *string `json:"error,omitempty"` ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` + State TaskCurrencyCloudState `json:"state"` + Status PaymentStatus `json:"status"` UpdatedAt time.Time `json:"updatedAt"` } + +func (t TaskCurrencyCloud) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskCurrencyCloud) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskCurrencyCloud) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskCurrencyCloud) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskCurrencyCloud) GetDescriptor() TaskCurrencyCloudDescriptor { + if o == nil { + return TaskCurrencyCloudDescriptor{} + } + return o.Descriptor +} + +func (o *TaskCurrencyCloud) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskCurrencyCloud) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskCurrencyCloud) GetState() TaskCurrencyCloudState { + if o == nil { + return TaskCurrencyCloudState{} + } + return o.State +} + +func (o *TaskCurrencyCloud) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskCurrencyCloud) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/taskdummypay.go b/pkg/models/shared/taskdummypay.go index 5d4f283..441e57c 100755 --- a/pkg/models/shared/taskdummypay.go +++ b/pkg/models/shared/taskdummypay.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,13 +13,104 @@ type TaskDummyPayDescriptor struct { Name *string `json:"name,omitempty"` } +func (o *TaskDummyPayDescriptor) GetFileName() *string { + if o == nil { + return nil + } + return o.FileName +} + +func (o *TaskDummyPayDescriptor) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *TaskDummyPayDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +type TaskDummyPayState struct { +} + type TaskDummyPay struct { ConnectorID string `json:"connectorId"` CreatedAt time.Time `json:"createdAt"` Descriptor TaskDummyPayDescriptor `json:"descriptor"` Error *string `json:"error,omitempty"` ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` + State TaskDummyPayState `json:"state"` + Status PaymentStatus `json:"status"` UpdatedAt time.Time `json:"updatedAt"` } + +func (t TaskDummyPay) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskDummyPay) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskDummyPay) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskDummyPay) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskDummyPay) GetDescriptor() TaskDummyPayDescriptor { + if o == nil { + return TaskDummyPayDescriptor{} + } + return o.Descriptor +} + +func (o *TaskDummyPay) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskDummyPay) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskDummyPay) GetState() TaskDummyPayState { + if o == nil { + return TaskDummyPayState{} + } + return o.State +} + +func (o *TaskDummyPay) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskDummyPay) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/taskmodulr.go b/pkg/models/shared/taskmodulr.go index 3d2bfc4..a5af3db 100755 --- a/pkg/models/shared/taskmodulr.go +++ b/pkg/models/shared/taskmodulr.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,13 +13,104 @@ type TaskModulrDescriptor struct { Name *string `json:"name,omitempty"` } +func (o *TaskModulrDescriptor) GetAccountID() *string { + if o == nil { + return nil + } + return o.AccountID +} + +func (o *TaskModulrDescriptor) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *TaskModulrDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +type TaskModulrState struct { +} + type TaskModulr struct { - ConnectorID string `json:"connectorId"` - CreatedAt time.Time `json:"createdAt"` - Descriptor TaskModulrDescriptor `json:"descriptor"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` + ConnectorID string `json:"connectorId"` + CreatedAt time.Time `json:"createdAt"` + Descriptor TaskModulrDescriptor `json:"descriptor"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + State TaskModulrState `json:"state"` + Status PaymentStatus `json:"status"` + UpdatedAt time.Time `json:"updatedAt"` +} + +func (t TaskModulr) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskModulr) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskModulr) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskModulr) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskModulr) GetDescriptor() TaskModulrDescriptor { + if o == nil { + return TaskModulrDescriptor{} + } + return o.Descriptor +} + +func (o *TaskModulr) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskModulr) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskModulr) GetState() TaskModulrState { + if o == nil { + return TaskModulrState{} + } + return o.State +} + +func (o *TaskModulr) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskModulr) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt } diff --git a/pkg/models/shared/taskresponse.go b/pkg/models/shared/taskresponse.go index 743a2e0..d8fda9a 100755 --- a/pkg/models/shared/taskresponse.go +++ b/pkg/models/shared/taskresponse.go @@ -1,5 +1,170 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +import ( + "errors" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + +type TaskResponseDataType string + +const ( + TaskResponseDataTypeTaskStripe TaskResponseDataType = "TaskStripe" + TaskResponseDataTypeTaskWise TaskResponseDataType = "TaskWise" + TaskResponseDataTypeTaskCurrencyCloud TaskResponseDataType = "TaskCurrencyCloud" + TaskResponseDataTypeTaskDummyPay TaskResponseDataType = "TaskDummyPay" + TaskResponseDataTypeTaskModulr TaskResponseDataType = "TaskModulr" + TaskResponseDataTypeTaskBankingCircle TaskResponseDataType = "TaskBankingCircle" +) + +type TaskResponseData struct { + TaskStripe *TaskStripe + TaskWise *TaskWise + TaskCurrencyCloud *TaskCurrencyCloud + TaskDummyPay *TaskDummyPay + TaskModulr *TaskModulr + TaskBankingCircle *TaskBankingCircle + + Type TaskResponseDataType +} + +func CreateTaskResponseDataTaskStripe(taskStripe TaskStripe) TaskResponseData { + typ := TaskResponseDataTypeTaskStripe + + return TaskResponseData{ + TaskStripe: &taskStripe, + Type: typ, + } +} + +func CreateTaskResponseDataTaskWise(taskWise TaskWise) TaskResponseData { + typ := TaskResponseDataTypeTaskWise + + return TaskResponseData{ + TaskWise: &taskWise, + Type: typ, + } +} + +func CreateTaskResponseDataTaskCurrencyCloud(taskCurrencyCloud TaskCurrencyCloud) TaskResponseData { + typ := TaskResponseDataTypeTaskCurrencyCloud + + return TaskResponseData{ + TaskCurrencyCloud: &taskCurrencyCloud, + Type: typ, + } +} + +func CreateTaskResponseDataTaskDummyPay(taskDummyPay TaskDummyPay) TaskResponseData { + typ := TaskResponseDataTypeTaskDummyPay + + return TaskResponseData{ + TaskDummyPay: &taskDummyPay, + Type: typ, + } +} + +func CreateTaskResponseDataTaskModulr(taskModulr TaskModulr) TaskResponseData { + typ := TaskResponseDataTypeTaskModulr + + return TaskResponseData{ + TaskModulr: &taskModulr, + Type: typ, + } +} + +func CreateTaskResponseDataTaskBankingCircle(taskBankingCircle TaskBankingCircle) TaskResponseData { + typ := TaskResponseDataTypeTaskBankingCircle + + return TaskResponseData{ + TaskBankingCircle: &taskBankingCircle, + Type: typ, + } +} + +func (u *TaskResponseData) UnmarshalJSON(data []byte) error { + + taskStripe := new(TaskStripe) + if err := utils.UnmarshalJSON(data, &taskStripe, "", true, true); err == nil { + u.TaskStripe = taskStripe + u.Type = TaskResponseDataTypeTaskStripe + return nil + } + + taskWise := new(TaskWise) + if err := utils.UnmarshalJSON(data, &taskWise, "", true, true); err == nil { + u.TaskWise = taskWise + u.Type = TaskResponseDataTypeTaskWise + return nil + } + + taskCurrencyCloud := new(TaskCurrencyCloud) + if err := utils.UnmarshalJSON(data, &taskCurrencyCloud, "", true, true); err == nil { + u.TaskCurrencyCloud = taskCurrencyCloud + u.Type = TaskResponseDataTypeTaskCurrencyCloud + return nil + } + + taskDummyPay := new(TaskDummyPay) + if err := utils.UnmarshalJSON(data, &taskDummyPay, "", true, true); err == nil { + u.TaskDummyPay = taskDummyPay + u.Type = TaskResponseDataTypeTaskDummyPay + return nil + } + + taskModulr := new(TaskModulr) + if err := utils.UnmarshalJSON(data, &taskModulr, "", true, true); err == nil { + u.TaskModulr = taskModulr + u.Type = TaskResponseDataTypeTaskModulr + return nil + } + + taskBankingCircle := new(TaskBankingCircle) + if err := utils.UnmarshalJSON(data, &taskBankingCircle, "", true, true); err == nil { + u.TaskBankingCircle = taskBankingCircle + u.Type = TaskResponseDataTypeTaskBankingCircle + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u TaskResponseData) MarshalJSON() ([]byte, error) { + if u.TaskStripe != nil { + return utils.MarshalJSON(u.TaskStripe, "", true) + } + + if u.TaskWise != nil { + return utils.MarshalJSON(u.TaskWise, "", true) + } + + if u.TaskCurrencyCloud != nil { + return utils.MarshalJSON(u.TaskCurrencyCloud, "", true) + } + + if u.TaskDummyPay != nil { + return utils.MarshalJSON(u.TaskDummyPay, "", true) + } + + if u.TaskModulr != nil { + return utils.MarshalJSON(u.TaskModulr, "", true) + } + + if u.TaskBankingCircle != nil { + return utils.MarshalJSON(u.TaskBankingCircle, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} + type TaskResponse struct { - Data interface{} `json:"data"` + Data TaskResponseData `json:"data"` +} + +func (o *TaskResponse) GetData() TaskResponseData { + if o == nil { + return TaskResponseData{} + } + return o.Data } diff --git a/pkg/models/shared/taskscursor.go b/pkg/models/shared/taskscursor.go index f7b66df..34f725b 100755 --- a/pkg/models/shared/taskscursor.go +++ b/pkg/models/shared/taskscursor.go @@ -1,13 +1,213 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared +import ( + "errors" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" +) + +type TasksCursorCursorDataType string + +const ( + TasksCursorCursorDataTypeTaskStripe TasksCursorCursorDataType = "TaskStripe" + TasksCursorCursorDataTypeTaskWise TasksCursorCursorDataType = "TaskWise" + TasksCursorCursorDataTypeTaskCurrencyCloud TasksCursorCursorDataType = "TaskCurrencyCloud" + TasksCursorCursorDataTypeTaskDummyPay TasksCursorCursorDataType = "TaskDummyPay" + TasksCursorCursorDataTypeTaskModulr TasksCursorCursorDataType = "TaskModulr" + TasksCursorCursorDataTypeTaskBankingCircle TasksCursorCursorDataType = "TaskBankingCircle" +) + +type TasksCursorCursorData struct { + TaskStripe *TaskStripe + TaskWise *TaskWise + TaskCurrencyCloud *TaskCurrencyCloud + TaskDummyPay *TaskDummyPay + TaskModulr *TaskModulr + TaskBankingCircle *TaskBankingCircle + + Type TasksCursorCursorDataType +} + +func CreateTasksCursorCursorDataTaskStripe(taskStripe TaskStripe) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskStripe + + return TasksCursorCursorData{ + TaskStripe: &taskStripe, + Type: typ, + } +} + +func CreateTasksCursorCursorDataTaskWise(taskWise TaskWise) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskWise + + return TasksCursorCursorData{ + TaskWise: &taskWise, + Type: typ, + } +} + +func CreateTasksCursorCursorDataTaskCurrencyCloud(taskCurrencyCloud TaskCurrencyCloud) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskCurrencyCloud + + return TasksCursorCursorData{ + TaskCurrencyCloud: &taskCurrencyCloud, + Type: typ, + } +} + +func CreateTasksCursorCursorDataTaskDummyPay(taskDummyPay TaskDummyPay) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskDummyPay + + return TasksCursorCursorData{ + TaskDummyPay: &taskDummyPay, + Type: typ, + } +} + +func CreateTasksCursorCursorDataTaskModulr(taskModulr TaskModulr) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskModulr + + return TasksCursorCursorData{ + TaskModulr: &taskModulr, + Type: typ, + } +} + +func CreateTasksCursorCursorDataTaskBankingCircle(taskBankingCircle TaskBankingCircle) TasksCursorCursorData { + typ := TasksCursorCursorDataTypeTaskBankingCircle + + return TasksCursorCursorData{ + TaskBankingCircle: &taskBankingCircle, + Type: typ, + } +} + +func (u *TasksCursorCursorData) UnmarshalJSON(data []byte) error { + + taskStripe := new(TaskStripe) + if err := utils.UnmarshalJSON(data, &taskStripe, "", true, true); err == nil { + u.TaskStripe = taskStripe + u.Type = TasksCursorCursorDataTypeTaskStripe + return nil + } + + taskWise := new(TaskWise) + if err := utils.UnmarshalJSON(data, &taskWise, "", true, true); err == nil { + u.TaskWise = taskWise + u.Type = TasksCursorCursorDataTypeTaskWise + return nil + } + + taskCurrencyCloud := new(TaskCurrencyCloud) + if err := utils.UnmarshalJSON(data, &taskCurrencyCloud, "", true, true); err == nil { + u.TaskCurrencyCloud = taskCurrencyCloud + u.Type = TasksCursorCursorDataTypeTaskCurrencyCloud + return nil + } + + taskDummyPay := new(TaskDummyPay) + if err := utils.UnmarshalJSON(data, &taskDummyPay, "", true, true); err == nil { + u.TaskDummyPay = taskDummyPay + u.Type = TasksCursorCursorDataTypeTaskDummyPay + return nil + } + + taskModulr := new(TaskModulr) + if err := utils.UnmarshalJSON(data, &taskModulr, "", true, true); err == nil { + u.TaskModulr = taskModulr + u.Type = TasksCursorCursorDataTypeTaskModulr + return nil + } + + taskBankingCircle := new(TaskBankingCircle) + if err := utils.UnmarshalJSON(data, &taskBankingCircle, "", true, true); err == nil { + u.TaskBankingCircle = taskBankingCircle + u.Type = TasksCursorCursorDataTypeTaskBankingCircle + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u TasksCursorCursorData) MarshalJSON() ([]byte, error) { + if u.TaskStripe != nil { + return utils.MarshalJSON(u.TaskStripe, "", true) + } + + if u.TaskWise != nil { + return utils.MarshalJSON(u.TaskWise, "", true) + } + + if u.TaskCurrencyCloud != nil { + return utils.MarshalJSON(u.TaskCurrencyCloud, "", true) + } + + if u.TaskDummyPay != nil { + return utils.MarshalJSON(u.TaskDummyPay, "", true) + } + + if u.TaskModulr != nil { + return utils.MarshalJSON(u.TaskModulr, "", true) + } + + if u.TaskBankingCircle != nil { + return utils.MarshalJSON(u.TaskBankingCircle, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} + type TasksCursorCursor struct { - Data []interface{} `json:"data"` - HasMore bool `json:"hasMore"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` + Data []TasksCursorCursorData `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *TasksCursorCursor) GetData() []TasksCursorCursorData { + if o == nil { + return []TasksCursorCursorData{} + } + return o.Data +} + +func (o *TasksCursorCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *TasksCursorCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *TasksCursorCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *TasksCursorCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous } type TasksCursor struct { Cursor TasksCursorCursor `json:"cursor"` } + +func (o *TasksCursor) GetCursor() TasksCursorCursor { + if o == nil { + return TasksCursorCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/taskstripe.go b/pkg/models/shared/taskstripe.go index 56b9034..b6bf77b 100755 --- a/pkg/models/shared/taskstripe.go +++ b/pkg/models/shared/taskstripe.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,13 +13,104 @@ type TaskStripeDescriptor struct { Name string `json:"name"` } +func (o *TaskStripeDescriptor) GetAccount() string { + if o == nil { + return "" + } + return o.Account +} + +func (o *TaskStripeDescriptor) GetMain() *bool { + if o == nil { + return nil + } + return o.Main +} + +func (o *TaskStripeDescriptor) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +type TaskStripeState struct { +} + type TaskStripe struct { - ConnectorID string `json:"connectorId"` - CreatedAt time.Time `json:"createdAt"` - Descriptor TaskStripeDescriptor `json:"descriptor"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` + ConnectorID string `json:"connectorId"` + CreatedAt time.Time `json:"createdAt"` + Descriptor TaskStripeDescriptor `json:"descriptor"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + State TaskStripeState `json:"state"` + Status PaymentStatus `json:"status"` + UpdatedAt time.Time `json:"updatedAt"` +} + +func (t TaskStripe) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskStripe) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskStripe) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskStripe) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskStripe) GetDescriptor() TaskStripeDescriptor { + if o == nil { + return TaskStripeDescriptor{} + } + return o.Descriptor +} + +func (o *TaskStripe) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskStripe) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskStripe) GetState() TaskStripeState { + if o == nil { + return TaskStripeState{} + } + return o.State +} + +func (o *TaskStripe) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskStripe) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt } diff --git a/pkg/models/shared/taskwise.go b/pkg/models/shared/taskwise.go index c19da74..bf00a1c 100755 --- a/pkg/models/shared/taskwise.go +++ b/pkg/models/shared/taskwise.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,13 +13,104 @@ type TaskWiseDescriptor struct { ProfileID *int64 `json:"profileID,omitempty"` } +func (o *TaskWiseDescriptor) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *TaskWiseDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *TaskWiseDescriptor) GetProfileID() *int64 { + if o == nil { + return nil + } + return o.ProfileID +} + +type TaskWiseState struct { +} + type TaskWise struct { - ConnectorID string `json:"connectorId"` - CreatedAt time.Time `json:"createdAt"` - Descriptor TaskWiseDescriptor `json:"descriptor"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatusEnum `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` + ConnectorID string `json:"connectorId"` + CreatedAt time.Time `json:"createdAt"` + Descriptor TaskWiseDescriptor `json:"descriptor"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + State TaskWiseState `json:"state"` + Status PaymentStatus `json:"status"` + UpdatedAt time.Time `json:"updatedAt"` +} + +func (t TaskWise) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskWise) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, true); err != nil { + return err + } + return nil +} + +func (o *TaskWise) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *TaskWise) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *TaskWise) GetDescriptor() TaskWiseDescriptor { + if o == nil { + return TaskWiseDescriptor{} + } + return o.Descriptor +} + +func (o *TaskWise) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *TaskWise) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TaskWise) GetState() TaskWiseState { + if o == nil { + return TaskWiseState{} + } + return o.State +} + +func (o *TaskWise) GetStatus() PaymentStatus { + if o == nil { + return PaymentStatus("") + } + return o.Status +} + +func (o *TaskWise) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt } diff --git a/pkg/models/shared/transaction.go b/pkg/models/shared/transaction.go index 5633228..3fa8289 100755 --- a/pkg/models/shared/transaction.go +++ b/pkg/models/shared/transaction.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -13,3 +16,63 @@ type Transaction struct { Timestamp time.Time `json:"timestamp"` Txid int64 `json:"txid"` } + +func (t Transaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *Transaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Transaction) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Transaction) GetPostCommitVolumes() map[string]map[string]Volume { + if o == nil { + return nil + } + return o.PostCommitVolumes +} + +func (o *Transaction) GetPostings() []Posting { + if o == nil { + return []Posting{} + } + return o.Postings +} + +func (o *Transaction) GetPreCommitVolumes() map[string]map[string]Volume { + if o == nil { + return nil + } + return o.PreCommitVolumes +} + +func (o *Transaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *Transaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} + +func (o *Transaction) GetTxid() int64 { + if o == nil { + return 0 + } + return o.Txid +} diff --git a/pkg/models/shared/transactiondata.go b/pkg/models/shared/transactiondata.go index 75b1605..9e730a5 100755 --- a/pkg/models/shared/transactiondata.go +++ b/pkg/models/shared/transactiondata.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,3 +13,42 @@ type TransactionData struct { Reference *string `json:"reference,omitempty"` Timestamp *time.Time `json:"timestamp,omitempty"` } + +func (t TransactionData) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TransactionData) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TransactionData) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *TransactionData) GetPostings() []Posting { + if o == nil { + return []Posting{} + } + return o.Postings +} + +func (o *TransactionData) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *TransactionData) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} diff --git a/pkg/models/shared/transactionresponse.go b/pkg/models/shared/transactionresponse.go index 11da333..9d2ab66 100755 --- a/pkg/models/shared/transactionresponse.go +++ b/pkg/models/shared/transactionresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type TransactionResponse struct { Data Transaction `json:"data"` } + +func (o *TransactionResponse) GetData() Transaction { + if o == nil { + return Transaction{} + } + return o.Data +} diff --git a/pkg/models/shared/transactions.go b/pkg/models/shared/transactions.go index 294d061..4fe48e4 100755 --- a/pkg/models/shared/transactions.go +++ b/pkg/models/shared/transactions.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Transactions struct { Transactions []TransactionData `json:"transactions"` } + +func (o *Transactions) GetTransactions() []TransactionData { + if o == nil { + return []TransactionData{} + } + return o.Transactions +} diff --git a/pkg/models/shared/transactionscursorresponse.go b/pkg/models/shared/transactionscursorresponse.go index 6ae0195..e9256bd 100755 --- a/pkg/models/shared/transactionscursorresponse.go +++ b/pkg/models/shared/transactionscursorresponse.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type TransactionsCursorResponseCursor struct { @@ -8,6 +10,48 @@ type TransactionsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } +func (o *TransactionsCursorResponseCursor) GetData() []Transaction { + if o == nil { + return []Transaction{} + } + return o.Data +} + +func (o *TransactionsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *TransactionsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *TransactionsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *TransactionsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + type TransactionsCursorResponse struct { Cursor TransactionsCursorResponseCursor `json:"cursor"` } + +func (o *TransactionsCursorResponse) GetCursor() TransactionsCursorResponseCursor { + if o == nil { + return TransactionsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/transactionsresponse.go b/pkg/models/shared/transactionsresponse.go index 4a17e4d..8fc288d 100755 --- a/pkg/models/shared/transactionsresponse.go +++ b/pkg/models/shared/transactionsresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type TransactionsResponse struct { Data []Transaction `json:"data"` } + +func (o *TransactionsResponse) GetData() []Transaction { + if o == nil { + return []Transaction{} + } + return o.Data +} diff --git a/pkg/models/shared/updateclientrequest.go b/pkg/models/shared/updateclientrequest.go index 3a571ad..8b0771e 100755 --- a/pkg/models/shared/updateclientrequest.go +++ b/pkg/models/shared/updateclientrequest.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type UpdateClientRequest struct { @@ -9,3 +11,52 @@ type UpdateClientRequest struct { RedirectUris []string `json:"redirectUris,omitempty"` Trusted *bool `json:"trusted,omitempty"` } + +func (o *UpdateClientRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *UpdateClientRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *UpdateClientRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *UpdateClientRequest) GetPostLogoutRedirectUris() []string { + if o == nil { + return nil + } + return o.PostLogoutRedirectUris +} + +func (o *UpdateClientRequest) GetPublic() *bool { + if o == nil { + return nil + } + return o.Public +} + +func (o *UpdateClientRequest) GetRedirectUris() []string { + if o == nil { + return nil + } + return o.RedirectUris +} + +func (o *UpdateClientRequest) GetTrusted() *bool { + if o == nil { + return nil + } + return o.Trusted +} diff --git a/pkg/models/shared/updateclientresponse.go b/pkg/models/shared/updateclientresponse.go index 80d25d4..b7c449c 100755 --- a/pkg/models/shared/updateclientresponse.go +++ b/pkg/models/shared/updateclientresponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type UpdateClientResponse struct { Data *Client `json:"data,omitempty"` } + +func (o *UpdateClientResponse) GetData() *Client { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/updatescoperequest.go b/pkg/models/shared/updatescoperequest.go index 4b28255..b299259 100755 --- a/pkg/models/shared/updatescoperequest.go +++ b/pkg/models/shared/updatescoperequest.go @@ -1,6 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type UpdateScopeRequest struct { Label string `json:"label"` Metadata map[string]interface{} `json:"metadata,omitempty"` } + +func (o *UpdateScopeRequest) GetLabel() string { + if o == nil { + return "" + } + return o.Label +} + +func (o *UpdateScopeRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/pkg/models/shared/updatescoperesponse.go b/pkg/models/shared/updatescoperesponse.go index 7c8a7f2..766faea 100755 --- a/pkg/models/shared/updatescoperesponse.go +++ b/pkg/models/shared/updatescoperesponse.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type UpdateScopeResponse struct { Data *Scope `json:"data,omitempty"` } + +func (o *UpdateScopeResponse) GetData() *Scope { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/user.go b/pkg/models/shared/user.go index b938207..d09b227 100755 --- a/pkg/models/shared/user.go +++ b/pkg/models/shared/user.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type User struct { @@ -5,3 +7,24 @@ type User struct { ID *string `json:"id,omitempty"` Subject *string `json:"subject,omitempty"` } + +func (o *User) GetEmail() *string { + if o == nil { + return nil + } + return o.Email +} + +func (o *User) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *User) GetSubject() *string { + if o == nil { + return nil + } + return o.Subject +} diff --git a/pkg/models/shared/volume.go b/pkg/models/shared/volume.go index 55dff3d..8307f51 100755 --- a/pkg/models/shared/volume.go +++ b/pkg/models/shared/volume.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type Volume struct { @@ -5,3 +7,24 @@ type Volume struct { Input int64 `json:"input"` Output int64 `json:"output"` } + +func (o *Volume) GetBalance() *int64 { + if o == nil { + return nil + } + return o.Balance +} + +func (o *Volume) GetInput() int64 { + if o == nil { + return 0 + } + return o.Input +} + +func (o *Volume) GetOutput() int64 { + if o == nil { + return 0 + } + return o.Output +} diff --git a/pkg/models/shared/wallet.go b/pkg/models/shared/wallet.go index c521632..d45f3ad 100755 --- a/pkg/models/shared/wallet.go +++ b/pkg/models/shared/wallet.go @@ -1,13 +1,64 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) type Wallet struct { - CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - Ledger string `json:"ledger"` - Metadata map[string]interface{} `json:"metadata"` - Name string `json:"name"` + CreatedAt time.Time `json:"createdAt"` + // The unique ID of the wallet. + ID string `json:"id"` + Ledger string `json:"ledger"` + // Metadata associated with the wallet. + Metadata map[string]interface{} `json:"metadata"` + Name string `json:"name"` +} + +func (w Wallet) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *Wallet) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Wallet) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Wallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Wallet) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *Wallet) GetMetadata() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Metadata +} + +func (o *Wallet) GetName() string { + if o == nil { + return "" + } + return o.Name } diff --git a/pkg/models/shared/walletserrorresponse.go b/pkg/models/shared/walletserrorresponse.go index 5c9d268..35cc659 100755 --- a/pkg/models/shared/walletserrorresponse.go +++ b/pkg/models/shared/walletserrorresponse.go @@ -1,12 +1,34 @@ -package shared +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -type WalletsErrorResponseErrorCodeEnum string +package shared -const ( - WalletsErrorResponseErrorCodeEnumValidation WalletsErrorResponseErrorCodeEnum = "VALIDATION" +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" ) type WalletsErrorResponse struct { - ErrorCode WalletsErrorResponseErrorCodeEnum `json:"errorCode"` - ErrorMessage string `json:"errorMessage"` + errorCode string `const:"VALIDATION" json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (w WalletsErrorResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WalletsErrorResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WalletsErrorResponse) GetErrorCode() string { + return "VALIDATION" +} + +func (o *WalletsErrorResponse) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage } diff --git a/pkg/models/shared/walletstransaction.go b/pkg/models/shared/walletstransaction.go index e3bbe13..48f7664 100755 --- a/pkg/models/shared/walletstransaction.go +++ b/pkg/models/shared/walletstransaction.go @@ -1,10 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) type WalletsTransaction struct { + // Metadata associated with the wallet. Metadata map[string]interface{} `json:"metadata,omitempty"` PostCommitVolumes map[string]map[string]WalletsVolume `json:"postCommitVolumes,omitempty"` Postings []Posting `json:"postings"` @@ -13,3 +17,63 @@ type WalletsTransaction struct { Timestamp time.Time `json:"timestamp"` Txid int64 `json:"txid"` } + +func (w WalletsTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WalletsTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WalletsTransaction) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *WalletsTransaction) GetPostCommitVolumes() map[string]map[string]WalletsVolume { + if o == nil { + return nil + } + return o.PostCommitVolumes +} + +func (o *WalletsTransaction) GetPostings() []Posting { + if o == nil { + return []Posting{} + } + return o.Postings +} + +func (o *WalletsTransaction) GetPreCommitVolumes() map[string]map[string]WalletsVolume { + if o == nil { + return nil + } + return o.PreCommitVolumes +} + +func (o *WalletsTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *WalletsTransaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} + +func (o *WalletsTransaction) GetTxid() int64 { + if o == nil { + return 0 + } + return o.Txid +} diff --git a/pkg/models/shared/walletsubject.go b/pkg/models/shared/walletsubject.go new file mode 100755 index 0000000..b06b40b --- /dev/null +++ b/pkg/models/shared/walletsubject.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type WalletSubject struct { + Balance *string `json:"balance,omitempty"` + Identifier string `json:"identifier"` + Type string `json:"type"` +} + +func (o *WalletSubject) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *WalletSubject) GetIdentifier() string { + if o == nil { + return "" + } + return o.Identifier +} + +func (o *WalletSubject) GetType() string { + if o == nil { + return "" + } + return o.Type +} diff --git a/pkg/models/shared/walletsvolume.go b/pkg/models/shared/walletsvolume.go index fa3966a..3e041ab 100755 --- a/pkg/models/shared/walletsvolume.go +++ b/pkg/models/shared/walletsvolume.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type WalletsVolume struct { @@ -5,3 +7,24 @@ type WalletsVolume struct { Input int64 `json:"input"` Output int64 `json:"output"` } + +func (o *WalletsVolume) GetBalance() int64 { + if o == nil { + return 0 + } + return o.Balance +} + +func (o *WalletsVolume) GetInput() int64 { + if o == nil { + return 0 + } + return o.Input +} + +func (o *WalletsVolume) GetOutput() int64 { + if o == nil { + return 0 + } + return o.Output +} diff --git a/pkg/models/shared/walletwithbalances.go b/pkg/models/shared/walletwithbalances.go index ace09b1..4dea9ce 100755 --- a/pkg/models/shared/walletwithbalances.go +++ b/pkg/models/shared/walletwithbalances.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -8,11 +11,73 @@ type WalletWithBalancesBalances struct { Main AssetHolder `json:"main"` } +func (o *WalletWithBalancesBalances) GetMain() AssetHolder { + if o == nil { + return AssetHolder{} + } + return o.Main +} + type WalletWithBalances struct { Balances WalletWithBalancesBalances `json:"balances"` CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - Ledger string `json:"ledger"` - Metadata map[string]interface{} `json:"metadata"` - Name string `json:"name"` + // The unique ID of the wallet. + ID string `json:"id"` + Ledger string `json:"ledger"` + // Metadata associated with the wallet. + Metadata map[string]interface{} `json:"metadata"` + Name string `json:"name"` +} + +func (w WalletWithBalances) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WalletWithBalances) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WalletWithBalances) GetBalances() WalletWithBalancesBalances { + if o == nil { + return WalletWithBalancesBalances{} + } + return o.Balances +} + +func (o *WalletWithBalances) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *WalletWithBalances) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *WalletWithBalances) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *WalletWithBalances) GetMetadata() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Metadata +} + +func (o *WalletWithBalances) GetName() string { + if o == nil { + return "" + } + return o.Name } diff --git a/pkg/models/shared/webhooksconfig.go b/pkg/models/shared/webhooksconfig.go new file mode 100755 index 0000000..705bee0 --- /dev/null +++ b/pkg/models/shared/webhooksconfig.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "time" +) + +type WebhooksConfig struct { + Active *bool `json:"active,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ID *string `json:"id,omitempty"` + Secret *string `json:"secret,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +func (w WebhooksConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebhooksConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WebhooksConfig) GetActive() *bool { + if o == nil { + return nil + } + return o.Active +} + +func (o *WebhooksConfig) GetCreatedAt() *time.Time { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *WebhooksConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *WebhooksConfig) GetEventTypes() []string { + if o == nil { + return nil + } + return o.EventTypes +} + +func (o *WebhooksConfig) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *WebhooksConfig) GetSecret() *string { + if o == nil { + return nil + } + return o.Secret +} + +func (o *WebhooksConfig) GetUpdatedAt() *time.Time { + if o == nil { + return nil + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/wiseconfig.go b/pkg/models/shared/wiseconfig.go index 38bed27..e2cc5d1 100755 --- a/pkg/models/shared/wiseconfig.go +++ b/pkg/models/shared/wiseconfig.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type WiseConfig struct { APIKey string `json:"apiKey"` } + +func (o *WiseConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} diff --git a/pkg/models/shared/workflow.go b/pkg/models/shared/workflow.go index 5a659b8..ac38268 100755 --- a/pkg/models/shared/workflow.go +++ b/pkg/models/shared/workflow.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -10,3 +13,42 @@ type Workflow struct { ID string `json:"id"` UpdatedAt time.Time `json:"updatedAt"` } + +func (w Workflow) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *Workflow) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Workflow) GetConfig() WorkflowConfig { + if o == nil { + return WorkflowConfig{} + } + return o.Config +} + +func (o *Workflow) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Workflow) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Workflow) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/workflowconfig.go b/pkg/models/shared/workflowconfig.go index 41a746d..5fb8883 100755 --- a/pkg/models/shared/workflowconfig.go +++ b/pkg/models/shared/workflowconfig.go @@ -1,5 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared type WorkflowConfig struct { Stages []map[string]interface{} `json:"stages"` } + +func (o *WorkflowConfig) GetStages() []map[string]interface{} { + if o == nil { + return []map[string]interface{}{} + } + return o.Stages +} diff --git a/pkg/models/shared/workflowoccurrence.go b/pkg/models/shared/workflowoccurrence.go index 434238a..9b1dc34 100755 --- a/pkg/models/shared/workflowoccurrence.go +++ b/pkg/models/shared/workflowoccurrence.go @@ -1,6 +1,9 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package shared import ( + "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "time" ) @@ -11,3 +14,49 @@ type WorkflowOccurrence struct { UpdatedAt time.Time `json:"updatedAt"` WorkflowID string `json:"workflowID"` } + +func (w WorkflowOccurrence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WorkflowOccurrence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WorkflowOccurrence) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *WorkflowOccurrence) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *WorkflowOccurrence) GetStatuses() []StageStatus { + if o == nil { + return []StageStatus{} + } + return o.Statuses +} + +func (o *WorkflowOccurrence) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *WorkflowOccurrence) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/types/bigint.go b/pkg/types/bigint.go new file mode 100755 index 0000000..afd0cd2 --- /dev/null +++ b/pkg/types/bigint.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import ( + "fmt" + "math/big" +) + +// MustNewBigIntFromString returns an instance of big.Int from a string +// The string is assumed to be base 10 and if it is not a valid big.Int +// then the function panics. +// Avoid using this function in production code. +func MustNewBigIntFromString(s string) *big.Int { + i, ok := new(big.Int).SetString(s, 10) + if !ok { + panic(fmt.Errorf("failed to parse string as big.Int")) + } + + return i +} diff --git a/pkg/types/date.go b/pkg/types/date.go index 7f3f43b..c4648fa 100755 --- a/pkg/types/date.go +++ b/pkg/types/date.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package types import ( @@ -7,6 +9,7 @@ import ( "time" ) +// Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". type Date struct { time.Time } @@ -17,6 +20,57 @@ var ( _ fmt.Stringer = &Date{} ) +// NewDate returns an instance of Date from a time.Time. +func NewDate(t time.Time) *Date { + d := DateFromTime(t) + return &d +} + +// DateFromTime returns a Date from a time.Time. +func DateFromTime(t time.Time) Date { + return Date{t} +} + +// NewDateFromString returns an instance of Date from a string formatted as "2006-01-02". +func NewDateFromString(str string) (*Date, error) { + d, err := DateFromString(str) + if err != nil { + return nil, err + } + + return &d, nil +} + +// DateFromString returns a Date from a string formatted as "2006-01-02". +func DateFromString(str string) (Date, error) { + var d Date + var err error + + d.Time, err = time.Parse("2006-01-02", str) + return d, err +} + +// MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustNewDateFromString(str string) *Date { + d := MustDateFromString(str) + return &d +} + +// MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustDateFromString(str string) Date { + d, err := DateFromString(str) + if err != nil { + panic(err) + } + return d +} + +func (d Date) GetTime() time.Time { + return d.Time +} + func (d Date) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil } diff --git a/pkg/types/datetime.go b/pkg/types/datetime.go new file mode 100755 index 0000000..0529b25 --- /dev/null +++ b/pkg/types/datetime.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import "time" + +// MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustTimeFromString(str string) time.Time { + t, err := time.Parse(time.RFC3339, str) + if err != nil { + panic(err) + } + + return t +} + +// MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustNewTimeFromString(str string) *time.Time { + t := MustTimeFromString(str) + return &t +} diff --git a/pkg/types/decimal.go b/pkg/types/decimal.go new file mode 100755 index 0000000..a42284b --- /dev/null +++ b/pkg/types/decimal.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import ( + "fmt" + + "github.com/ericlagergren/decimal" +) + +// MustNewDecimalFromString returns an instance of Decimal from a string +// Avoid using this function in production code. +func MustNewDecimalFromString(s string) *decimal.Big { + d, ok := new(decimal.Big).SetString(s) + if !ok { + panic(fmt.Errorf("failed to parse string as decimal.Big")) + } + + return d +} diff --git a/pkg/types/pointers.go b/pkg/types/pointers.go new file mode 100755 index 0000000..4f15e99 --- /dev/null +++ b/pkg/types/pointers.go @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +func String(s string) *string { return &s } +func Bool(b bool) *bool { return &b } +func Int(i int) *int { return &i } +func Int64(i int64) *int64 { return &i } +func Float32(f float32) *float32 { return &f } +func Float64(f float64) *float64 { return &f } diff --git a/pkg/utils/contenttype.go b/pkg/utils/contenttype.go index 41e0abd..8ed13e2 100755 --- a/pkg/utils/contenttype.go +++ b/pkg/utils/contenttype.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( diff --git a/pkg/utils/form.go b/pkg/utils/form.go index 0c118e8..40dd55c 100755 --- a/pkg/utils/form.go +++ b/pkg/utils/form.go @@ -1,22 +1,29 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( "fmt" + "math/big" "net/url" "reflect" "strings" "time" + "github.com/ericlagergren/decimal" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) -func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, getFieldName func(reflect.StructField) string) url.Values { +func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, getFieldName func(reflect.StructField) string) url.Values { + formValues := url.Values{} + if isNil(objType, objValue) { + return formValues + } + if objType.Kind() == reflect.Pointer { - if objValue.IsNil() { - return formValues - } objType = objType.Elem() objValue = objValue.Elem() } @@ -28,6 +35,10 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue formValues.Add(paramName, valToString(objValue.Interface())) case types.Date: formValues.Add(paramName, valToString(objValue.Interface())) + case big.Int: + formValues.Add(paramName, valToString(objValue.Interface())) + case decimal.Big: + formValues.Add(paramName, valToString(objValue.Interface())) default: var items []string @@ -35,11 +46,11 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue fieldType := objType.Field(i) valType := objValue.Field(i) - if valType.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } + if isNil(fieldType.Type, valType) { + continue + } + if valType.Kind() == reflect.Pointer { valType = valType.Elem() } @@ -51,12 +62,12 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue if explode { formValues.Add(fieldName, valToString(valType.Interface())) } else { - items = append(items, fmt.Sprintf("%s,%s", fieldName, valToString(valType.Interface()))) + items = append(items, fmt.Sprintf("%s%s%s", fieldName, delimiter, valToString(valType.Interface()))) } } if len(items) > 0 { - formValues.Add(paramName, strings.Join(items, ",")) + formValues.Add(paramName, strings.Join(items, delimiter)) } } case reflect.Map: @@ -67,15 +78,15 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue if explode { formValues.Add(iter.Key().String(), valToString(iter.Value().Interface())) } else { - items = append(items, fmt.Sprintf("%s,%s", iter.Key().String(), valToString(iter.Value().Interface()))) + items = append(items, fmt.Sprintf("%s%s%s", iter.Key().String(), delimiter, valToString(iter.Value().Interface()))) } } if len(items) > 0 { - formValues.Add(paramName, strings.Join(items, ",")) + formValues.Add(paramName, strings.Join(items, delimiter)) } case reflect.Slice, reflect.Array: - values := parseFormStyleArray(explode, objValue) + values := parseDelimitedArray(explode, objValue, delimiter) for _, v := range values { formValues.Add(paramName, v) } @@ -86,7 +97,7 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue return formValues } -func parseFormStyleArray(explode bool, objValue reflect.Value) []string { +func parseDelimitedArray(explode bool, objValue reflect.Value, delimiter string) []string { values := []string{} items := []string{} @@ -99,7 +110,7 @@ func parseFormStyleArray(explode bool, objValue reflect.Value) []string { } if len(items) > 0 { - values = append(values, strings.Join(items, ",")) + values = append(values, strings.Join(items, delimiter)) } return values diff --git a/pkg/utils/headers.go b/pkg/utils/headers.go index 4aa5ba0..0837022 100755 --- a/pkg/utils/headers.go +++ b/pkg/utils/headers.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( @@ -29,10 +31,11 @@ func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{} } func serializeHeader(objType reflect.Type, objValue reflect.Value, explode bool) string { + if isNil(objType, objValue) { + return "" + } + if objType.Kind() == reflect.Pointer { - if objValue.IsNil() { - return "" - } objType = objType.Elem() objValue = objValue.Elem() } @@ -45,10 +48,11 @@ func serializeHeader(objType reflect.Type, objValue reflect.Value, explode bool) fieldType := objType.Field(i) valType := objValue.Field(i) + if isNil(fieldType.Type, valType) { + continue + } + if fieldType.Type.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } valType = valType.Elem() } diff --git a/pkg/utils/json.go b/pkg/utils/json.go new file mode 100755 index 0000000..ab6f410 --- /dev/null +++ b/pkg/utils/json.go @@ -0,0 +1,573 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "bytes" + "encoding/json" + "fmt" + "math/big" + "reflect" + "strings" + "time" + "unsafe" + + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" + + "github.com/ericlagergren/decimal" +) + +func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel { + return json.Marshal(v) + } + + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + omitEmpty := false + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag == "omitempty" { + omitEmpty = true + } else { + fieldName = tag + } + } + } + + if isNil(field.Type, fieldVal) { + if omitEmpty { + continue + } + } + + if !field.IsExported() && field.Tag.Get("const") == "" { + continue + } + + additionalProperties := field.Tag.Get("additionalProperties") + if fieldName == "-" && additionalProperties == "" { + continue + } + + if additionalProperties == "true" { + if field.Type.Kind() != reflect.Map { + return nil, fmt.Errorf("additionalProperties must be a map") + } + + for _, key := range fieldVal.MapKeys() { + r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + continue + } + + var fv interface{} + + if field.IsExported() { + fv = fieldVal.Interface() + } else { + pt := reflect.New(typ).Elem() + pt.Set(val) + + pf := pt.Field(i) + + fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() + } + + r, err := marshalValue(fv, field.Tag) + if err != nil { + return nil, err + } + + out[fieldName] = r + } + + return json.Marshal(out) + default: + return marshalValue(v, tag) + } +} + +func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { + if reflect.TypeOf(v).Kind() != reflect.Ptr { + return fmt.Errorf("v must be a pointer") + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel || bytes.Equal(b, []byte("null")) { + d := json.NewDecoder(bytes.NewReader(b)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(v) + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(b, &unmarhsaled); err != nil { + return err + } + + var additionalPropertiesField *reflect.StructField + var additionalPropertiesValue *reflect.Value + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag != "omitempty" { + fieldName = tag + } + } + } + + if field.Tag.Get("additionalProperties") == "true" { + additionalPropertiesField = &field + additionalPropertiesValue = &fieldVal + continue + } + + // If we receive a value for a const field ignore it but mark it as unmarshaled + if field.Tag.Get("const") != "" { + if r, ok := unmarhsaled[fieldName]; ok { + val := string(r) + if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { + val = val[1 : len(val)-1] + } + if val != field.Tag.Get("const") { + return fmt.Errorf("const field %s does not match expected value %s", fieldName, field.Tag.Get("const")) + } + + delete(unmarhsaled, fieldName) + } + } else if !field.IsExported() { + continue + } + + value, ok := unmarhsaled[fieldName] + if !ok { + defaultTag := field.Tag.Get("default") + if defaultTag != "" { + value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) + ok = true + } + } else { + delete(unmarhsaled, fieldName) + } + + if ok { + if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { + return err + } + } + } + + keys := make([]string, 0, len(unmarhsaled)) + for k := range unmarhsaled { + keys = append(keys, k) + } + + if len(keys) > 0 { + if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { + return fmt.Errorf("unknown fields: %v", keys) + } + + if additionalPropertiesField != nil && additionalPropertiesValue != nil { + if additionalPropertiesValue.Kind() != reflect.Map { + return fmt.Errorf("additionalProperties must be a map") + } + + additionalPropertiesValue.Set(reflect.MakeMap(additionalPropertiesField.Type)) + + for key, value := range unmarhsaled { + val := reflect.New(additionalPropertiesField.Type.Elem()) + + if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { + return err + } + + additionalPropertiesValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) + } + } + } + default: + return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) + } + + return nil +} + +func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { + constTag := tag.Get("const") + if constTag != "" { + return handleDefaultConstValue(constTag, v, tag), nil + } + + if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { + defaultTag := tag.Get("default") + if defaultTag != "" { + return handleDefaultConstValue(defaultTag, v, tag), nil + } + + return []byte("null"), nil + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + switch typ.Kind() { + case reflect.Map: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for _, key := range val.MapKeys() { + itemVal := val.MapIndex(key) + + if isNil(itemVal.Type(), itemVal) { + out[key.String()] = []byte("null") + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + return json.Marshal(out) + case reflect.Slice, reflect.Array: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := []json.RawMessage{} + + for i := 0; i < val.Len(); i++ { + itemVal := val.Index(i) + + if isNil(itemVal.Type(), itemVal) { + out = append(out, []byte("null")) + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out = append(out, r) + } + + return json.Marshal(out) + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil + case reflect.TypeOf(big.Int{}): + format := tag.Get("bigint") + if format == "string" { + b := val.Interface().(big.Int) + return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil + } + case reflect.TypeOf(decimal.Big{}): + format := tag.Get("decimal") + if format == "number" { + b := val.Interface().(decimal.Big) + f, ok := (&b).Float64() + if ok { + return []byte(b.String()), nil + } + + return []byte(fmt.Sprintf(`%f`, f)), nil + } + } + } + + return json.Marshal(v) +} + +func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { + if tagValue == "null" { + return []byte("null") + } + + typ := dereferenceTypePointer(reflect.TypeOf(val)) + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + case reflect.TypeOf(big.Int{}): + bigIntTag := tag.Get("bigint") + if bigIntTag == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(decimal.Big{}): + decimalTag := tag.Get("decimal") + if decimalTag != "number" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(types.Date{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + default: + if typ.Kind() == reflect.String { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + } + + return []byte(tagValue) +} + +func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { + if bytes.Equal(value, []byte("null")) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + typ := dereferenceTypePointer(v.Type()) + + switch typ.Kind() { + case reflect.Map: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + m := reflect.MakeMap(typ) + + for k, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) + } + + v.Set(m) + return nil + case reflect.Slice, reflect.Array: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled []json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + arrVal := v + + for _, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + arrVal = reflect.Append(arrVal, itemVal.Elem()) + } + + v.Set(arrVal) + return nil + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + t, err := time.Parse(time.RFC3339Nano, s) + if err != nil { + return fmt.Errorf("failed to parse string as time.Time: %w", err) + } + + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(t)) + return nil + case reflect.TypeOf(big.Int{}): + var b *big.Int + + format := tag.Get("bigint") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var ok bool + b, ok = new(big.Int).SetString(s, 10) + if !ok { + return fmt.Errorf("failed to parse string as big.Int") + } + } else { + if err := json.Unmarshal(value, &b); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + case reflect.TypeOf(decimal.Big{}): + var d *decimal.Big + format := tag.Get("decimal") + if format == "number" { + var ok bool + d, ok = new(decimal.Big).SetString(string(value)) + if !ok { + return fmt.Errorf("failed to parse number as decimal.Big") + } + } else { + if err := json.Unmarshal(value, &d); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + case reflect.TypeOf(types.Date{}): + var s string + + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + d, err := types.DateFromString(s) + if err != nil { + return fmt.Errorf("failed to parse string as types.Date: %w", err) + } + + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + } + } + + var val interface{} + + if v.CanAddr() { + val = v.Addr().Interface() + } else { + val = v.Interface() + } + + d := json.NewDecoder(bytes.NewReader(value)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(val) +} + +func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return typ, val + } + + return dereferencePointers(typ, val) +} + +func dereferenceTypePointer(typ reflect.Type) reflect.Type { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } else { + return typ + } + + return dereferenceTypePointer(typ) +} + +func isComplexValueType(typ reflect.Type) bool { + switch typ.Kind() { + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + fallthrough + case reflect.TypeOf(big.Int{}): + fallthrough + case reflect.TypeOf(decimal.Big{}): + fallthrough + case reflect.TypeOf(types.Date{}): + return true + } + } + + return false +} + +func isModelType(typ reflect.Type) bool { + if isComplexValueType(typ) { + return false + } + + if typ.Kind() == reflect.Struct { + return true + } + + return false +} diff --git a/pkg/utils/pathparams.go b/pkg/utils/pathparams.go index dd79c88..d7202e7 100755 --- a/pkg/utils/pathparams.go +++ b/pkg/utils/pathparams.go @@ -1,14 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( "context" "fmt" + "math/big" + "net/url" "reflect" "strings" + "time" + + "github.com/ericlagergren/decimal" + + "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) -func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, globals map[string]map[string]map[string]interface{}) string { - url := strings.TrimSuffix(serverURL, "/") + path +func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, globals map[string]map[string]map[string]interface{}) (string, error) { + uri := strings.TrimSuffix(serverURL, "/") + path pathParamsStructType := reflect.TypeOf(pathParams) pathParamsValType := reflect.ValueOf(pathParams) @@ -31,27 +40,38 @@ func GenerateURL(ctx context.Context, serverURL, path string, pathParams interfa valType = populateFromGlobals(fieldType, valType, "pathParam", globals) - // TODO: support other styles - switch ppTag.Style { - case "simple": - simpleParams := getSimplePathParams(ctx, ppTag.ParamName, fieldType.Type, valType, ppTag.Explode) - for k, v := range simpleParams { - parsedParameters[k] = v + if ppTag.Serialization != "" { + vals, err := populateSerializedParams(ppTag, fieldType.Type, valType) + if err != nil { + return "", err + } + for k, v := range vals { + parsedParameters[k] = url.PathEscape(v) + } + } else { + // TODO: support other styles + switch ppTag.Style { + case "simple": + simpleParams := getSimplePathParams(ctx, ppTag.ParamName, fieldType.Type, valType, ppTag.Explode) + for k, v := range simpleParams { + parsedParameters[k] = v + } } } } // TODO should we handle the case where there are no matching path params? - return ReplaceParameters(url, parsedParameters) + return ReplaceParameters(uri, parsedParameters), nil } func getSimplePathParams(ctx context.Context, parentName string, objType reflect.Type, objValue reflect.Value, explode bool) map[string]string { pathParams := make(map[string]string) + if isNil(objType, objValue) { + return nil + } + if objType.Kind() == reflect.Ptr { - if objValue.IsNil() { - return nil - } objType = objType.Elem() objValue = objValue.Elem() } @@ -81,30 +101,42 @@ func getSimplePathParams(ctx context.Context, parentName string, objType reflect } pathParams[parentName] = strings.Join(ppVals, ",") case reflect.Struct: - var ppVals []string - for i := 0; i < objType.NumField(); i++ { - fieldType := objType.Field(i) - valType := objValue.Field(i) - - ppTag := parseParamTag(pathParamTagKey, fieldType, "simple", explode) - if ppTag == nil { - continue - } + switch objValue.Interface().(type) { + case time.Time: + pathParams[parentName] = valToString(objValue.Interface()) + case types.Date: + pathParams[parentName] = valToString(objValue.Interface()) + case big.Int: + pathParams[parentName] = valToString(objValue.Interface()) + case decimal.Big: + pathParams[parentName] = valToString(objValue.Interface()) + default: + var ppVals []string + for i := 0; i < objType.NumField(); i++ { + fieldType := objType.Field(i) + valType := objValue.Field(i) + + ppTag := parseParamTag(pathParamTagKey, fieldType, "simple", explode) + if ppTag == nil { + continue + } - if fieldType.Type.Kind() == reflect.Pointer { - if valType.IsNil() { + if isNil(fieldType.Type, valType) { continue } - valType = valType.Elem() - } - if explode { - ppVals = append(ppVals, fmt.Sprintf("%s=%s", ppTag.ParamName, valToString(valType.Interface()))) - } else { - ppVals = append(ppVals, fmt.Sprintf("%s,%s", ppTag.ParamName, valToString(valType.Interface()))) + if fieldType.Type.Kind() == reflect.Pointer { + valType = valType.Elem() + } + + if explode { + ppVals = append(ppVals, fmt.Sprintf("%s=%s", ppTag.ParamName, valToString(valType.Interface()))) + } else { + ppVals = append(ppVals, fmt.Sprintf("%s,%s", ppTag.ParamName, valToString(valType.Interface()))) + } } + pathParams[parentName] = strings.Join(ppVals, ",") } - pathParams[parentName] = strings.Join(ppVals, ",") default: pathParams[parentName] = valToString(objValue.Interface()) } diff --git a/pkg/utils/queryparams.go b/pkg/utils/queryparams.go index 11f3322..0e94bce 100755 --- a/pkg/utils/queryparams.go +++ b/pkg/utils/queryparams.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( @@ -32,14 +34,12 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int valType = populateFromGlobals(fieldType, valType, "queryParam", globals) if qpTag.Serialization != "" { - vals, err := populateSerializedParams(req, qpTag, fieldType.Type, valType) + vals, err := populateSerializedParams(qpTag, fieldType.Type, valType) if err != nil { return err } for k, v := range vals { - for _, vv := range v { - values.Add(k, vv) - } + values.Add(k, v) } } else { switch qpTag.Style { @@ -51,7 +51,14 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int } } case "form": - vals := populateFormParams(req, qpTag, fieldType.Type, valType) + vals := populateFormParams(req, qpTag, fieldType.Type, valType, ",") + for k, v := range vals { + for _, vv := range v { + values.Add(k, vv) + } + } + case "pipeDelimited": + vals := populateFormParams(req, qpTag, fieldType.Type, valType, "|") for k, v := range vals { for _, vv := range v { values.Add(k, vv) @@ -68,18 +75,16 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int return nil } -func populateSerializedParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value) (url.Values, error) { - values := url.Values{} +func populateSerializedParams(tag *paramTag, objType reflect.Type, objValue reflect.Value) (map[string]string, error) { + if isNil(objType, objValue) { + return nil, nil + } if objType.Kind() == reflect.Pointer { - if objValue.IsNil() { - return values, nil - } objValue = objValue.Elem() } - if objValue.Interface() == nil { - return values, nil - } + + values := map[string]string{} switch tag.Serialization { case "json": @@ -87,7 +92,7 @@ func populateSerializedParams(req *http.Request, tag *paramTag, objType reflect. if err != nil { return nil, fmt.Errorf("error marshaling json: %v", err) } - values.Add(tag.ParamName, string(data)) + values[tag.ParamName] = string(data) } return values, nil @@ -96,10 +101,11 @@ func populateSerializedParams(req *http.Request, tag *paramTag, objType reflect. func populateDeepObjectParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value) url.Values { values := url.Values{} + if isNil(objType, objValue) { + return values + } + if objType.Kind() == reflect.Pointer { - if objValue.IsNil() { - return values - } objType = objType.Elem() objValue = objValue.Elem() } @@ -110,10 +116,11 @@ func populateDeepObjectParams(req *http.Request, tag *paramTag, objType reflect. fieldType := objType.Field(i) valType := objValue.Field(i) + if isNil(fieldType.Type, valType) { + continue + } + if fieldType.Type.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } valType = valType.Elem() } @@ -148,8 +155,8 @@ func populateDeepObjectParams(req *http.Request, tag *paramTag, objType reflect. return values } -func populateFormParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value) url.Values { - return populateForm(tag.ParamName, tag.Explode, objType, objValue, func(fieldType reflect.StructField) string { +func populateFormParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string) url.Values { + return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, func(fieldType reflect.StructField) string { qpTag := parseQueryParamTag(fieldType) if qpTag == nil { return "" diff --git a/pkg/utils/requestbody.go b/pkg/utils/requestbody.go index c308e2f..b8f1864 100755 --- a/pkg/utils/requestbody.go +++ b/pkg/utils/requestbody.go @@ -1,9 +1,10 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( "bytes" "context" - "encoding/json" "fmt" "io" "mime/multipart" @@ -24,21 +25,25 @@ var ( urlEncodedEncodingRegex = regexp.MustCompile(`application\/x-www-form-urlencoded.*`) ) -func SerializeRequestBody(ctx context.Context, request interface{}, requestFieldName string, serializationMethod string) (*bytes.Buffer, string, error) { +func SerializeRequestBody(ctx context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { requestStructType := reflect.TypeOf(request) requestValType := reflect.ValueOf(request) - if requestStructType.Kind() == reflect.Pointer { - if requestValType.IsNil() { + if isNil(requestStructType, requestValType) { + if optional || !nullable { return nil, "", nil } + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) + } + + if requestStructType.Kind() == reflect.Pointer { requestStructType = requestStructType.Elem() requestValType = requestValType.Elem() } if requestStructType.Kind() != reflect.Struct { - return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType) + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) } requestField, ok := requestStructType.FieldByName(requestFieldName) @@ -48,24 +53,44 @@ func SerializeRequestBody(ctx context.Context, request interface{}, requestField if tag != nil { // request object (non-flattened) requestVal := requestValType.FieldByName(requestFieldName) - if requestField.Type.Kind() == reflect.Pointer && requestVal.IsNil() { - return nil, "", nil + if isNil(requestField.Type, requestVal) { + if optional || !nullable { + return nil, "", nil + } + + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestVal, tag.MediaType) } - return serializeContentType(requestFieldName, tag.MediaType, requestVal) + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) } } // flattened request object - return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType) + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], reflect.ValueOf(request), tag) } -func serializeContentType(fieldName string, mediaType string, val reflect.Value) (*bytes.Buffer, string, error) { +func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (*bytes.Buffer, string, error) { buf := &bytes.Buffer{} + if isNil(val.Type(), val) { + // TODO: what does a null mean for other content types? Just returning an empty buffer for now + if jsonEncodingRegex.MatchString(mediaType) { + if _, err := buf.Write([]byte("null")); err != nil { + return nil, "", err + } + } + + return buf, mediaType, nil + } + switch { case jsonEncodingRegex.MatchString(mediaType): - if err := json.NewEncoder(buf).Encode(val.Interface()); err != nil { + data, err := MarshalJSON(val.Interface(), reflect.StructTag(tag), true) + if err != nil { + return nil, "", err + } + + if _, err := buf.Write(data); err != nil { return nil, "", err } case multipartEncodingRegex.MatchString(mediaType): @@ -114,11 +139,11 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { fieldType := field.Type valType := requestValType.Field(i) - if fieldType.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } + if isNil(fieldType, valType) { + continue + } + if fieldType.Kind() == reflect.Pointer { fieldType = fieldType.Elem() valType = valType.Elem() } @@ -135,7 +160,7 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { writer.Close() return "", err } - d, err := json.Marshal(valType.Interface()) + d, err := MarshalJSON(valType.Interface(), field.Tag, true) if err != nil { writer.Close() return "", err @@ -147,7 +172,7 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { } else { switch fieldType.Kind() { case reflect.Slice, reflect.Array: - values := parseFormStyleArray(true, valType) + values := parseDelimitedArray(true, valType, ",") for _, v := range values { if err := writer.WriteField(tag.Name+"[]", v); err != nil { writer.Close() @@ -229,18 +254,18 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { fieldType := field.Type valType := requestValType.Field(i) - if fieldType.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } + if isNil(fieldType, valType) { + continue + } + if fieldType.Kind() == reflect.Pointer { fieldType = fieldType.Elem() valType = valType.Elem() } tag := parseFormTag(field) if tag.JSON { - data, err := json.Marshal(valType.Interface()) + data, err := MarshalJSON(valType.Interface(), field.Tag, true) if err != nil { return err } @@ -249,7 +274,7 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { switch tag.Style { // TODO: support other styles case "form": - values := populateForm(tag.Name, tag.Explode, fieldType, valType, func(sf reflect.StructField) string { + values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", func(sf reflect.StructField) string { tag := parseFormTag(field) if tag == nil { return "" diff --git a/pkg/utils/retries.go b/pkg/utils/retries.go index 09f13a2..ff39d0d 100755 --- a/pkg/utils/retries.go +++ b/pkg/utils/retries.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( diff --git a/pkg/utils/security.go b/pkg/utils/security.go index da2b90a..675cd57 100755 --- a/pkg/utils/security.go +++ b/pkg/utils/security.go @@ -1,3 +1,5 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( @@ -67,11 +69,11 @@ func parseSecurityStruct(c HTTPClient, security interface{}) *SecurityClient { securityStructType := reflect.TypeOf(security) securityValType := reflect.ValueOf(security) - if securityStructType.Kind() == reflect.Ptr { - if securityValType.IsNil() { - return nil - } + if isNil(securityStructType, securityValType) { + return nil + } + if securityStructType.Kind() == reflect.Ptr { securityStructType = securityStructType.Elem() securityValType = securityValType.Elem() } @@ -84,11 +86,11 @@ func parseSecurityStruct(c HTTPClient, security interface{}) *SecurityClient { kind := valType.Kind() - if fieldType.Type.Kind() == reflect.Pointer { - if valType.IsNil() { - continue - } + if isNil(fieldType.Type, valType) { + continue + } + if fieldType.Type.Kind() == reflect.Pointer { kind = valType.Elem().Kind() } @@ -115,11 +117,11 @@ func parseSecurityOption(c HTTPClient, option interface{}) *SecurityClient { optionStructType := reflect.TypeOf(option) optionValType := reflect.ValueOf(option) - if optionStructType.Kind() == reflect.Ptr { - if optionValType.IsNil() { - return nil - } + if isNil(optionStructType, optionValType) { + return nil + } + if optionStructType.Kind() == reflect.Ptr { optionStructType = optionStructType.Elem() optionValType = optionValType.Elem() } @@ -143,11 +145,11 @@ func parseSecurityScheme(client *SecurityClient, schemeTag *securityTag, scheme schemeType := reflect.TypeOf(scheme) schemeVal := reflect.ValueOf(scheme) - if schemeType.Kind() == reflect.Ptr { - if schemeVal.IsNil() { - return - } + if isNil(schemeType, schemeVal) { + return + } + if schemeType.Kind() == reflect.Ptr { schemeType = schemeType.Elem() schemeVal = schemeVal.Elem() } @@ -162,11 +164,11 @@ func parseSecurityScheme(client *SecurityClient, schemeTag *securityTag, scheme fieldType := schemeType.Field(i) valType := schemeVal.Field(i) - if fieldType.Type.Kind() == reflect.Ptr { - if valType.IsNil() { - continue - } + if isNil(fieldType.Type, valType) { + continue + } + if fieldType.Type.Kind() == reflect.Ptr { valType = valType.Elem() } @@ -202,7 +204,7 @@ func parseSecuritySchemeValue(client *SecurityClient, schemeTag *securityTag, se case "http": switch schemeTag.SubType { case "bearer": - client.headers[secTag.Name] = valToString(val) + client.headers[secTag.Name] = prefixBearer(valToString(val)) default: panic("not supported") } @@ -211,6 +213,14 @@ func parseSecuritySchemeValue(client *SecurityClient, schemeTag *securityTag, se } } +func prefixBearer(authHeaderValue string) string { + if strings.HasPrefix(strings.ToLower(authHeaderValue), "bearer ") { + return authHeaderValue + } + + return fmt.Sprintf("Bearer %s", authHeaderValue) +} + func parseBasicAuthScheme(client *SecurityClient, scheme interface{}) { schemeStructType := reflect.TypeOf(scheme) schemeValType := reflect.ValueOf(scheme) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index b5b93d5..f630a32 100755 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,13 +1,17 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + package utils import ( - "encoding/json" "fmt" "io" + "math/big" "reflect" "regexp" "strings" "time" + + "github.com/ericlagergren/decimal" ) const ( @@ -27,12 +31,12 @@ var ( } ) -func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}) error { +func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}, tag string) error { data, err := io.ReadAll(body) if err != nil { return fmt.Errorf("error reading response body: %w", err) } - if err := json.Unmarshal(data, &out); err != nil { + if err := UnmarshalJSON(data, out, reflect.StructTag(tag), true, false); err != nil { return fmt.Errorf("error unmarshalling json response body: %w", err) } @@ -40,6 +44,10 @@ func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}) error { } func ReplaceParameters(stringWithParams string, params map[string]string) string { + if len(params) == 0 { + return stringWithParams + } + return paramRegex.ReplaceAllStringFunc(stringWithParams, func(match string) string { match = match[1 : len(match)-1] return params[match] @@ -88,6 +96,9 @@ func parseStructTag(tagKey string, field reflect.StructField) map[string]string func parseParamTag(tagKey string, field reflect.StructField, defaultStyle string, defaultExplode bool) *paramTag { // example `{tagKey}:"style=simple,explode=false,name=apiID"` values := parseStructTag(tagKey, field) + if values == nil { + return nil + } tag := ¶mTag{ Style: defaultStyle, @@ -115,6 +126,10 @@ func valToString(val interface{}) string { switch v := val.(type) { case time.Time: return v.Format(time.RFC3339Nano) + case big.Int: + return v.String() + case decimal.Big: + return v.String() default: return fmt.Sprintf("%v", v) } @@ -138,3 +153,11 @@ func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, p return valType } + +func isNil(typ reflect.Type, val reflect.Value) bool { + if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { + return val.IsNil() + } + + return false +} diff --git a/scopes.go b/scopes.go index c5f65c9..729419a 100755 --- a/scopes.go +++ b/scopes.go @@ -1,47 +1,48 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// scopes - Everything related to Scopes type scopes struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newScopes(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *scopes { +func newScopes(sdkConfig sdkConfiguration) *scopes { return &scopes{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // AddTransientScope - Add a transient scope to a scope // Add a transient scope to a scope func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTransientScopeRequest) (*operations.AddTransientScopeResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}/transient/{transientScopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}/transient/{transientScopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -50,7 +51,13 @@ func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTr if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -68,11 +75,11 @@ func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTr // CreateScope - Create scope // Create scope -func (s *scopes) CreateScope(ctx context.Context, request shared.CreateScopeRequest) (*operations.CreateScopeResponse, error) { - baseURL := s.serverURL +func (s *scopes) CreateScope(ctx context.Context, request *shared.CreateScopeRequest) (*operations.CreateScopeResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/scopes" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -81,10 +88,12 @@ func (s *scopes) CreateScope(ctx context.Context, request shared.CreateScopeRequ if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -93,7 +102,13 @@ func (s *scopes) CreateScope(ctx context.Context, request shared.CreateScopeRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -106,12 +121,14 @@ func (s *scopes) CreateScope(ctx context.Context, request shared.CreateScopeRequ case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateScopeResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateScopeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateScopeResponse = out + res.CreateScopeResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -121,15 +138,20 @@ func (s *scopes) CreateScope(ctx context.Context, request shared.CreateScopeRequ // DeleteScope - Delete scope // Delete scope func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScopeRequest) (*operations.DeleteScopeResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -138,7 +160,13 @@ func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScope if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -157,15 +185,20 @@ func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScope // DeleteTransientScope - Delete a transient scope from a scope // Delete a transient scope from a scope func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.DeleteTransientScopeRequest) (*operations.DeleteTransientScopeResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}/transient/{transientScopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}/transient/{transientScopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -174,7 +207,13 @@ func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.De if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -193,15 +232,17 @@ func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.De // ListScopes - List scopes // List Scopes func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/scopes" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -210,7 +251,13 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -223,12 +270,14 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListScopesResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListScopesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListScopesResponse = out + res.ListScopesResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -238,15 +287,20 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse // ReadScope - Read scope // Read scope func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequest) (*operations.ReadScopeResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -255,7 +309,13 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -268,12 +328,14 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ReadScopeResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ReadScopeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadScopeResponse = out + res.ReadScopeResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -283,10 +345,13 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ // UpdateScope - Update scope // Update scope func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScopeRequest) (*operations.UpdateScopeResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "UpdateScopeRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "UpdateScopeRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -295,10 +360,12 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -307,7 +374,13 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -320,12 +393,14 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.UpdateScopeResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.UpdateScopeResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.UpdateScopeResponse = out + res.UpdateScopeResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/script.go b/script.go index b306b55..da08ab7 100755 --- a/script.go +++ b/script.go @@ -1,41 +1,42 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// script - Everything related to Script type script struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newScript(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *script { +func newScript(sdkConfig sdkConfiguration) *script { return &script{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // RunScript - Execute a Numscript // This route is deprecated, and has been merged into `POST /{ledger}/transactions`. +// +// Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequest) (*operations.RunScriptResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/script", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/script", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Script", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Script", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -47,6 +48,8 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -54,7 +57,7 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -63,7 +66,13 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -76,12 +85,14 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ScriptResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ScriptResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ScriptResponse = out + res.ScriptResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/search.go b/search.go index 8e26400..2400daf 100755 --- a/search.go +++ b/search.go @@ -1,42 +1,38 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// search - Everything related to Search type search struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newSearch(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *search { +func newSearch(sdkConfig sdkConfiguration) *search { return &search{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } -// Search - Search +// Search // ElasticSearch query engine func (s *search) Search(ctx context.Context, request shared.Query) (*operations.SearchResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/search/" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -48,10 +44,12 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -60,7 +58,13 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -73,12 +77,14 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Response - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.Response + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Response = out + res.Response = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: } diff --git a/server.go b/server.go index ec60839..9d38425 100755 --- a/server.go +++ b/server.go @@ -1,46 +1,44 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// server - Everything related to Server type server struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newServer(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *server { +func newServer(sdkConfig sdkConfiguration) *server { return &server{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // GetInfo - Show server information func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/ledger/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -49,7 +47,13 @@ func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -62,22 +66,26 @@ func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigInfoResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigInfoResponse = out + res.ConfigInfoResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/stats.go b/stats.go index c465df4..451a589 100755 --- a/stats.go +++ b/stats.go @@ -1,46 +1,47 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// stats - Everything related to Stats type stats struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newStats(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *stats { +func newStats(sdkConfig sdkConfiguration) *stats { return &stats{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ReadStats - Get statistics from a ledger // Get statistics from a ledger. (aggregate metrics on accounts and transactions) func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsRequest) (*operations.ReadStatsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/stats", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/stats", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -49,7 +50,13 @@ func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsReque if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -62,22 +69,26 @@ func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsReque case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.StatsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.StatsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.StatsResponse = out + res.StatsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/transactions.go b/transactions.go index f3fefc0..9cbb5d7 100755 --- a/transactions.go +++ b/transactions.go @@ -1,40 +1,39 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" ) +// transactions - Everything related to Transactions type transactions struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newTransactions(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *transactions { +func newTransactions(sdkConfig sdkConfiguration) *transactions { return &transactions{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // CreateTransactions - Create a new batch of transactions to a ledger func (s *transactions) CreateTransactions(ctx context.Context, request operations.CreateTransactionsRequest) (*operations.CreateTransactionsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/batch", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/batch", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Transactions", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Transactions", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -46,10 +45,12 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -58,7 +59,13 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -71,22 +78,26 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransactionsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TransactionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TransactionsResponse = out + res.TransactionsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -95,10 +106,13 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation // AddMetadataOnTransaction - Set the metadata of a transaction by its ID func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request operations.AddMetadataOnTransactionRequest) (*operations.AddMetadataOnTransactionResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}/metadata", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}/metadata", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -107,10 +121,12 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -119,7 +135,13 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -133,12 +155,14 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -147,19 +171,24 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope // CountTransactions - Count the transactions from a ledger func (s *transactions) CountTransactions(ctx context.Context, request operations.CountTransactionsRequest) (*operations.CountTransactionsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "HEAD", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -168,7 +197,13 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -184,12 +219,14 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -198,10 +235,13 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations // CreateTransaction - Create a new transaction to a ledger func (s *transactions) CreateTransaction(ctx context.Context, request operations.CreateTransactionRequest) (*operations.CreateTransactionResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "PostTransaction", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PostTransaction", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -213,6 +253,8 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -220,7 +262,7 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -229,7 +271,13 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -242,22 +290,26 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransactionsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TransactionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TransactionsResponse = out + res.TransactionsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -266,15 +318,20 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations // GetTransaction - Get transaction from a ledger by its ID func (s *transactions) GetTransaction(ctx context.Context, request operations.GetTransactionRequest) (*operations.GetTransactionResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -283,7 +340,13 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -296,22 +359,26 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransactionResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TransactionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TransactionResponse = out + res.TransactionResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -321,19 +388,24 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge // ListTransactions - List transactions from a ledger // List transactions from a ledger, sorted by txid in descending order. func (s *transactions) ListTransactions(ctx context.Context, request operations.ListTransactionsRequest) (*operations.ListTransactionsResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -342,7 +414,13 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -355,22 +433,26 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransactionsCursorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TransactionsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TransactionsCursorResponse = out + res.TransactionsCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -379,15 +461,20 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. // RevertTransaction - Revert a ledger transaction by its ID func (s *transactions) RevertTransaction(ctx context.Context, request operations.RevertTransactionRequest) (*operations.RevertTransactionResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}/revert", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/transactions/{txid}/revert", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "POST", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -396,7 +483,13 @@ func (s *transactions) RevertTransaction(ctx context.Context, request operations if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -409,22 +502,26 @@ func (s *transactions) RevertTransaction(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransactionResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.TransactionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TransactionResponse = out + res.TransactionResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/users.go b/users.go index c3c291b..cde77d6 100755 --- a/users.go +++ b/users.go @@ -1,47 +1,45 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// users - Everything related to Users type users struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newUsers(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *users { +func newUsers(sdkConfig sdkConfiguration) *users { return &users{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ListUsers - List users // List users func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/auth/users" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -50,7 +48,13 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -63,12 +67,14 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListUsersResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListUsersResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListUsersResponse = out + res.ListUsersResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -78,15 +84,20 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e // ReadUser - Read user // Read user func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest) (*operations.ReadUserResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/auth/users/{userId}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/users/{userId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -95,7 +106,13 @@ func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -108,12 +125,14 @@ func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ReadUserResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ReadUserResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ReadUserResponse = out + res.ReadUserResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/wallets.go b/wallets.go index a40ee2e..f7faef7 100755 --- a/wallets.go +++ b/wallets.go @@ -1,41 +1,40 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "io" "net/http" "strings" ) +// wallets - Everything related to Wallets type wallets struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newWallets(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *wallets { +func newWallets(sdkConfig sdkConfiguration) *wallets { return &wallets{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ConfirmHold - Confirm a hold func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHoldRequest) (*operations.ConfirmHoldResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{hold_id}/confirm", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{hold_id}/confirm", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "ConfirmHoldRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ConfirmHoldRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -44,10 +43,12 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -56,7 +57,13 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -70,12 +77,14 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -84,10 +93,13 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol // CreateBalance - Create a balance func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBalanceRequest) (*operations.CreateBalanceResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "CreateBalanceRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "CreateBalanceRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -96,10 +108,12 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -108,7 +122,13 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -121,22 +141,26 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateBalanceResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateBalanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateBalanceResponse = out + res.CreateBalanceResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -144,11 +168,11 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa } // CreateWallet - Create a new wallet -func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletRequest) (*operations.CreateWalletResponse, error) { - baseURL := s.serverURL +func (s *wallets) CreateWallet(ctx context.Context, request *shared.CreateWalletRequest) (*operations.CreateWalletResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/wallets/wallets" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -157,10 +181,12 @@ func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletR if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -169,7 +195,13 @@ func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -182,22 +214,26 @@ func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletR case httpRes.StatusCode == 201: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateWalletResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.CreateWalletResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CreateWalletResponse = out + res.CreateWalletResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -206,10 +242,13 @@ func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletR // CreditWallet - Credit a wallet func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWalletRequest) (*operations.CreditWalletResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/credit", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/credit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "CreditWalletRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "CreditWalletRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -218,10 +257,12 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -230,7 +271,13 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -244,12 +291,14 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -258,10 +307,13 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal // DebitWallet - Debit a wallet func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalletRequest) (*operations.DebitWalletResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/debit", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/debit", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "DebitWalletRequest", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "DebitWalletRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -270,10 +322,12 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -282,7 +336,13 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -295,23 +355,27 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.DebitWalletResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.DebitWalletResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.DebitWalletResponse = out + res.DebitWalletResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 204: default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -320,15 +384,20 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle // GetBalance - Get detailed balance func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceRequest) (*operations.GetBalanceResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances/{balanceName}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances/{balanceName}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -337,7 +406,13 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -350,22 +425,26 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetBalanceResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetBalanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetBalanceResponse = out + res.GetBalanceResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -374,15 +453,20 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR // GetHold - Get a hold func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest) (*operations.GetHoldResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{holdID}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{holdID}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -391,7 +475,13 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -404,22 +494,26 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetHoldResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetHoldResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetHoldResponse = out + res.GetHoldResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -428,19 +522,21 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest // GetHolds - Get all holds for a wallet func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsRequest) (*operations.GetHoldsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/wallets/holds" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -449,7 +545,13 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -462,22 +564,26 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetHoldsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetHoldsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetHoldsResponse = out + res.GetHoldsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -485,19 +591,21 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque } func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTransactionsRequest) (*operations.GetTransactionsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/wallets/transactions" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -506,7 +614,13 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -519,22 +633,26 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetTransactionsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetTransactionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetTransactionsResponse = out + res.GetTransactionsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -543,15 +661,20 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra // GetWallet - Get a wallet func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletRequest) (*operations.GetWalletResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -560,7 +683,13 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -573,23 +702,27 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWalletResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetWalletResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetWalletResponse = out + res.GetWalletResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 404: default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -598,15 +731,20 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq // ListBalances - List balances of a wallet func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalancesRequest) (*operations.ListBalancesResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/balances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -615,7 +753,13 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -628,12 +772,14 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListBalancesResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListBalancesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListBalancesResponse = out + res.ListBalancesResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -642,19 +788,21 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan // ListWallets - List all wallets func (s *wallets) ListWallets(ctx context.Context, request operations.ListWalletsRequest) (*operations.ListWalletsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/wallets/wallets" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -663,7 +811,13 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -676,12 +830,14 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListWalletsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ListWalletsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ListWalletsResponse = out + res.ListWalletsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -690,10 +846,13 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet // UpdateWallet - Update a wallet func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWalletRequest) (*operations.UpdateWalletResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -702,10 +861,12 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -714,7 +875,13 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -728,12 +895,14 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -742,15 +911,20 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal // VoidHold - Cancel a hold func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldRequest) (*operations.VoidHoldResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{hold_id}/void", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/holds/{hold_id}/void", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "POST", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -759,7 +933,13 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -773,12 +953,14 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -787,15 +969,17 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque // WalletsgetServerInfo - Get server info func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.WalletsgetServerInfoResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/wallets/_info" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -804,7 +988,13 @@ func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.Wallets if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -817,22 +1007,26 @@ func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.Wallets case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ServerInfo = out + res.ServerInfo = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WalletsErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WalletsErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WalletsErrorResponse = out + res.WalletsErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } diff --git a/webhooks.go b/webhooks.go index e4a3f4f..1bbb69d 100755 --- a/webhooks.go +++ b/webhooks.go @@ -1,9 +1,13 @@ -package formance +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancegosdk import ( + "bytes" "context" "fmt" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/sdkerrors" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" "io" @@ -11,38 +15,34 @@ import ( "strings" ) +// webhooks - Everything related to Webhooks type webhooks struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newWebhooks(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *webhooks { +func newWebhooks(sdkConfig sdkConfiguration) *webhooks { return &webhooks{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } // ActivateConfig - Activate one config // Activate a webhooks config by ID, to start receiving webhooks to its endpoint. func (s *webhooks) ActivateConfig(ctx context.Context, request operations.ActivateConfigRequest) (*operations.ActivateConfigResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/activate", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/activate", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -51,7 +51,13 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -64,12 +70,14 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigResponse = out + res.ConfigResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 304: } @@ -83,10 +91,13 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa // If not passed or empty, a secret is automatically generated. // The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding) func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.ChangeConfigSecretRequest) (*operations.ChangeConfigSecretResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/secret/change", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/secret/change", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "ConfigChangeSecret", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "ConfigChangeSecret", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -95,10 +106,12 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -107,7 +120,13 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -120,12 +139,14 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigResponse = out + res.ConfigResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -135,15 +156,20 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch // DeactivateConfig - Deactivate one config // Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint. func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.DeactivateConfigRequest) (*operations.DeactivateConfigResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/deactivate", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/deactivate", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -152,7 +178,13 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -165,12 +197,14 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigResponse = out + res.ConfigResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 304: } @@ -181,15 +215,20 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac // DeleteConfig - Delete one config // Delete a webhooks config by ID. func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteConfigRequest) (*operations.DeleteConfigResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -198,7 +237,13 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -217,19 +262,21 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo // GetManyConfigs - Get many configs // Sorted by updated date descending func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetManyConfigsRequest) (*operations.GetManyConfigsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/webhooks/configs" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -238,7 +285,13 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -251,12 +304,14 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigsResponse = out + res.ConfigsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -273,11 +328,21 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan // The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding) // // All eventTypes are converted to lower-case when inserted. -func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) (*operations.InsertConfigResponse, error) { - baseURL := s.serverURL +func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser, opts ...operations.Option) (*operations.InsertConfigResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionAcceptHeaderOverride, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/api/webhooks/configs" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -289,10 +354,17 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "application/json;q=1, text/plain;q=0") + } + + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -301,7 +373,13 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -314,23 +392,22 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.ConfigResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ConfigResponse = out + res.ConfigResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: switch { case utils.MatchContentType(contentType, `text/plain`): - data, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - - out := string(data) + out := string(rawBody) res.InsertConfig400TextPlainString = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -340,15 +417,20 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) // TestConfig - Test one config // Test a config by sending a webhook to its endpoint. func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfigRequest) (*operations.TestConfigResponse, error) { - baseURL := s.serverURL - url := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/test", request, nil) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/webhooks/configs/{id}/test", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } req, err := http.NewRequestWithContext(ctx, "GET", url, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) - client := s.securityClient + client := s.sdkConfiguration.SecurityClient httpRes, err := client.Do(req) if err != nil { @@ -357,7 +439,13 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -370,12 +458,14 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AttemptResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.AttemptResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AttemptResponse = out + res.AttemptResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } From babbfcaa4f15d2f2b04d21f68ebb2a3c71e3cf68 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 29 Sep 2023 00:38:40 +0000 Subject: [PATCH 2/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.91.3 --- README.md | 4 - RELEASES.md | 12 +- accounts.go | 8 +- balances.go | 4 +- clients.go | 18 +-- .../operations/activateconfigresponse.md | 6 +- .../addmetadataontransactionresponse.md | 6 +- .../addmetadatatoaccountresponse.md | 6 +- .../operations/addscopetoclientresponse.md | 10 +- .../operations/addtransientscoperesponse.md | 10 +- .../operations/changeconfigsecretresponse.md | 6 +- docs/models/operations/confirmholdresponse.md | 6 +- .../connectorsstripetransferresponse.md | 6 +- .../operations/countaccountsresponse.md | 6 +- .../operations/counttransactionsresponse.md | 6 +- .../operations/createbalanceresponse.md | 6 +- .../models/operations/createclientresponse.md | 6 +- docs/models/operations/createscoperesponse.md | 6 +- .../models/operations/createsecretresponse.md | 6 +- .../operations/createtransactionresponse.md | 6 +- .../operations/createtransactionsresponse.md | 6 +- .../models/operations/createwalletresponse.md | 6 +- .../operations/createworkflowresponse.md | 6 +- .../models/operations/creditwalletresponse.md | 6 +- .../operations/deactivateconfigresponse.md | 6 +- docs/models/operations/debitwalletresponse.md | 6 +- .../models/operations/deleteclientresponse.md | 10 +- .../models/operations/deleteconfigresponse.md | 10 +- .../deletescopefromclientresponse.md | 10 +- docs/models/operations/deletescoperesponse.md | 10 +- .../models/operations/deletesecretresponse.md | 10 +- .../deletetransientscoperesponse.md | 10 +- docs/models/operations/getaccountresponse.md | 6 +- docs/models/operations/getbalanceresponse.md | 6 +- .../getbalancesaggregatedresponse.md | 6 +- docs/models/operations/getbalancesresponse.md | 6 +- .../operations/getconnectortaskresponse.md | 6 +- docs/models/operations/getflowresponse.md | 6 +- docs/models/operations/getholdresponse.md | 6 +- docs/models/operations/getholdsresponse.md | 6 +- docs/models/operations/getinforesponse.md | 6 +- .../operations/getledgerinforesponse.md | 6 +- .../operations/getmanyconfigsresponse.md | 6 +- docs/models/operations/getmappingresponse.md | 6 +- docs/models/operations/getpaymentresponse.md | 6 +- .../operations/getserverinforesponse.md | 6 +- .../operations/gettransactionresponse.md | 6 +- .../operations/gettransactionsresponse.md | 6 +- docs/models/operations/getwalletresponse.md | 6 +- .../getworkflowoccurrenceresponse.md | 6 +- .../models/operations/insertconfigresponse.md | 6 +- .../operations/installconnectorresponse.md | 10 +- .../models/operations/listaccountsresponse.md | 6 +- .../operations/listallconnectorsresponse.md | 6 +- .../models/operations/listbalancesresponse.md | 6 +- docs/models/operations/listclientsresponse.md | 6 +- .../listconfigsavailableconnectorsresponse.md | 6 +- .../operations/listconnectortasksresponse.md | 6 +- docs/models/operations/listflowsresponse.md | 6 +- docs/models/operations/listlogsresponse.md | 6 +- .../models/operations/listpaymentsresponse.md | 6 +- docs/models/operations/listrunsresponse.md | 6 +- docs/models/operations/listscopesresponse.md | 6 +- .../operations/listtransactionsresponse.md | 6 +- docs/models/operations/listusersresponse.md | 6 +- docs/models/operations/listwalletsresponse.md | 6 +- .../orchestrationgetserverinforesponse.md | 6 +- .../paymentsgetserverinforesponse.md | 6 +- .../paymentslistaccountsresponse.md | 6 +- docs/models/operations/readclientresponse.md | 6 +- .../operations/readconnectorconfigresponse.md | 6 +- docs/models/operations/readscoperesponse.md | 6 +- docs/models/operations/readstatsresponse.md | 6 +- docs/models/operations/readuserresponse.md | 6 +- .../operations/resetconnectorresponse.md | 10 +- .../operations/reverttransactionresponse.md | 6 +- docs/models/operations/runscriptresponse.md | 6 +- docs/models/operations/runworkflowresponse.md | 6 +- .../operations/searchgetserverinforesponse.md | 6 +- docs/models/operations/searchresponse.md | 12 +- docs/models/operations/testconfigresponse.md | 6 +- .../operations/uninstallconnectorresponse.md | 10 +- .../models/operations/updateclientresponse.md | 6 +- .../operations/updatemappingresponse.md | 6 +- docs/models/operations/updatescoperesponse.md | 6 +- .../models/operations/updatewalletresponse.md | 6 +- docs/models/operations/voidholdresponse.md | 6 +- .../walletsgetserverinforesponse.md | 6 +- docs/sdks/accounts/README.md | 7 +- docs/sdks/balances/README.md | 1 + docs/sdks/clients/README.md | 45 +++---- docs/sdks/formance/README.md | 1 + docs/sdks/ledger/README.md | 1 + docs/sdks/logs/README.md | 13 +- docs/sdks/mapping/README.md | 1 + docs/sdks/orchestration/README.md | 15 +-- docs/sdks/payments/README.md | 27 +++-- docs/sdks/scopes/README.md | 23 ++-- docs/sdks/script/README.md | 3 +- docs/sdks/search/README.md | 5 +- docs/sdks/server/README.md | 1 + docs/sdks/stats/README.md | 1 + docs/sdks/transactions/README.md | 31 ++--- docs/sdks/users/README.md | 3 +- docs/sdks/wallets/README.md | 63 +++++----- docs/sdks/webhooks/README.md | 1 + formance.go | 30 +++-- gen.yaml | 10 +- ledger.go | 2 +- logs.go | 2 +- mapping.go | 4 +- orchestration.go | 14 +-- payments.go | 24 ++-- pkg/models/operations/activateconfig.go | 9 +- .../operations/addmetadataontransaction.go | 7 +- pkg/models/operations/addmetadatatoaccount.go | 7 +- pkg/models/operations/addscopetoclient.go | 5 +- pkg/models/operations/addtransientscope.go | 5 +- pkg/models/operations/changeconfigsecret.go | 9 +- pkg/models/operations/confirmhold.go | 5 +- .../operations/connectorsstripetransfer.go | 5 +- pkg/models/operations/countaccounts.go | 7 +- pkg/models/operations/counttransactions.go | 7 +- pkg/models/operations/createbalance.go | 7 +- pkg/models/operations/createclient.go | 7 +- pkg/models/operations/createscope.go | 7 +- pkg/models/operations/createsecret.go | 7 +- pkg/models/operations/createtransaction.go | 7 +- pkg/models/operations/createtransactions.go | 7 +- pkg/models/operations/createwallet.go | 7 +- pkg/models/operations/createworkflow.go | 7 +- pkg/models/operations/creditwallet.go | 5 +- pkg/models/operations/deactivateconfig.go | 9 +- pkg/models/operations/debitwallet.go | 7 +- pkg/models/operations/deleteclient.go | 5 +- pkg/models/operations/deleteconfig.go | 5 +- pkg/models/operations/deletescope.go | 5 +- .../operations/deletescopefromclient.go | 5 +- pkg/models/operations/deletesecret.go | 5 +- pkg/models/operations/deletetransientscope.go | 5 +- pkg/models/operations/getaccount.go | 9 +- pkg/models/operations/getbalance.go | 7 +- pkg/models/operations/getbalances.go | 9 +- .../operations/getbalancesaggregated.go | 9 +- pkg/models/operations/getconnectortask.go | 5 +- pkg/models/operations/getflow.go | 7 +- pkg/models/operations/gethold.go | 7 +- pkg/models/operations/getholds.go | 7 +- pkg/models/operations/getinfo.go | 9 +- pkg/models/operations/getledgerinfo.go | 7 +- pkg/models/operations/getmanyconfigs.go | 9 +- pkg/models/operations/getmapping.go | 7 +- pkg/models/operations/getpayment.go | 7 +- pkg/models/operations/getserverinfo.go | 7 +- pkg/models/operations/gettransaction.go | 7 +- pkg/models/operations/gettransactions.go | 7 +- pkg/models/operations/getwallet.go | 7 +- .../operations/getworkflowoccurrence.go | 7 +- pkg/models/operations/insertconfig.go | 9 +- pkg/models/operations/installconnector.go | 5 +- pkg/models/operations/listaccounts.go | 9 +- pkg/models/operations/listallconnectors.go | 9 +- pkg/models/operations/listbalances.go | 7 +- pkg/models/operations/listclients.go | 7 +- .../listconfigsavailableconnectors.go | 9 +- pkg/models/operations/listconnectortasks.go | 5 +- pkg/models/operations/listflows.go | 7 +- pkg/models/operations/listlogs.go | 7 +- pkg/models/operations/listpayments.go | 7 +- pkg/models/operations/listruns.go | 7 +- pkg/models/operations/listscopes.go | 7 +- pkg/models/operations/listtransactions.go | 7 +- pkg/models/operations/listusers.go | 7 +- pkg/models/operations/listwallets.go | 7 +- .../operations/orchestrationgetserverinfo.go | 7 +- .../operations/paymentsgetserverinfo.go | 7 +- pkg/models/operations/paymentslistaccounts.go | 9 +- pkg/models/operations/readclient.go | 7 +- pkg/models/operations/readconnectorconfig.go | 9 +- pkg/models/operations/readscope.go | 7 +- pkg/models/operations/readstats.go | 7 +- pkg/models/operations/readuser.go | 7 +- pkg/models/operations/resetconnector.go | 5 +- pkg/models/operations/reverttransaction.go | 7 +- pkg/models/operations/runscript.go | 7 +- pkg/models/operations/runworkflow.go | 7 +- pkg/models/operations/search.go | 7 +- pkg/models/operations/searchgetserverinfo.go | 7 +- pkg/models/operations/testconfig.go | 9 +- pkg/models/operations/uninstallconnector.go | 5 +- pkg/models/operations/updateclient.go | 5 +- pkg/models/operations/updatemapping.go | 7 +- pkg/models/operations/updatescope.go | 5 +- pkg/models/operations/updatewallet.go | 5 +- pkg/models/operations/voidhold.go | 5 +- pkg/models/operations/walletsgetserverinfo.go | 7 +- pkg/utils/json.go | 6 + pkg/utils/requestbody.go | 6 +- pkg/utils/security.go | 114 ++++++++++-------- scopes.go | 14 +-- script.go | 2 +- search.go | 2 +- server.go | 2 +- stats.go | 2 +- transactions.go | 14 +-- users.go | 4 +- wallets.go | 30 ++--- webhooks.go | 14 +-- 208 files changed, 1005 insertions(+), 698 deletions(-) diff --git a/README.md b/README.md index ff998dd..937c5d2 100755 --- a/README.md +++ b/README.md @@ -197,8 +197,6 @@ func main() { - - @@ -211,8 +209,6 @@ returned response object will have a `Next` method that can be called to pull do return value of `Next` is `nil`, then there are no more pages to be fetched. Here's an example of one such pagination call: - - diff --git a/RELEASES.md b/RELEASES.md index a4b216d..a29a58d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -120,4 +120,14 @@ Based on: ### Generated - [go v0.4.0] . ### Releases -- [Go v0.4.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.4.0 - . \ No newline at end of file +- [Go v0.4.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.4.0 - . + +## 2023-09-29 00:38:22 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.91.3 (2.139.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.5.0] . +### Releases +- [Go v0.5.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.5.0 - . \ No newline at end of file diff --git a/accounts.go b/accounts.go index 4d99345..3895c23 100755 --- a/accounts.go +++ b/accounts.go @@ -46,7 +46,7 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -106,7 +106,7 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -170,7 +170,7 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -240,7 +240,7 @@ func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAcco return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) diff --git a/balances.go b/balances.go index ea06f4c..a433ade 100755 --- a/balances.go +++ b/balances.go @@ -38,7 +38,7 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -111,7 +111,7 @@ func (s *balances) GetBalancesAggregated(ctx context.Context, request operations return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) diff --git a/clients.go b/clients.go index 7409ed1..4de2df1 100755 --- a/clients.go +++ b/clients.go @@ -39,7 +39,7 @@ func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddSc return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -87,7 +87,7 @@ func (s *clients) CreateClient(ctx context.Context, request *shared.CreateClient return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -151,7 +151,7 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -210,7 +210,7 @@ func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteCli return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -256,7 +256,7 @@ func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -302,7 +302,7 @@ func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSec return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -345,7 +345,7 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -402,7 +402,7 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -464,7 +464,7 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/docs/models/operations/activateconfigresponse.md b/docs/models/operations/activateconfigresponse.md index c8a83cc..36a9052 100755 --- a/docs/models/operations/activateconfigresponse.md +++ b/docs/models/operations/activateconfigresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully activated. | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/addmetadataontransactionresponse.md b/docs/models/operations/addmetadataontransactionresponse.md index dc71aaa..37afeaa 100755 --- a/docs/models/operations/addmetadataontransactionresponse.md +++ b/docs/models/operations/addmetadataontransactionresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/addmetadatatoaccountresponse.md b/docs/models/operations/addmetadatatoaccountresponse.md index e941cce..2a99068 100755 --- a/docs/models/operations/addmetadatatoaccountresponse.md +++ b/docs/models/operations/addmetadatatoaccountresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/addscopetoclientresponse.md b/docs/models/operations/addscopetoclientresponse.md index dbe04b9..192bbc5 100755 --- a/docs/models/operations/addscopetoclientresponse.md +++ b/docs/models/operations/addscopetoclientresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/addtransientscoperesponse.md b/docs/models/operations/addtransientscoperesponse.md index 42c54e2..7ceda34 100755 --- a/docs/models/operations/addtransientscoperesponse.md +++ b/docs/models/operations/addtransientscoperesponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/changeconfigsecretresponse.md b/docs/models/operations/changeconfigsecretresponse.md index 376bfc2..a36d563 100755 --- a/docs/models/operations/changeconfigsecretresponse.md +++ b/docs/models/operations/changeconfigsecretresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Secret successfully changed. | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/confirmholdresponse.md b/docs/models/operations/confirmholdresponse.md index ed82e6c..f005845 100755 --- a/docs/models/operations/confirmholdresponse.md +++ b/docs/models/operations/confirmholdresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/connectorsstripetransferresponse.md b/docs/models/operations/connectorsstripetransferresponse.md index b798d89..eaf1f61 100755 --- a/docs/models/operations/connectorsstripetransferresponse.md +++ b/docs/models/operations/connectorsstripetransferresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `StripeTransferResponse` | [*shared.StripeTransferResponse](../../models/shared/stripetransferresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/countaccountsresponse.md b/docs/models/operations/countaccountsresponse.md index da82460..54f910b 100755 --- a/docs/models/operations/countaccountsresponse.md +++ b/docs/models/operations/countaccountsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `Headers` | map[string][]*string* | :heavy_minus_sign: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/counttransactionsresponse.md b/docs/models/operations/counttransactionsresponse.md index 2b27cf4..12cf513 100755 --- a/docs/models/operations/counttransactionsresponse.md +++ b/docs/models/operations/counttransactionsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `Headers` | map[string][]*string* | :heavy_minus_sign: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createbalanceresponse.md b/docs/models/operations/createbalanceresponse.md index 607c4d3..3288552 100755 --- a/docs/models/operations/createbalanceresponse.md +++ b/docs/models/operations/createbalanceresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateBalanceResponse` | [*shared.CreateBalanceResponse](../../models/shared/createbalanceresponse.md) | :heavy_minus_sign: | Created balance | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createclientresponse.md b/docs/models/operations/createclientresponse.md index 515dbd7..0ae3736 100755 --- a/docs/models/operations/createclientresponse.md +++ b/docs/models/operations/createclientresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateClientResponse` | [*shared.CreateClientResponse](../../models/shared/createclientresponse.md) | :heavy_minus_sign: | Client created | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createscoperesponse.md b/docs/models/operations/createscoperesponse.md index cffa853..11dfd1e 100755 --- a/docs/models/operations/createscoperesponse.md +++ b/docs/models/operations/createscoperesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateScopeResponse` | [*shared.CreateScopeResponse](../../models/shared/createscoperesponse.md) | :heavy_minus_sign: | Created scope | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createsecretresponse.md b/docs/models/operations/createsecretresponse.md index 8c328e8..f2ebbae 100755 --- a/docs/models/operations/createsecretresponse.md +++ b/docs/models/operations/createsecretresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateSecretResponse` | [*shared.CreateSecretResponse](../../models/shared/createsecretresponse.md) | :heavy_minus_sign: | Created secret | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createtransactionresponse.md b/docs/models/operations/createtransactionresponse.md index df69794..ed87667 100755 --- a/docs/models/operations/createtransactionresponse.md +++ b/docs/models/operations/createtransactionresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TransactionsResponse` | [*shared.TransactionsResponse](../../models/shared/transactionsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createtransactionsresponse.md b/docs/models/operations/createtransactionsresponse.md index 1ec2050..ce2d90d 100755 --- a/docs/models/operations/createtransactionsresponse.md +++ b/docs/models/operations/createtransactionsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TransactionsResponse` | [*shared.TransactionsResponse](../../models/shared/transactionsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/createwalletresponse.md b/docs/models/operations/createwalletresponse.md index f64cd87..d0592f1 100755 --- a/docs/models/operations/createwalletresponse.md +++ b/docs/models/operations/createwalletresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateWalletResponse` | [*shared.CreateWalletResponse](../../models/shared/createwalletresponse.md) | :heavy_minus_sign: | Wallet created | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createworkflowresponse.md b/docs/models/operations/createworkflowresponse.md index 93a37ac..1b1d6aa 100755 --- a/docs/models/operations/createworkflowresponse.md +++ b/docs/models/operations/createworkflowresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `CreateWorkflowResponse` | [*shared.CreateWorkflowResponse](../../models/shared/createworkflowresponse.md) | :heavy_minus_sign: | Created workflow | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/creditwalletresponse.md b/docs/models/operations/creditwalletresponse.md index 1b4353b..4f1ec99 100755 --- a/docs/models/operations/creditwalletresponse.md +++ b/docs/models/operations/creditwalletresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deactivateconfigresponse.md b/docs/models/operations/deactivateconfigresponse.md index 2247fb1..15ffb93 100755 --- a/docs/models/operations/deactivateconfigresponse.md +++ b/docs/models/operations/deactivateconfigresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully deactivated. | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/debitwalletresponse.md b/docs/models/operations/debitwalletresponse.md index 740161d..a8b527b 100755 --- a/docs/models/operations/debitwalletresponse.md +++ b/docs/models/operations/debitwalletresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `DebitWalletResponse` | [*shared.DebitWalletResponse](../../models/shared/debitwalletresponse.md) | :heavy_minus_sign: | Wallet successfully debited as a pending hold | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deleteclientresponse.md b/docs/models/operations/deleteclientresponse.md index d0c9a4a..ac17a0a 100755 --- a/docs/models/operations/deleteclientresponse.md +++ b/docs/models/operations/deleteclientresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deleteconfigresponse.md b/docs/models/operations/deleteconfigresponse.md index 38b47c2..306c77b 100755 --- a/docs/models/operations/deleteconfigresponse.md +++ b/docs/models/operations/deleteconfigresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletescopefromclientresponse.md b/docs/models/operations/deletescopefromclientresponse.md index 4bc2627..ea34061 100755 --- a/docs/models/operations/deletescopefromclientresponse.md +++ b/docs/models/operations/deletescopefromclientresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletescoperesponse.md b/docs/models/operations/deletescoperesponse.md index 8ee0c8d..165d20c 100755 --- a/docs/models/operations/deletescoperesponse.md +++ b/docs/models/operations/deletescoperesponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletesecretresponse.md b/docs/models/operations/deletesecretresponse.md index 7c891b7..d59ea6b 100755 --- a/docs/models/operations/deletesecretresponse.md +++ b/docs/models/operations/deletesecretresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletetransientscoperesponse.md b/docs/models/operations/deletetransientscoperesponse.md index 0d712f6..6b09320 100755 --- a/docs/models/operations/deletetransientscoperesponse.md +++ b/docs/models/operations/deletetransientscoperesponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getaccountresponse.md b/docs/models/operations/getaccountresponse.md index b9fc42b..4f69b0e 100755 --- a/docs/models/operations/getaccountresponse.md +++ b/docs/models/operations/getaccountresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `AccountResponse` | [*shared.AccountResponse](../../models/shared/accountresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getbalanceresponse.md b/docs/models/operations/getbalanceresponse.md index ba27236..6bdd936 100755 --- a/docs/models/operations/getbalanceresponse.md +++ b/docs/models/operations/getbalanceresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `GetBalanceResponse` | [*shared.GetBalanceResponse](../../models/shared/getbalanceresponse.md) | :heavy_minus_sign: | Balance summary | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getbalancesaggregatedresponse.md b/docs/models/operations/getbalancesaggregatedresponse.md index 93a83e3..8729b46 100755 --- a/docs/models/operations/getbalancesaggregatedresponse.md +++ b/docs/models/operations/getbalancesaggregatedresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `AggregateBalancesResponse` | [*shared.AggregateBalancesResponse](../../models/shared/aggregatebalancesresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getbalancesresponse.md b/docs/models/operations/getbalancesresponse.md index 68a8997..fcad256 100755 --- a/docs/models/operations/getbalancesresponse.md +++ b/docs/models/operations/getbalancesresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `BalancesCursorResponse` | [*shared.BalancesCursorResponse](../../models/shared/balancescursorresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getconnectortaskresponse.md b/docs/models/operations/getconnectortaskresponse.md index ebdde55..2fe2fb5 100755 --- a/docs/models/operations/getconnectortaskresponse.md +++ b/docs/models/operations/getconnectortaskresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TaskResponse` | [*shared.TaskResponse](../../models/shared/taskresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getflowresponse.md b/docs/models/operations/getflowresponse.md index 65eff7f..5c7bf8c 100755 --- a/docs/models/operations/getflowresponse.md +++ b/docs/models/operations/getflowresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `GetWorkflowResponse` | [*shared.GetWorkflowResponse](../../models/shared/getworkflowresponse.md) | :heavy_minus_sign: | The workflow | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getholdresponse.md b/docs/models/operations/getholdresponse.md index d567c8f..1676405 100755 --- a/docs/models/operations/getholdresponse.md +++ b/docs/models/operations/getholdresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `GetHoldResponse` | [*shared.GetHoldResponse](../../models/shared/getholdresponse.md) | :heavy_minus_sign: | Holds | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getholdsresponse.md b/docs/models/operations/getholdsresponse.md index 2e7516f..eda9419 100755 --- a/docs/models/operations/getholdsresponse.md +++ b/docs/models/operations/getholdsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `GetHoldsResponse` | [*shared.GetHoldsResponse](../../models/shared/getholdsresponse.md) | :heavy_minus_sign: | Holds | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getinforesponse.md b/docs/models/operations/getinforesponse.md index 7a4ab7e..835462c 100755 --- a/docs/models/operations/getinforesponse.md +++ b/docs/models/operations/getinforesponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `ConfigInfoResponse` | [*shared.ConfigInfoResponse](../../models/shared/configinforesponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getledgerinforesponse.md b/docs/models/operations/getledgerinforesponse.md index 08c0420..44227bf 100755 --- a/docs/models/operations/getledgerinforesponse.md +++ b/docs/models/operations/getledgerinforesponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `LedgerInfoResponse` | [*shared.LedgerInfoResponse](../../models/shared/ledgerinforesponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmanyconfigsresponse.md b/docs/models/operations/getmanyconfigsresponse.md index f79eb35..d57c1e8 100755 --- a/docs/models/operations/getmanyconfigsresponse.md +++ b/docs/models/operations/getmanyconfigsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `ConfigsResponse` | [*shared.ConfigsResponse](../../models/shared/configsresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmappingresponse.md b/docs/models/operations/getmappingresponse.md index f07c53b..f2627ff 100755 --- a/docs/models/operations/getmappingresponse.md +++ b/docs/models/operations/getmappingresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `MappingResponse` | [*shared.MappingResponse](../../models/shared/mappingresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getpaymentresponse.md b/docs/models/operations/getpaymentresponse.md index 51bf4f0..f9b6db8 100755 --- a/docs/models/operations/getpaymentresponse.md +++ b/docs/models/operations/getpaymentresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `PaymentResponse` | [*shared.PaymentResponse](../../models/shared/paymentresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getserverinforesponse.md b/docs/models/operations/getserverinforesponse.md index 3ae9a21..172e4c7 100755 --- a/docs/models/operations/getserverinforesponse.md +++ b/docs/models/operations/getserverinforesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/gettransactionresponse.md b/docs/models/operations/gettransactionresponse.md index 2d37f5d..6479ff0 100755 --- a/docs/models/operations/gettransactionresponse.md +++ b/docs/models/operations/gettransactionresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TransactionResponse` | [*shared.TransactionResponse](../../models/shared/transactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/gettransactionsresponse.md b/docs/models/operations/gettransactionsresponse.md index e5c3cc5..c99b5fa 100755 --- a/docs/models/operations/gettransactionsresponse.md +++ b/docs/models/operations/gettransactionsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `GetTransactionsResponse` | [*shared.GetTransactionsResponse](../../models/shared/gettransactionsresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwalletresponse.md b/docs/models/operations/getwalletresponse.md index ec5f290..50cd33d 100755 --- a/docs/models/operations/getwalletresponse.md +++ b/docs/models/operations/getwalletresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `GetWalletResponse` | [*shared.GetWalletResponse](../../models/shared/getwalletresponse.md) | :heavy_minus_sign: | Wallet | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getworkflowoccurrenceresponse.md b/docs/models/operations/getworkflowoccurrenceresponse.md index e50335f..6973e32 100755 --- a/docs/models/operations/getworkflowoccurrenceresponse.md +++ b/docs/models/operations/getworkflowoccurrenceresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `GetWorkflowOccurrenceResponse` | [*shared.GetWorkflowOccurrenceResponse](../../models/shared/getworkflowoccurrenceresponse.md) | :heavy_minus_sign: | The workflow occurrence | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/insertconfigresponse.md b/docs/models/operations/insertconfigresponse.md index 604d79a..48b6313 100755 --- a/docs/models/operations/insertconfigresponse.md +++ b/docs/models/operations/insertconfigresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config created successfully. | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `InsertConfig400TextPlainString` | **string* | :heavy_minus_sign: | Bad Request | \ No newline at end of file diff --git a/docs/models/operations/installconnectorresponse.md b/docs/models/operations/installconnectorresponse.md index 3491b7e..b1318b5 100755 --- a/docs/models/operations/installconnectorresponse.md +++ b/docs/models/operations/installconnectorresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listaccountsresponse.md b/docs/models/operations/listaccountsresponse.md index 52b0206..eb8c921 100755 --- a/docs/models/operations/listaccountsresponse.md +++ b/docs/models/operations/listaccountsresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `AccountsCursorResponse` | [*shared.AccountsCursorResponse](../../models/shared/accountscursorresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listallconnectorsresponse.md b/docs/models/operations/listallconnectorsresponse.md index a8b5497..ec431eb 100755 --- a/docs/models/operations/listallconnectorsresponse.md +++ b/docs/models/operations/listallconnectorsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `ConnectorsResponse` | [*shared.ConnectorsResponse](../../models/shared/connectorsresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listbalancesresponse.md b/docs/models/operations/listbalancesresponse.md index caf8b17..0c803e7 100755 --- a/docs/models/operations/listbalancesresponse.md +++ b/docs/models/operations/listbalancesresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ListBalancesResponse` | [*shared.ListBalancesResponse](../../models/shared/listbalancesresponse.md) | :heavy_minus_sign: | Balances list | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listclientsresponse.md b/docs/models/operations/listclientsresponse.md index e3613a8..4a2207e 100755 --- a/docs/models/operations/listclientsresponse.md +++ b/docs/models/operations/listclientsresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ListClientsResponse` | [*shared.ListClientsResponse](../../models/shared/listclientsresponse.md) | :heavy_minus_sign: | List of clients | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listconfigsavailableconnectorsresponse.md b/docs/models/operations/listconfigsavailableconnectorsresponse.md index f8777dd..267f107 100755 --- a/docs/models/operations/listconfigsavailableconnectorsresponse.md +++ b/docs/models/operations/listconfigsavailableconnectorsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `ConnectorsConfigsResponse` | [*shared.ConnectorsConfigsResponse](../../models/shared/connectorsconfigsresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listconnectortasksresponse.md b/docs/models/operations/listconnectortasksresponse.md index f78eabd..cc9fe0b 100755 --- a/docs/models/operations/listconnectortasksresponse.md +++ b/docs/models/operations/listconnectortasksresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TasksCursor` | [*shared.TasksCursor](../../models/shared/taskscursor.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listflowsresponse.md b/docs/models/operations/listflowsresponse.md index 819a1d7..114b78e 100755 --- a/docs/models/operations/listflowsresponse.md +++ b/docs/models/operations/listflowsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `ListWorkflowsResponse` | [*shared.ListWorkflowsResponse](../../models/shared/listworkflowsresponse.md) | :heavy_minus_sign: | List of workflows | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listlogsresponse.md b/docs/models/operations/listlogsresponse.md index c84d3b9..18518b5 100755 --- a/docs/models/operations/listlogsresponse.md +++ b/docs/models/operations/listlogsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `LogsCursorResponse` | [*shared.LogsCursorResponse](../../models/shared/logscursorresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listpaymentsresponse.md b/docs/models/operations/listpaymentsresponse.md index ba63577..8939fc3 100755 --- a/docs/models/operations/listpaymentsresponse.md +++ b/docs/models/operations/listpaymentsresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `PaymentsCursor` | [*shared.PaymentsCursor](../../models/shared/paymentscursor.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listrunsresponse.md b/docs/models/operations/listrunsresponse.md index d23cd0b..39fe21f 100755 --- a/docs/models/operations/listrunsresponse.md +++ b/docs/models/operations/listrunsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `ListRunsResponse` | [*shared.ListRunsResponse](../../models/shared/listrunsresponse.md) | :heavy_minus_sign: | List of workflow occurrences | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listscopesresponse.md b/docs/models/operations/listscopesresponse.md index ba2b754..de5bdf4 100755 --- a/docs/models/operations/listscopesresponse.md +++ b/docs/models/operations/listscopesresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ListScopesResponse` | [*shared.ListScopesResponse](../../models/shared/listscopesresponse.md) | :heavy_minus_sign: | List of scopes | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsresponse.md b/docs/models/operations/listtransactionsresponse.md index 7e2296d..dbcde85 100755 --- a/docs/models/operations/listtransactionsresponse.md +++ b/docs/models/operations/listtransactionsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TransactionsCursorResponse` | [*shared.TransactionsCursorResponse](../../models/shared/transactionscursorresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/listusersresponse.md b/docs/models/operations/listusersresponse.md index 3923230..601e737 100755 --- a/docs/models/operations/listusersresponse.md +++ b/docs/models/operations/listusersresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ListUsersResponse` | [*shared.ListUsersResponse](../../models/shared/listusersresponse.md) | :heavy_minus_sign: | List of users | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/listwalletsresponse.md b/docs/models/operations/listwalletsresponse.md index 5745d64..5055d31 100755 --- a/docs/models/operations/listwalletsresponse.md +++ b/docs/models/operations/listwalletsresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ListWalletsResponse` | [*shared.ListWalletsResponse](../../models/shared/listwalletsresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/orchestrationgetserverinforesponse.md b/docs/models/operations/orchestrationgetserverinforesponse.md index aac2309..46cb39f 100755 --- a/docs/models/operations/orchestrationgetserverinforesponse.md +++ b/docs/models/operations/orchestrationgetserverinforesponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/paymentsgetserverinforesponse.md b/docs/models/operations/paymentsgetserverinforesponse.md index 53c848c..bad79e1 100755 --- a/docs/models/operations/paymentsgetserverinforesponse.md +++ b/docs/models/operations/paymentsgetserverinforesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/paymentslistaccountsresponse.md b/docs/models/operations/paymentslistaccountsresponse.md index 7718a51..fee21b7 100755 --- a/docs/models/operations/paymentslistaccountsresponse.md +++ b/docs/models/operations/paymentslistaccountsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `AccountsCursor` | [*shared.AccountsCursor](../../models/shared/accountscursor.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/readclientresponse.md b/docs/models/operations/readclientresponse.md index 7bfec31..95da333 100755 --- a/docs/models/operations/readclientresponse.md +++ b/docs/models/operations/readclientresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ReadClientResponse` | [*shared.ReadClientResponse](../../models/shared/readclientresponse.md) | :heavy_minus_sign: | Retrieved client | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/readconnectorconfigresponse.md b/docs/models/operations/readconnectorconfigresponse.md index 84b3742..d2ef298 100755 --- a/docs/models/operations/readconnectorconfigresponse.md +++ b/docs/models/operations/readconnectorconfigresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `ConnectorConfigResponse` | [*shared.ConnectorConfigResponse](../../models/shared/connectorconfigresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/readscoperesponse.md b/docs/models/operations/readscoperesponse.md index d79ba5b..f830df4 100755 --- a/docs/models/operations/readscoperesponse.md +++ b/docs/models/operations/readscoperesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ReadScopeResponse` | [*shared.ReadScopeResponse](../../models/shared/readscoperesponse.md) | :heavy_minus_sign: | Retrieved scope | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/readstatsresponse.md b/docs/models/operations/readstatsresponse.md index 08eed5a..0bec295 100755 --- a/docs/models/operations/readstatsresponse.md +++ b/docs/models/operations/readstatsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `StatsResponse` | [*shared.StatsResponse](../../models/shared/statsresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/readuserresponse.md b/docs/models/operations/readuserresponse.md index f3e6cda..fb2cb57 100755 --- a/docs/models/operations/readuserresponse.md +++ b/docs/models/operations/readuserresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ReadUserResponse` | [*shared.ReadUserResponse](../../models/shared/readuserresponse.md) | :heavy_minus_sign: | Retrieved user | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/resetconnectorresponse.md b/docs/models/operations/resetconnectorresponse.md index 69cc9b1..b7349da 100755 --- a/docs/models/operations/resetconnectorresponse.md +++ b/docs/models/operations/resetconnectorresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/reverttransactionresponse.md b/docs/models/operations/reverttransactionresponse.md index 5264ae3..3bd704d 100755 --- a/docs/models/operations/reverttransactionresponse.md +++ b/docs/models/operations/reverttransactionresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `TransactionResponse` | [*shared.TransactionResponse](../../models/shared/transactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/runscriptresponse.md b/docs/models/operations/runscriptresponse.md index bc67bc2..7215131 100755 --- a/docs/models/operations/runscriptresponse.md +++ b/docs/models/operations/runscriptresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ScriptResponse` | [*shared.ScriptResponse](../../models/shared/scriptresponse.md) | :heavy_minus_sign: | On success, it will return a 200 status code, and the resulting transaction under the `transaction` field.

On failure, it will also return a 200 status code, and the following fields:
- `details`: contains a URL. When there is an error parsing Numscript, the result can be difficult to read—the provided URL will render the error in an easy-to-read format.
- `errorCode` and `error_code` (deprecated): contains the string code of the error
- `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript.
| -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/runworkflowresponse.md b/docs/models/operations/runworkflowresponse.md index 1c03e2f..182fdd9 100755 --- a/docs/models/operations/runworkflowresponse.md +++ b/docs/models/operations/runworkflowresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | | `RunWorkflowResponse` | [*shared.RunWorkflowResponse](../../models/shared/runworkflowresponse.md) | :heavy_minus_sign: | The workflow occurrence | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/searchgetserverinforesponse.md b/docs/models/operations/searchgetserverinforesponse.md index 6ec0874..e728aa7 100755 --- a/docs/models/operations/searchgetserverinforesponse.md +++ b/docs/models/operations/searchgetserverinforesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/searchresponse.md b/docs/models/operations/searchresponse.md index 2dc1c3c..74816dd 100755 --- a/docs/models/operations/searchresponse.md +++ b/docs/models/operations/searchresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `Response` | [*shared.Response](../../models/shared/response.md) | :heavy_minus_sign: | Success | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Response` | [*shared.Response](../../models/shared/response.md) | :heavy_minus_sign: | Success | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/testconfigresponse.md b/docs/models/operations/testconfigresponse.md index 33597e3..09b8403 100755 --- a/docs/models/operations/testconfigresponse.md +++ b/docs/models/operations/testconfigresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `AttemptResponse` | [*shared.AttemptResponse](../../models/shared/attemptresponse.md) | :heavy_minus_sign: | OK | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/uninstallconnectorresponse.md b/docs/models/operations/uninstallconnectorresponse.md index 8dc21d9..cc34c54 100755 --- a/docs/models/operations/uninstallconnectorresponse.md +++ b/docs/models/operations/uninstallconnectorresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/updateclientresponse.md b/docs/models/operations/updateclientresponse.md index 146d731..1b47de5 100755 --- a/docs/models/operations/updateclientresponse.md +++ b/docs/models/operations/updateclientresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `UpdateClientResponse` | [*shared.UpdateClientResponse](../../models/shared/updateclientresponse.md) | :heavy_minus_sign: | Updated client | \ No newline at end of file diff --git a/docs/models/operations/updatemappingresponse.md b/docs/models/operations/updatemappingresponse.md index e2086dd..a0ae95c 100755 --- a/docs/models/operations/updatemappingresponse.md +++ b/docs/models/operations/updatemappingresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | | `MappingResponse` | [*shared.MappingResponse](../../models/shared/mappingresponse.md) | :heavy_minus_sign: | OK | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/updatescoperesponse.md b/docs/models/operations/updatescoperesponse.md index ff2c24b..a980c61 100755 --- a/docs/models/operations/updatescoperesponse.md +++ b/docs/models/operations/updatescoperesponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `UpdateScopeResponse` | [*shared.UpdateScopeResponse](../../models/shared/updatescoperesponse.md) | :heavy_minus_sign: | Updated scope | \ No newline at end of file diff --git a/docs/models/operations/updatewalletresponse.md b/docs/models/operations/updatewalletresponse.md index 45bc94d..2ed290f 100755 --- a/docs/models/operations/updatewalletresponse.md +++ b/docs/models/operations/updatewalletresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/voidholdresponse.md b/docs/models/operations/voidholdresponse.md index 440bbf8..fd3d2c0 100755 --- a/docs/models/operations/voidholdresponse.md +++ b/docs/models/operations/voidholdresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/walletsgetserverinforesponse.md b/docs/models/operations/walletsgetserverinforesponse.md index e32e5be..ae9ca76 100755 --- a/docs/models/operations/walletsgetserverinforesponse.md +++ b/docs/models/operations/walletsgetserverinforesponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `ServerInfo` | [*shared.ServerInfo](../../models/shared/serverinfo.md) | :heavy_minus_sign: | Server information | -| `StatusCode` | *int* | :heavy_check_mark: | N/A | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md index 474a10f..519af7d 100755 --- a/docs/sdks/accounts/README.md +++ b/docs/sdks/accounts/README.md @@ -1,4 +1,5 @@ # Accounts +(*Accounts*) ## Overview @@ -38,7 +39,7 @@ func main() { ctx := context.Background() res, err := s.Accounts.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ RequestBody: map[string]interface{}{ - "corrupti": "provident", + "adipisci": "silver", }, Address: "users:001", Ledger: "ledger001", @@ -205,8 +206,8 @@ func main() { Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Ledger: "ledger001", Metadata: &operations.ListAccountsMetadata{}, - PageSize: formancegosdk.Int64(715190), - PageSizeDeprecated: formancegosdk.Int64(844266), + PageSize: formancegosdk.Int64(875058), + PageSizeDeprecated: formancegosdk.Int64(336035), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), }) if err != nil { diff --git a/docs/sdks/balances/README.md b/docs/sdks/balances/README.md index fea5930..e67e198 100755 --- a/docs/sdks/balances/README.md +++ b/docs/sdks/balances/README.md @@ -1,4 +1,5 @@ # Balances +(*Balances*) ## Overview diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index 953c765..ce13f42 100755 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -1,4 +1,5 @@ # Clients +(*Clients*) ## Overview @@ -42,8 +43,8 @@ func main() { ctx := context.Background() res, err := s.Clients.AddScopeToClient(ctx, operations.AddScopeToClientRequest{ - ClientID: "unde", - ScopeID: "nulla", + ClientID: "East laudantium HTTP", + ScopeID: "boo Senior", }) if err != nil { log.Fatal(err) @@ -93,17 +94,17 @@ func main() { ctx := context.Background() res, err := s.Clients.CreateClient(ctx, shared.CreateClientRequest{ - Description: formancegosdk.String("corrupti"), + Description: formancegosdk.String("Managed optimizing help-desk"), Metadata: map[string]interface{}{ - "illum": "vel", + "vero": "Division", }, - Name: "Doug Hoppe", + Name: "Station East Functionality", PostLogoutRedirectUris: []string{ - "debitis", + "24", }, Public: formancegosdk.Bool(false), RedirectUris: []string{ - "ipsa", + "fuchsia", }, Trusted: formancegosdk.Bool(false), }) @@ -158,11 +159,11 @@ func main() { res, err := s.Clients.CreateSecret(ctx, operations.CreateSecretRequest{ CreateSecretRequest: &shared.CreateSecretRequest{ Metadata: map[string]interface{}{ - "delectus": "tempora", + "aliquid": "Southwest", }, - Name: "Minnie Schiller", + Name: "olive executive Taka", }, - ClientID: "iusto", + ClientID: "South", }) if err != nil { log.Fatal(err) @@ -213,7 +214,7 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteClient(ctx, operations.DeleteClientRequest{ - ClientID: "excepturi", + ClientID: "salmon synergize", }) if err != nil { log.Fatal(err) @@ -264,8 +265,8 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteScopeFromClient(ctx, operations.DeleteScopeFromClientRequest{ - ClientID: "nisi", - ScopeID: "recusandae", + ClientID: "Northeast synergy zowie", + ScopeID: "befriend coherent", }) if err != nil { log.Fatal(err) @@ -316,8 +317,8 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteSecret(ctx, operations.DeleteSecretRequest{ - ClientID: "temporibus", - SecretID: "ab", + ClientID: "ashamed transform past", + SecretID: "Afghani rosemary South", }) if err != nil { log.Fatal(err) @@ -415,7 +416,7 @@ func main() { ctx := context.Background() res, err := s.Clients.ReadClient(ctx, operations.ReadClientRequest{ - ClientID: "quis", + ClientID: "COM Wagon", }) if err != nil { log.Fatal(err) @@ -467,21 +468,21 @@ func main() { ctx := context.Background() res, err := s.Clients.UpdateClient(ctx, operations.UpdateClientRequest{ UpdateClientRequest: &shared.UpdateClientRequest{ - Description: formancegosdk.String("veritatis"), + Description: formancegosdk.String("Secured static model"), Metadata: map[string]interface{}{ - "deserunt": "perferendis", + "temporibus": "Northwest", }, - Name: "Estelle Will", + Name: "BMW XML", PostLogoutRedirectUris: []string{ - "at", + "magenta", }, Public: formancegosdk.Bool(false), RedirectUris: []string{ - "at", + "collaborative", }, Trusted: formancegosdk.Bool(false), }, - ClientID: "maiores", + ClientID: "male gold", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/formance/README.md b/docs/sdks/formance/README.md index 829eae4..2c709e7 100755 --- a/docs/sdks/formance/README.md +++ b/docs/sdks/formance/README.md @@ -1,5 +1,6 @@ # Formance SDK + ## Overview Formance Stack API: Open, modular foundation for unique payments flows diff --git a/docs/sdks/ledger/README.md b/docs/sdks/ledger/README.md index b19381c..7405d72 100755 --- a/docs/sdks/ledger/README.md +++ b/docs/sdks/ledger/README.md @@ -1,4 +1,5 @@ # Ledger +(*Ledger*) ## Overview diff --git a/docs/sdks/logs/README.md b/docs/sdks/logs/README.md index 08f6657..cc530f4 100755 --- a/docs/sdks/logs/README.md +++ b/docs/sdks/logs/README.md @@ -1,4 +1,5 @@ # Logs +(*Logs*) ## Overview @@ -37,14 +38,14 @@ func main() { res, err := s.Logs.ListLogs(ctx, operations.ListLogsRequest{ After: formancegosdk.String("1234"), Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - EndTime: types.MustTimeFromString("2022-03-15T07:22:15.330Z"), - EndTimeDeprecated: types.MustTimeFromString("2021-08-13T16:19:19.906Z"), + EndTime: types.MustTimeFromString("2022-09-04T05:10:40.788Z"), + EndTimeDeprecated: types.MustTimeFromString("2022-12-21T16:19:06.983Z"), Ledger: "ledger001", - PageSize: formancegosdk.Int64(520478), - PageSizeDeprecated: formancegosdk.Int64(780529), + PageSize: formancegosdk.Int64(279551), + PageSizeDeprecated: formancegosdk.Int64(61287), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - StartTime: types.MustTimeFromString("2022-10-06T15:49:54.663Z"), - StartTimeDeprecated: types.MustTimeFromString("2021-09-20T20:35:01.256Z"), + StartTime: types.MustTimeFromString("2021-01-03T01:50:13.003Z"), + StartTimeDeprecated: types.MustTimeFromString("2022-01-22T19:40:11.309Z"), }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/mapping/README.md b/docs/sdks/mapping/README.md index 20c3c40..07e2202 100755 --- a/docs/sdks/mapping/README.md +++ b/docs/sdks/mapping/README.md @@ -1,4 +1,5 @@ # Mapping +(*Mapping*) ## Overview diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md index 8fe0b50..8144f05 100755 --- a/docs/sdks/orchestration/README.md +++ b/docs/sdks/orchestration/README.md @@ -1,4 +1,5 @@ # Orchestration +(*Orchestration*) ## Overview @@ -41,7 +42,7 @@ func main() { res, err := s.Orchestration.CreateWorkflow(ctx, shared.CreateWorkflowRequest{ Stages: []map[string]interface{}{ map[string]interface{}{ - "occaecati": "fugit", + "eveniet": "amidst", }, }, }) @@ -94,7 +95,7 @@ func main() { ctx := context.Background() res, err := s.Orchestration.GetFlow(ctx, operations.GetFlowRequest{ - FlowID: "deleniti", + FlowID: "male extend", }) if err != nil { log.Fatal(err) @@ -145,8 +146,8 @@ func main() { ctx := context.Background() res, err := s.Orchestration.GetWorkflowOccurrence(ctx, operations.GetWorkflowOccurrenceRequest{ - FlowID: "hic", - RunID: "optio", + FlowID: "granular B2B", + RunID: "sticky African Islands", }) if err != nil { log.Fatal(err) @@ -244,7 +245,7 @@ func main() { ctx := context.Background() res, err := s.Orchestration.ListRuns(ctx, operations.ListRunsRequest{ - FlowID: "totam", + FlowID: "Cambridgeshire Southeast", }) if err != nil { log.Fatal(err) @@ -343,9 +344,9 @@ func main() { ctx := context.Background() res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{ RequestBody: map[string]string{ - "beatae": "commodi", + "delectus": "Accountability", }, - FlowID: "molestiae", + FlowID: "newton aggregate Metal", Wait: formancegosdk.Bool(false), }) if err != nil { diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index 81af9d6..c400a7d 100755 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -1,4 +1,5 @@ # Payments +(*Payments*) ## Overview @@ -98,8 +99,8 @@ func main() { ctx := context.Background() res, err := s.Payments.GetConnectorTask(ctx, operations.GetConnectorTaskRequest{ - Connector: shared.ConnectorDummyPay, - TaskID: "qui", + Connector: shared.ConnectorBankingCircle, + TaskID: "Recycled male", }) if err != nil { log.Fatal(err) @@ -150,7 +151,7 @@ func main() { ctx := context.Background() res, err := s.Payments.GetPayment(ctx, operations.GetPaymentRequest{ - PaymentID: "impedit", + PaymentID: "West", }) if err != nil { log.Fatal(err) @@ -202,7 +203,7 @@ func main() { ctx := context.Background() res, err := s.Payments.InstallConnector(ctx, operations.InstallConnectorRequest{ ConnectorConfig: shared.ConnectorConfig{}, - Connector: shared.ConnectorCurrencyCloud, + Connector: shared.ConnectorDummyPay, }) if err != nil { log.Fatal(err) @@ -347,9 +348,9 @@ func main() { ctx := context.Background() res, err := s.Payments.ListConnectorTasks(ctx, operations.ListConnectorTasksRequest{ - Connector: shared.ConnectorWise, + Connector: shared.ConnectorDummyPay, Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(216550), + PageSize: formancegosdk.Int64(501686), }) if err != nil { log.Fatal(err) @@ -401,9 +402,9 @@ func main() { ctx := context.Background() res, err := s.Payments.ListPayments(ctx, operations.ListPaymentsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(568434), + PageSize: formancegosdk.Int64(13778), Sort: []string{ - "aspernatur", + "harness", }, }) if err != nil { @@ -456,9 +457,9 @@ func main() { ctx := context.Background() res, err := s.Payments.PaymentslistAccounts(ctx, operations.PaymentslistAccountsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(18789), + PageSize: formancegosdk.Int64(227071), Sort: []string{ - "ad", + "Virginia", }, }) if err != nil { @@ -510,7 +511,7 @@ func main() { ctx := context.Background() res, err := s.Payments.ReadConnectorConfig(ctx, operations.ReadConnectorConfigRequest{ - Connector: shared.ConnectorModulr, + Connector: shared.ConnectorBankingCircle, }) if err != nil { log.Fatal(err) @@ -563,7 +564,7 @@ func main() { ctx := context.Background() res, err := s.Payments.ResetConnector(ctx, operations.ResetConnectorRequest{ - Connector: shared.ConnectorStripe, + Connector: shared.ConnectorCurrencyCloud, }) if err != nil { log.Fatal(err) @@ -614,7 +615,7 @@ func main() { ctx := context.Background() res, err := s.Payments.UninstallConnector(ctx, operations.UninstallConnectorRequest{ - Connector: shared.ConnectorModulr, + Connector: shared.ConnectorDummyPay, }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/scopes/README.md b/docs/sdks/scopes/README.md index f53f4f1..912e53b 100755 --- a/docs/sdks/scopes/README.md +++ b/docs/sdks/scopes/README.md @@ -1,4 +1,5 @@ # Scopes +(*Scopes*) ## Overview @@ -40,8 +41,8 @@ func main() { ctx := context.Background() res, err := s.Scopes.AddTransientScope(ctx, operations.AddTransientScopeRequest{ - ScopeID: "dolor", - TransientScopeID: "natus", + ScopeID: "executive Soul", + TransientScopeID: "Keyboard neural tan", }) if err != nil { log.Fatal(err) @@ -91,9 +92,9 @@ func main() { ctx := context.Background() res, err := s.Scopes.CreateScope(ctx, shared.CreateScopeRequest{ - Label: "laboriosam", + Label: "neural Sunrise", Metadata: map[string]interface{}{ - "hic": "saepe", + "vero": "deposit", }, }) if err != nil { @@ -145,7 +146,7 @@ func main() { ctx := context.Background() res, err := s.Scopes.DeleteScope(ctx, operations.DeleteScopeRequest{ - ScopeID: "fuga", + ScopeID: "impedit Bronze", }) if err != nil { log.Fatal(err) @@ -196,8 +197,8 @@ func main() { ctx := context.Background() res, err := s.Scopes.DeleteTransientScope(ctx, operations.DeleteTransientScopeRequest{ - ScopeID: "in", - TransientScopeID: "corporis", + ScopeID: "billion Chips", + TransientScopeID: "Account untidy haptic", }) if err != nil { log.Fatal(err) @@ -295,7 +296,7 @@ func main() { ctx := context.Background() res, err := s.Scopes.ReadScope(ctx, operations.ReadScopeRequest{ - ScopeID: "iste", + ScopeID: "Internal Credit Hermaphrodite", }) if err != nil { log.Fatal(err) @@ -347,12 +348,12 @@ func main() { ctx := context.Background() res, err := s.Scopes.UpdateScope(ctx, operations.UpdateScopeRequest{ UpdateScopeRequest: &shared.UpdateScopeRequest{ - Label: "iure", + Label: "East South Luxurious", Metadata: map[string]interface{}{ - "saepe": "quidem", + "temporibus": "meh", }, }, - ScopeID: "architecto", + ScopeID: "handcuff Xenon Timmy", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/script/README.md b/docs/sdks/script/README.md index b25715c..fda879b 100755 --- a/docs/sdks/script/README.md +++ b/docs/sdks/script/README.md @@ -1,4 +1,5 @@ # Script +(*Script*) ## Overview @@ -39,7 +40,7 @@ func main() { res, err := s.Script.RunScript(ctx, operations.RunScriptRequest{ Script: shared.Script{ Metadata: map[string]interface{}{ - "ipsa": "reiciendis", + "eaque": "Borders", }, Plain: "vars { account $user diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 7b00ef6..62e8126 100755 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -1,4 +1,5 @@ # Search +(*Search*) ## Overview @@ -40,10 +41,10 @@ func main() { Ledgers: []string{ "quickstart", }, - PageSize: formancegosdk.Int64(666767), + PageSize: formancegosdk.Int64(307631), Policy: formancegosdk.String("OR"), Sort: formancegosdk.String("txid:asc"), - Target: formancegosdk.String("mollitia"), + Target: formancegosdk.String("Movies"), Terms: []string{ "destination=central_bank1", }, diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 9615c3b..3effdcb 100755 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -1,4 +1,5 @@ # Server +(*Server*) ## Overview diff --git a/docs/sdks/stats/README.md b/docs/sdks/stats/README.md index 9638d58..2656b29 100755 --- a/docs/sdks/stats/README.md +++ b/docs/sdks/stats/README.md @@ -1,4 +1,5 @@ # Stats +(*Stats*) ## Overview diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index e6f36aa..10353c8 100755 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -1,4 +1,5 @@ # Transactions +(*Transactions*) ## Overview @@ -45,7 +46,7 @@ func main() { Transactions: []shared.TransactionData{ shared.TransactionData{ Metadata: map[string]interface{}{ - "laborum": "dolores", + "ipsam": "West", }, Postings: []shared.Posting{ shared.Posting{ @@ -56,7 +57,7 @@ func main() { }, }, Reference: formancegosdk.String("ref:001"), - Timestamp: types.MustTimeFromString("2022-08-23T06:35:12.519Z"), + Timestamp: types.MustTimeFromString("2023-08-23T17:07:25.890Z"), }, }, }, @@ -112,7 +113,7 @@ func main() { ctx := context.Background() res, err := s.Transactions.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ RequestBody: map[string]interface{}{ - "explicabo": "nobis", + "esse": "Fresh", }, Ledger: "ledger001", Txid: 1234, @@ -169,14 +170,14 @@ func main() { res, err := s.Transactions.CountTransactions(ctx, operations.CountTransactionsRequest{ Account: formancegosdk.String("users:001"), Destination: formancegosdk.String("users:001"), - EndTime: types.MustTimeFromString("2022-05-24T03:24:11.703Z"), - EndTimeDeprecated: types.MustTimeFromString("2022-09-04T08:35:09.957Z"), + EndTime: types.MustTimeFromString("2021-07-20T09:59:27.603Z"), + EndTimeDeprecated: types.MustTimeFromString("2023-09-27T00:52:47.091Z"), Ledger: "ledger001", Metadata: &operations.CountTransactionsMetadata{}, Reference: formancegosdk.String("ref:001"), Source: formancegosdk.String("users:001"), - StartTime: types.MustTimeFromString("2022-12-03T22:47:10.600Z"), - StartTimeDeprecated: types.MustTimeFromString("2022-05-14T11:45:33.094Z"), + StartTime: types.MustTimeFromString("2023-01-18T09:32:22.586Z"), + StartTimeDeprecated: types.MustTimeFromString("2021-04-16T00:36:33.819Z"), }) if err != nil { log.Fatal(err) @@ -230,7 +231,7 @@ func main() { res, err := s.Transactions.CreateTransaction(ctx, operations.CreateTransactionRequest{ PostTransaction: shared.PostTransaction{ Metadata: map[string]interface{}{ - "doloribus": "sapiente", + "reiciendis": "Ball", }, Postings: []shared.Posting{ shared.Posting{ @@ -252,7 +253,7 @@ func main() { ", Vars: &shared.PostTransactionScriptVars{}, }, - Timestamp: types.MustTimeFromString("2022-05-07T17:33:24.154Z"), + Timestamp: types.MustTimeFromString("2023-10-22T10:08:19.757Z"), }, Ledger: "ledger001", Preview: formancegosdk.Bool(true), @@ -363,17 +364,17 @@ func main() { After: formancegosdk.String("1234"), Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Destination: formancegosdk.String("users:001"), - EndTime: types.MustTimeFromString("2022-05-14T04:53:02.888Z"), - EndTimeDeprecated: types.MustTimeFromString("2022-01-02T17:10:32.894Z"), + EndTime: types.MustTimeFromString("2022-09-08T16:09:19.098Z"), + EndTimeDeprecated: types.MustTimeFromString("2021-01-02T10:19:36.126Z"), Ledger: "ledger001", Metadata: &operations.ListTransactionsMetadata{}, - PageSize: formancegosdk.Int64(653108), - PageSizeDeprecated: formancegosdk.Int64(581850), + PageSize: formancegosdk.Int64(641200), + PageSizeDeprecated: formancegosdk.Int64(459510), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Reference: formancegosdk.String("ref:001"), Source: formancegosdk.String("users:001"), - StartTime: types.MustTimeFromString("2022-08-02T18:07:51.623Z"), - StartTimeDeprecated: types.MustTimeFromString("2022-07-11T17:38:58.953Z"), + StartTime: types.MustTimeFromString("2021-03-19T18:05:01.432Z"), + StartTimeDeprecated: types.MustTimeFromString("2022-09-12T07:36:38.262Z"), }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 9ea2858..ae90300 100755 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -1,4 +1,5 @@ # Users +(*Users*) ## Overview @@ -82,7 +83,7 @@ func main() { ctx := context.Background() res, err := s.Users.ReadUser(ctx, operations.ReadUserRequest{ - UserID: "velit", + UserID: "Goodwin Folding always", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/wallets/README.md b/docs/sdks/wallets/README.md index f4b998d..908be75 100755 --- a/docs/sdks/wallets/README.md +++ b/docs/sdks/wallets/README.md @@ -1,4 +1,5 @@ # Wallets +(*Wallets*) ## Overview @@ -52,7 +53,7 @@ func main() { Amount: formancegosdk.Int64(100), Final: formancegosdk.Bool(true), }, - HoldID: "error", + HoldID: "Missouri holistic", }) if err != nil { log.Fatal(err) @@ -104,9 +105,9 @@ func main() { ctx := context.Background() res, err := s.Wallets.CreateBalance(ctx, operations.CreateBalanceRequest{ CreateBalanceRequest: &shared.CreateBalanceRequest{ - Name: "Beatrice Brown", + Name: "Cab Lawrence female", }, - ID: "52c3f5ad-019d-4a1f-be78-f097b0074f15", + ID: "", }) if err != nil { log.Fatal(err) @@ -157,9 +158,9 @@ func main() { ctx := context.Background() res, err := s.Wallets.CreateWallet(ctx, shared.CreateWalletRequest{ Metadata: map[string]interface{}{ - "dolore": "iusto", + "deleniti": "Hybrid", }, - Name: "Maryann Hamill", + Name: "fleck unto Calcium", }) if err != nil { log.Fatal(err) @@ -212,19 +213,19 @@ func main() { res, err := s.Wallets.CreditWallet(ctx, operations.CreditWalletRequest{ CreditWalletRequest: &shared.CreditWalletRequest{ Amount: shared.Monetary{ - Amount: 918236, - Asset: "quae", + Amount: 201874, + Asset: "second", }, - Balance: formancegosdk.String("ipsum"), + Balance: formancegosdk.String("Bike"), Metadata: map[string]interface{}{ - "quidem": "molestias", + "quidem": "Clifton", }, - Reference: formancegosdk.String("excepturi"), + Reference: formancegosdk.String("purple Shoreline keenly"), Sources: []shared.Subject{ shared.Subject{}, }, }, - ID: "d488e1e9-1e45-40ad-aabd-44269802d502", + ID: "", }) if err != nil { log.Fatal(err) @@ -277,20 +278,20 @@ func main() { res, err := s.Wallets.DebitWallet(ctx, operations.DebitWalletRequest{ DebitWalletRequest: &shared.DebitWalletRequest{ Amount: shared.Monetary{ - Amount: 677817, - Asset: "excepturi", + Amount: 245256, + Asset: "azure", }, Balances: []string{ - "tempora", + "Tasty", }, - Description: formancegosdk.String("facilis"), + Description: formancegosdk.String("Total 6th generation conglomeration"), Destination: &shared.Subject{}, Metadata: map[string]interface{}{ - "tempore": "labore", + "non": "Bedfordshire", }, Pending: formancegosdk.Bool(false), }, - ID: "f63c969e-9a3e-4fa7-bdfb-14cd66ae395e", + ID: "", }) if err != nil { log.Fatal(err) @@ -341,8 +342,8 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetBalance(ctx, operations.GetBalanceRequest{ - BalanceName: "delectus", - ID: "b9ba88f3-a669-4970-b4ba-4469b6e21419", + BalanceName: "Kids Franc hmph", + ID: "", }) if err != nil { log.Fatal(err) @@ -393,7 +394,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetHold(ctx, operations.GetHoldRequest{ - HoldID: "ullam", + HoldID: "taper", }) if err != nil { log.Fatal(err) @@ -446,8 +447,8 @@ func main() { res, err := s.Wallets.GetHolds(ctx, operations.GetHoldsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Metadata: &operations.GetHoldsMetadata{}, - PageSize: formancegosdk.Int64(590873), - WalletID: formancegosdk.String("quos"), + PageSize: formancegosdk.Int64(692494), + WalletID: formancegosdk.String("Folding"), }) if err != nil { log.Fatal(err) @@ -497,8 +498,8 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetTransactions(ctx, operations.GetTransactionsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(574325), - WalletID: formancegosdk.String("accusantium"), + PageSize: formancegosdk.Int64(680555), + WalletID: formancegosdk.String("Account"), }) if err != nil { log.Fatal(err) @@ -549,7 +550,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetWallet(ctx, operations.GetWalletRequest{ - ID: "afa563e2-516f-4e4c-8b71-1e5b7fd2ed02", + ID: "", }) if err != nil { log.Fatal(err) @@ -600,7 +601,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.ListBalances(ctx, operations.ListBalancesRequest{ - ID: "8921cddc-6926-401f-b576-b0d5f0d30c5f", + ID: "", }) if err != nil { log.Fatal(err) @@ -653,8 +654,8 @@ func main() { res, err := s.Wallets.ListWallets(ctx, operations.ListWalletsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Metadata: &operations.ListWalletsMetadata{}, - Name: formancegosdk.String("Robin D'Amore"), - PageSize: formancegosdk.Int64(489549), + Name: formancegosdk.String("green Mobility"), + PageSize: formancegosdk.Int64(938918), }) if err != nil { log.Fatal(err) @@ -707,10 +708,10 @@ func main() { res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ RequestBody: &operations.UpdateWalletRequestBody{ Metadata: map[string]interface{}{ - "eaque": "quis", + "quas": "Books", }, }, - ID: "3202c73d-5fe9-4b90-8289-09b3fe49a8d9", + ID: "", }) if err != nil { log.Fatal(err) @@ -761,7 +762,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.VoidHold(ctx, operations.VoidHoldRequest{ - HoldID: "nobis", + HoldID: "redundant yesterday Hat", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 4f00fc2..6723782 100755 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -1,4 +1,5 @@ # Webhooks +(*Webhooks*) ## Overview diff --git a/formance.go b/formance.go index d7382bc..82f12f5 100755 --- a/formance.go +++ b/formance.go @@ -50,7 +50,7 @@ func Float64(f float64) *float64 { return &f } type sdkConfiguration struct { DefaultClient HTTPClient SecurityClient HTTPClient - Security *shared.Security + Security func(context.Context) (interface{}, error) ServerURL string ServerIndex int ServerDefaults []map[string]string @@ -58,6 +58,7 @@ type sdkConfiguration struct { OpenAPIDocVersion string SDKVersion string GenVersion string + UserAgent string RetryConfig *utils.RetryConfig } @@ -170,11 +171,25 @@ func WithClient(client HTTPClient) SDKOption { sdk.sdkConfiguration.DefaultClient = client } } +func withSecurity(security interface{}) func(context.Context) (interface{}, error) { + return func(context.Context) (interface{}, error) { + return &security, nil + } +} // WithSecurity configures the SDK to use the provided security details func WithSecurity(security shared.Security) SDKOption { return func(sdk *Formance) { - sdk.sdkConfiguration.Security = &security + sdk.sdkConfiguration.Security = withSecurity(security) + } +} + +// WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication +func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption { + return func(sdk *Formance) { + sdk.sdkConfiguration.Security = func(ctx context.Context) (interface{}, error) { + return security(ctx) + } } } @@ -190,8 +205,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.4.0", - GenVersion: "2.125.1", + SDKVersion: "0.5.0", + GenVersion: "2.139.1", + UserAgent: "speakeasy-sdk/go 0.5.0 2.139.1 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { @@ -263,7 +279,7 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -317,7 +333,7 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -371,7 +387,7 @@ func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.Searchg return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/gen.yaml b/gen.yaml index 94bf870..726e77f 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.89.0 - generationVersion: 2.125.1 + speakeasyVersion: 1.91.3 + generationVersion: 2.139.1 generation: sdkClassName: formance sdkFlattening: true @@ -12,13 +12,13 @@ generation: features: go: constsAndDefaults: 0.1.0 - core: 2.88.4 + core: 2.90.0 deprecations: 2.81.1 - globalSecurity: 2.81.1 + globalSecurity: 2.82.0 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 unions: 2.83.0 go: - version: 0.4.0 + version: 0.5.0 maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk diff --git a/ledger.go b/ledger.go index 29d5c44..de1108a 100755 --- a/ledger.go +++ b/ledger.go @@ -38,7 +38,7 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/logs.go b/logs.go index abd07bb..823bf3c 100755 --- a/logs.go +++ b/logs.go @@ -39,7 +39,7 @@ func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) diff --git a/mapping.go b/mapping.go index 7708576..884dfdd 100755 --- a/mapping.go +++ b/mapping.go @@ -38,7 +38,7 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -115,7 +115,7 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/orchestration.go b/orchestration.go index 25ed5aa..fade469 100755 --- a/orchestration.go +++ b/orchestration.go @@ -42,7 +42,7 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request *shared.Crea return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -114,7 +114,7 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -184,7 +184,7 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -251,7 +251,7 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -321,7 +321,7 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -387,7 +387,7 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -462,7 +462,7 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/payments.go b/payments.go index 8585c94..c1eb982 100755 --- a/payments.go +++ b/payments.go @@ -45,7 +45,7 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -105,7 +105,7 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -162,7 +162,7 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -228,7 +228,7 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -274,7 +274,7 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -329,7 +329,7 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -387,7 +387,7 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -445,7 +445,7 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -503,7 +503,7 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -565,7 +565,7 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -624,7 +624,7 @@ func (s *payments) ResetConnector(ctx context.Context, request operations.ResetC return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -671,7 +671,7 @@ func (s *payments) UninstallConnector(ctx context.Context, request operations.Un return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/pkg/models/operations/activateconfig.go b/pkg/models/operations/activateconfig.go index 8f37a57..e0adb58 100755 --- a/pkg/models/operations/activateconfig.go +++ b/pkg/models/operations/activateconfig.go @@ -22,9 +22,12 @@ func (o *ActivateConfigRequest) GetID() string { type ActivateConfigResponse struct { // Config successfully activated. ConfigResponse *shared.ConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ActivateConfigResponse) GetConfigResponse() *shared.ConfigResponse { diff --git a/pkg/models/operations/addmetadataontransaction.go b/pkg/models/operations/addmetadataontransaction.go index ea65db6..a0cf6be 100755 --- a/pkg/models/operations/addmetadataontransaction.go +++ b/pkg/models/operations/addmetadataontransaction.go @@ -38,11 +38,14 @@ func (o *AddMetadataOnTransactionRequest) GetTxid() int64 { } type AddMetadataOnTransactionResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *AddMetadataOnTransactionResponse) GetContentType() string { diff --git a/pkg/models/operations/addmetadatatoaccount.go b/pkg/models/operations/addmetadatatoaccount.go index 007bc53..865b5bb 100755 --- a/pkg/models/operations/addmetadatatoaccount.go +++ b/pkg/models/operations/addmetadatatoaccount.go @@ -42,11 +42,14 @@ func (o *AddMetadataToAccountRequest) GetLedger() string { } type AddMetadataToAccountResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *AddMetadataToAccountResponse) GetContentType() string { diff --git a/pkg/models/operations/addscopetoclient.go b/pkg/models/operations/addscopetoclient.go index e5e88ed..d706ed6 100755 --- a/pkg/models/operations/addscopetoclient.go +++ b/pkg/models/operations/addscopetoclient.go @@ -28,8 +28,11 @@ func (o *AddScopeToClientRequest) GetScopeID() string { } type AddScopeToClientResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/addtransientscope.go b/pkg/models/operations/addtransientscope.go index 4763a8b..131a477 100755 --- a/pkg/models/operations/addtransientscope.go +++ b/pkg/models/operations/addtransientscope.go @@ -28,8 +28,11 @@ func (o *AddTransientScopeRequest) GetTransientScopeID() string { } type AddTransientScopeResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/changeconfigsecret.go b/pkg/models/operations/changeconfigsecret.go index f883374..5f4203b 100755 --- a/pkg/models/operations/changeconfigsecret.go +++ b/pkg/models/operations/changeconfigsecret.go @@ -30,9 +30,12 @@ func (o *ChangeConfigSecretRequest) GetID() string { type ChangeConfigSecretResponse struct { // Secret successfully changed. ConfigResponse *shared.ConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ChangeConfigSecretResponse) GetConfigResponse() *shared.ConfigResponse { diff --git a/pkg/models/operations/confirmhold.go b/pkg/models/operations/confirmhold.go index 1033616..f9757b5 100755 --- a/pkg/models/operations/confirmhold.go +++ b/pkg/models/operations/confirmhold.go @@ -27,8 +27,11 @@ func (o *ConfirmHoldRequest) GetHoldID() string { } type ConfirmHoldResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse diff --git a/pkg/models/operations/connectorsstripetransfer.go b/pkg/models/operations/connectorsstripetransfer.go index 01bff42..0eeeb8f 100755 --- a/pkg/models/operations/connectorsstripetransfer.go +++ b/pkg/models/operations/connectorsstripetransfer.go @@ -8,8 +8,11 @@ import ( ) type ConnectorsStripeTransferResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // OK StripeTransferResponse *shared.StripeTransferResponse diff --git a/pkg/models/operations/countaccounts.go b/pkg/models/operations/countaccounts.go index b94a75d..80a97a4 100755 --- a/pkg/models/operations/countaccounts.go +++ b/pkg/models/operations/countaccounts.go @@ -42,12 +42,15 @@ func (o *CountAccountsRequest) GetMetadata() *CountAccountsMetadata { } type CountAccountsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse Headers map[string][]string - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *CountAccountsResponse) GetContentType() string { diff --git a/pkg/models/operations/counttransactions.go b/pkg/models/operations/counttransactions.go index bc95ab8..edf879c 100755 --- a/pkg/models/operations/counttransactions.go +++ b/pkg/models/operations/counttransactions.go @@ -132,12 +132,15 @@ func (o *CountTransactionsRequest) GetStartTimeDeprecated() *time.Time { } type CountTransactionsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse Headers map[string][]string - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *CountTransactionsResponse) GetContentType() string { diff --git a/pkg/models/operations/createbalance.go b/pkg/models/operations/createbalance.go index 6fd457c..42b6dc2 100755 --- a/pkg/models/operations/createbalance.go +++ b/pkg/models/operations/createbalance.go @@ -27,11 +27,14 @@ func (o *CreateBalanceRequest) GetID() string { } type CreateBalanceResponse struct { + // HTTP response content type for this operation ContentType string // Created balance CreateBalanceResponse *shared.CreateBalanceResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/createclient.go b/pkg/models/operations/createclient.go index 1589e04..5208f85 100755 --- a/pkg/models/operations/createclient.go +++ b/pkg/models/operations/createclient.go @@ -8,11 +8,14 @@ import ( ) type CreateClientResponse struct { + // HTTP response content type for this operation ContentType string // Client created CreateClientResponse *shared.CreateClientResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *CreateClientResponse) GetContentType() string { diff --git a/pkg/models/operations/createscope.go b/pkg/models/operations/createscope.go index f0dadcc..153bbd2 100755 --- a/pkg/models/operations/createscope.go +++ b/pkg/models/operations/createscope.go @@ -8,11 +8,14 @@ import ( ) type CreateScopeResponse struct { + // HTTP response content type for this operation ContentType string // Created scope CreateScopeResponse *shared.CreateScopeResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *CreateScopeResponse) GetContentType() string { diff --git a/pkg/models/operations/createsecret.go b/pkg/models/operations/createsecret.go index faa671d..4c05c21 100755 --- a/pkg/models/operations/createsecret.go +++ b/pkg/models/operations/createsecret.go @@ -28,11 +28,14 @@ func (o *CreateSecretRequest) GetClientID() string { } type CreateSecretResponse struct { + // HTTP response content type for this operation ContentType string // Created secret CreateSecretResponse *shared.CreateSecretResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *CreateSecretResponse) GetContentType() string { diff --git a/pkg/models/operations/createtransaction.go b/pkg/models/operations/createtransaction.go index f8a1e49..6df6e78 100755 --- a/pkg/models/operations/createtransaction.go +++ b/pkg/models/operations/createtransaction.go @@ -41,11 +41,14 @@ func (o *CreateTransactionRequest) GetPreview() *bool { } type CreateTransactionResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // OK TransactionsResponse *shared.TransactionsResponse } diff --git a/pkg/models/operations/createtransactions.go b/pkg/models/operations/createtransactions.go index dba2303..109c02c 100755 --- a/pkg/models/operations/createtransactions.go +++ b/pkg/models/operations/createtransactions.go @@ -28,11 +28,14 @@ func (o *CreateTransactionsRequest) GetLedger() string { } type CreateTransactionsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // OK TransactionsResponse *shared.TransactionsResponse } diff --git a/pkg/models/operations/createwallet.go b/pkg/models/operations/createwallet.go index eeca23e..b01bd88 100755 --- a/pkg/models/operations/createwallet.go +++ b/pkg/models/operations/createwallet.go @@ -8,11 +8,14 @@ import ( ) type CreateWalletResponse struct { + // HTTP response content type for this operation ContentType string // Wallet created CreateWalletResponse *shared.CreateWalletResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/createworkflow.go b/pkg/models/operations/createworkflow.go index a359139..a5495ed 100755 --- a/pkg/models/operations/createworkflow.go +++ b/pkg/models/operations/createworkflow.go @@ -8,12 +8,15 @@ import ( ) type CreateWorkflowResponse struct { + // HTTP response content type for this operation ContentType string // Created workflow CreateWorkflowResponse *shared.CreateWorkflowResponse // General error - Error *shared.Error - StatusCode int + Error *shared.Error + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/creditwallet.go b/pkg/models/operations/creditwallet.go index af37c7e..791d0a7 100755 --- a/pkg/models/operations/creditwallet.go +++ b/pkg/models/operations/creditwallet.go @@ -27,8 +27,11 @@ func (o *CreditWalletRequest) GetID() string { } type CreditWalletResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse diff --git a/pkg/models/operations/deactivateconfig.go b/pkg/models/operations/deactivateconfig.go index 0c944c9..b3b1ee1 100755 --- a/pkg/models/operations/deactivateconfig.go +++ b/pkg/models/operations/deactivateconfig.go @@ -22,9 +22,12 @@ func (o *DeactivateConfigRequest) GetID() string { type DeactivateConfigResponse struct { // Config successfully deactivated. ConfigResponse *shared.ConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *DeactivateConfigResponse) GetConfigResponse() *shared.ConfigResponse { diff --git a/pkg/models/operations/debitwallet.go b/pkg/models/operations/debitwallet.go index 15588c2..0b8ae2c 100755 --- a/pkg/models/operations/debitwallet.go +++ b/pkg/models/operations/debitwallet.go @@ -27,11 +27,14 @@ func (o *DebitWalletRequest) GetID() string { } type DebitWalletResponse struct { + // HTTP response content type for this operation ContentType string // Wallet successfully debited as a pending hold DebitWalletResponse *shared.DebitWalletResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/deleteclient.go b/pkg/models/operations/deleteclient.go index f5855a9..116c645 100755 --- a/pkg/models/operations/deleteclient.go +++ b/pkg/models/operations/deleteclient.go @@ -19,8 +19,11 @@ func (o *DeleteClientRequest) GetClientID() string { } type DeleteClientResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/deleteconfig.go b/pkg/models/operations/deleteconfig.go index 57abca9..68737d9 100755 --- a/pkg/models/operations/deleteconfig.go +++ b/pkg/models/operations/deleteconfig.go @@ -19,8 +19,11 @@ func (o *DeleteConfigRequest) GetID() string { } type DeleteConfigResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/deletescope.go b/pkg/models/operations/deletescope.go index 8c92051..46802a5 100755 --- a/pkg/models/operations/deletescope.go +++ b/pkg/models/operations/deletescope.go @@ -19,8 +19,11 @@ func (o *DeleteScopeRequest) GetScopeID() string { } type DeleteScopeResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/deletescopefromclient.go b/pkg/models/operations/deletescopefromclient.go index dbabd97..48c845f 100755 --- a/pkg/models/operations/deletescopefromclient.go +++ b/pkg/models/operations/deletescopefromclient.go @@ -28,8 +28,11 @@ func (o *DeleteScopeFromClientRequest) GetScopeID() string { } type DeleteScopeFromClientResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/deletesecret.go b/pkg/models/operations/deletesecret.go index 7bc6d6c..1e0e1e4 100755 --- a/pkg/models/operations/deletesecret.go +++ b/pkg/models/operations/deletesecret.go @@ -28,8 +28,11 @@ func (o *DeleteSecretRequest) GetSecretID() string { } type DeleteSecretResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/deletetransientscope.go b/pkg/models/operations/deletetransientscope.go index 3443d01..4a163af 100755 --- a/pkg/models/operations/deletetransientscope.go +++ b/pkg/models/operations/deletetransientscope.go @@ -28,8 +28,11 @@ func (o *DeleteTransientScopeRequest) GetTransientScopeID() string { } type DeleteTransientScopeResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/getaccount.go b/pkg/models/operations/getaccount.go index 0b4a366..5a234fc 100755 --- a/pkg/models/operations/getaccount.go +++ b/pkg/models/operations/getaccount.go @@ -35,11 +35,14 @@ func (o *GetAccountRequest) GetLedger() string { type GetAccountResponse struct { // OK AccountResponse *shared.AccountResponse - ContentType string + // HTTP response content type for this operation + ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetAccountResponse) GetAccountResponse() *shared.AccountResponse { diff --git a/pkg/models/operations/getbalance.go b/pkg/models/operations/getbalance.go index b819a6f..26053c1 100755 --- a/pkg/models/operations/getbalance.go +++ b/pkg/models/operations/getbalance.go @@ -27,11 +27,14 @@ func (o *GetBalanceRequest) GetID() string { } type GetBalanceResponse struct { + // HTTP response content type for this operation ContentType string // Balance summary GetBalanceResponse *shared.GetBalanceResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/getbalances.go b/pkg/models/operations/getbalances.go index 05ee63f..ce6988f 100755 --- a/pkg/models/operations/getbalances.go +++ b/pkg/models/operations/getbalances.go @@ -67,11 +67,14 @@ func (o *GetBalancesRequest) GetPaginationToken() *string { type GetBalancesResponse struct { // OK BalancesCursorResponse *shared.BalancesCursorResponse - ContentType string + // HTTP response content type for this operation + ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetBalancesResponse) GetBalancesCursorResponse() *shared.BalancesCursorResponse { diff --git a/pkg/models/operations/getbalancesaggregated.go b/pkg/models/operations/getbalancesaggregated.go index c7eda7f..6728136 100755 --- a/pkg/models/operations/getbalancesaggregated.go +++ b/pkg/models/operations/getbalancesaggregated.go @@ -31,11 +31,14 @@ func (o *GetBalancesAggregatedRequest) GetLedger() string { type GetBalancesAggregatedResponse struct { // OK AggregateBalancesResponse *shared.AggregateBalancesResponse - ContentType string + // HTTP response content type for this operation + ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetBalancesAggregatedResponse) GetAggregateBalancesResponse() *shared.AggregateBalancesResponse { diff --git a/pkg/models/operations/getconnectortask.go b/pkg/models/operations/getconnectortask.go index 817742e..36d1227 100755 --- a/pkg/models/operations/getconnectortask.go +++ b/pkg/models/operations/getconnectortask.go @@ -29,8 +29,11 @@ func (o *GetConnectorTaskRequest) GetTaskID() string { } type GetConnectorTaskResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // OK TaskResponse *shared.TaskResponse diff --git a/pkg/models/operations/getflow.go b/pkg/models/operations/getflow.go index 02953ea..b5f03b4 100755 --- a/pkg/models/operations/getflow.go +++ b/pkg/models/operations/getflow.go @@ -20,13 +20,16 @@ func (o *GetFlowRequest) GetFlowID() string { } type GetFlowResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow GetWorkflowResponse *shared.GetWorkflowResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetFlowResponse) GetContentType() string { diff --git a/pkg/models/operations/gethold.go b/pkg/models/operations/gethold.go index 30a2583..2077772 100755 --- a/pkg/models/operations/gethold.go +++ b/pkg/models/operations/gethold.go @@ -20,11 +20,14 @@ func (o *GetHoldRequest) GetHoldID() string { } type GetHoldResponse struct { + // HTTP response content type for this operation ContentType string // Holds GetHoldResponse *shared.GetHoldResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/getholds.go b/pkg/models/operations/getholds.go index 60fa1f4..87a926e 100755 --- a/pkg/models/operations/getholds.go +++ b/pkg/models/operations/getholds.go @@ -67,11 +67,14 @@ func (o *GetHoldsRequest) GetWalletID() *string { } type GetHoldsResponse struct { + // HTTP response content type for this operation ContentType string // Holds GetHoldsResponse *shared.GetHoldsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/getinfo.go b/pkg/models/operations/getinfo.go index 0dd44d0..f9af8ea 100755 --- a/pkg/models/operations/getinfo.go +++ b/pkg/models/operations/getinfo.go @@ -10,11 +10,14 @@ import ( type GetInfoResponse struct { // OK ConfigInfoResponse *shared.ConfigInfoResponse - ContentType string + // HTTP response content type for this operation + ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetInfoResponse) GetConfigInfoResponse() *shared.ConfigInfoResponse { diff --git a/pkg/models/operations/getledgerinfo.go b/pkg/models/operations/getledgerinfo.go index 391fd4a..4315101 100755 --- a/pkg/models/operations/getledgerinfo.go +++ b/pkg/models/operations/getledgerinfo.go @@ -20,13 +20,16 @@ func (o *GetLedgerInfoRequest) GetLedger() string { } type GetLedgerInfoResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse // OK LedgerInfoResponse *shared.LedgerInfoResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetLedgerInfoResponse) GetContentType() string { diff --git a/pkg/models/operations/getmanyconfigs.go b/pkg/models/operations/getmanyconfigs.go index 0143107..1adea02 100755 --- a/pkg/models/operations/getmanyconfigs.go +++ b/pkg/models/operations/getmanyconfigs.go @@ -31,9 +31,12 @@ func (o *GetManyConfigsRequest) GetID() *string { type GetManyConfigsResponse struct { // OK ConfigsResponse *shared.ConfigsResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetManyConfigsResponse) GetConfigsResponse() *shared.ConfigsResponse { diff --git a/pkg/models/operations/getmapping.go b/pkg/models/operations/getmapping.go index 7e3040b..ca16520 100755 --- a/pkg/models/operations/getmapping.go +++ b/pkg/models/operations/getmapping.go @@ -20,13 +20,16 @@ func (o *GetMappingRequest) GetLedger() string { } type GetMappingResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse // OK MappingResponse *shared.MappingResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetMappingResponse) GetContentType() string { diff --git a/pkg/models/operations/getpayment.go b/pkg/models/operations/getpayment.go index 8908b01..bbb2c65 100755 --- a/pkg/models/operations/getpayment.go +++ b/pkg/models/operations/getpayment.go @@ -20,11 +20,14 @@ func (o *GetPaymentRequest) GetPaymentID() string { } type GetPaymentResponse struct { + // HTTP response content type for this operation ContentType string // OK PaymentResponse *shared.PaymentResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetPaymentResponse) GetContentType() string { diff --git a/pkg/models/operations/getserverinfo.go b/pkg/models/operations/getserverinfo.go index df56bab..e441736 100755 --- a/pkg/models/operations/getserverinfo.go +++ b/pkg/models/operations/getserverinfo.go @@ -8,10 +8,13 @@ import ( ) type GetServerInfoResponse struct { + // HTTP response content type for this operation ContentType string // Server information - ServerInfo *shared.ServerInfo - StatusCode int + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/gettransaction.go b/pkg/models/operations/gettransaction.go index d2d0843..25478db 100755 --- a/pkg/models/operations/gettransaction.go +++ b/pkg/models/operations/gettransaction.go @@ -29,11 +29,14 @@ func (o *GetTransactionRequest) GetTxid() int64 { } type GetTransactionResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // OK TransactionResponse *shared.TransactionResponse } diff --git a/pkg/models/operations/gettransactions.go b/pkg/models/operations/gettransactions.go index f9748ae..a9837a0 100755 --- a/pkg/models/operations/gettransactions.go +++ b/pkg/models/operations/gettransactions.go @@ -54,11 +54,14 @@ func (o *GetTransactionsRequest) GetWalletID() *string { } type GetTransactionsResponse struct { + // HTTP response content type for this operation ContentType string // OK GetTransactionsResponse *shared.GetTransactionsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/getwallet.go b/pkg/models/operations/getwallet.go index e13ff35..b72727b 100755 --- a/pkg/models/operations/getwallet.go +++ b/pkg/models/operations/getwallet.go @@ -19,11 +19,14 @@ func (o *GetWalletRequest) GetID() string { } type GetWalletResponse struct { + // HTTP response content type for this operation ContentType string // Wallet GetWalletResponse *shared.GetWalletResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse } diff --git a/pkg/models/operations/getworkflowoccurrence.go b/pkg/models/operations/getworkflowoccurrence.go index 2e07a2f..8dc4041 100755 --- a/pkg/models/operations/getworkflowoccurrence.go +++ b/pkg/models/operations/getworkflowoccurrence.go @@ -29,13 +29,16 @@ func (o *GetWorkflowOccurrenceRequest) GetRunID() string { } type GetWorkflowOccurrenceResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow occurrence GetWorkflowOccurrenceResponse *shared.GetWorkflowOccurrenceResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *GetWorkflowOccurrenceResponse) GetContentType() string { diff --git a/pkg/models/operations/insertconfig.go b/pkg/models/operations/insertconfig.go index dcde300..f5361c8 100755 --- a/pkg/models/operations/insertconfig.go +++ b/pkg/models/operations/insertconfig.go @@ -10,9 +10,12 @@ import ( type InsertConfigResponse struct { // Config created successfully. ConfigResponse *shared.ConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // Bad Request InsertConfig400TextPlainString *string } diff --git a/pkg/models/operations/installconnector.go b/pkg/models/operations/installconnector.go index 4918f8e..c4d4530 100755 --- a/pkg/models/operations/installconnector.go +++ b/pkg/models/operations/installconnector.go @@ -28,8 +28,11 @@ func (o *InstallConnectorRequest) GetConnector() shared.Connector { } type InstallConnectorResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/listaccounts.go b/pkg/models/operations/listaccounts.go index 5de159b..87e55fa 100755 --- a/pkg/models/operations/listaccounts.go +++ b/pkg/models/operations/listaccounts.go @@ -191,11 +191,14 @@ func (o *ListAccountsRequest) GetPaginationToken() *string { type ListAccountsResponse struct { // OK AccountsCursorResponse *shared.AccountsCursorResponse - ContentType string + // HTTP response content type for this operation + ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListAccountsResponse) GetAccountsCursorResponse() *shared.AccountsCursorResponse { diff --git a/pkg/models/operations/listallconnectors.go b/pkg/models/operations/listallconnectors.go index f2499ab..b4d9cdf 100755 --- a/pkg/models/operations/listallconnectors.go +++ b/pkg/models/operations/listallconnectors.go @@ -10,9 +10,12 @@ import ( type ListAllConnectorsResponse struct { // OK ConnectorsResponse *shared.ConnectorsResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListAllConnectorsResponse) GetConnectorsResponse() *shared.ConnectorsResponse { diff --git a/pkg/models/operations/listbalances.go b/pkg/models/operations/listbalances.go index f833a66..4e489d8 100755 --- a/pkg/models/operations/listbalances.go +++ b/pkg/models/operations/listbalances.go @@ -19,11 +19,14 @@ func (o *ListBalancesRequest) GetID() string { } type ListBalancesResponse struct { + // HTTP response content type for this operation ContentType string // Balances list ListBalancesResponse *shared.ListBalancesResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListBalancesResponse) GetContentType() string { diff --git a/pkg/models/operations/listclients.go b/pkg/models/operations/listclients.go index 780f4e9..119b9cb 100755 --- a/pkg/models/operations/listclients.go +++ b/pkg/models/operations/listclients.go @@ -8,11 +8,14 @@ import ( ) type ListClientsResponse struct { + // HTTP response content type for this operation ContentType string // List of clients ListClientsResponse *shared.ListClientsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListClientsResponse) GetContentType() string { diff --git a/pkg/models/operations/listconfigsavailableconnectors.go b/pkg/models/operations/listconfigsavailableconnectors.go index 60a1eab..32325c1 100755 --- a/pkg/models/operations/listconfigsavailableconnectors.go +++ b/pkg/models/operations/listconfigsavailableconnectors.go @@ -10,9 +10,12 @@ import ( type ListConfigsAvailableConnectorsResponse struct { // OK ConnectorsConfigsResponse *shared.ConnectorsConfigsResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListConfigsAvailableConnectorsResponse) GetConnectorsConfigsResponse() *shared.ConnectorsConfigsResponse { diff --git a/pkg/models/operations/listconnectortasks.go b/pkg/models/operations/listconnectortasks.go index 7268c21..b3c51e5 100755 --- a/pkg/models/operations/listconnectortasks.go +++ b/pkg/models/operations/listconnectortasks.go @@ -55,8 +55,11 @@ func (o *ListConnectorTasksRequest) GetPageSize() *int64 { } type ListConnectorTasksResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // OK TasksCursor *shared.TasksCursor diff --git a/pkg/models/operations/listflows.go b/pkg/models/operations/listflows.go index 34e412d..069591a 100755 --- a/pkg/models/operations/listflows.go +++ b/pkg/models/operations/listflows.go @@ -8,13 +8,16 @@ import ( ) type ListFlowsResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // List of workflows ListWorkflowsResponse *shared.ListWorkflowsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListFlowsResponse) GetContentType() string { diff --git a/pkg/models/operations/listlogs.go b/pkg/models/operations/listlogs.go index 9385efc..f3bd3c5 100755 --- a/pkg/models/operations/listlogs.go +++ b/pkg/models/operations/listlogs.go @@ -144,13 +144,16 @@ func (o *ListLogsRequest) GetStartTimeDeprecated() *time.Time { } type ListLogsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse // OK LogsCursorResponse *shared.LogsCursorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListLogsResponse) GetContentType() string { diff --git a/pkg/models/operations/listpayments.go b/pkg/models/operations/listpayments.go index 6b8ce2a..cc5ba19 100755 --- a/pkg/models/operations/listpayments.go +++ b/pkg/models/operations/listpayments.go @@ -55,11 +55,14 @@ func (o *ListPaymentsRequest) GetSort() []string { } type ListPaymentsResponse struct { + // HTTP response content type for this operation ContentType string // OK PaymentsCursor *shared.PaymentsCursor - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListPaymentsResponse) GetContentType() string { diff --git a/pkg/models/operations/listruns.go b/pkg/models/operations/listruns.go index 5e18bbd..14112aa 100755 --- a/pkg/models/operations/listruns.go +++ b/pkg/models/operations/listruns.go @@ -20,13 +20,16 @@ func (o *ListRunsRequest) GetFlowID() string { } type ListRunsResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // List of workflow occurrences ListRunsResponse *shared.ListRunsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListRunsResponse) GetContentType() string { diff --git a/pkg/models/operations/listscopes.go b/pkg/models/operations/listscopes.go index 298ec70..f0bd2a1 100755 --- a/pkg/models/operations/listscopes.go +++ b/pkg/models/operations/listscopes.go @@ -8,11 +8,14 @@ import ( ) type ListScopesResponse struct { + // HTTP response content type for this operation ContentType string // List of scopes ListScopesResponse *shared.ListScopesResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListScopesResponse) GetContentType() string { diff --git a/pkg/models/operations/listtransactions.go b/pkg/models/operations/listtransactions.go index 2ddf126..192ec13 100755 --- a/pkg/models/operations/listtransactions.go +++ b/pkg/models/operations/listtransactions.go @@ -193,11 +193,14 @@ func (o *ListTransactionsRequest) GetStartTimeDeprecated() *time.Time { } type ListTransactionsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // OK TransactionsCursorResponse *shared.TransactionsCursorResponse } diff --git a/pkg/models/operations/listusers.go b/pkg/models/operations/listusers.go index 9cbe508..2ca6af5 100755 --- a/pkg/models/operations/listusers.go +++ b/pkg/models/operations/listusers.go @@ -8,11 +8,14 @@ import ( ) type ListUsersResponse struct { + // HTTP response content type for this operation ContentType string // List of users ListUsersResponse *shared.ListUsersResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListUsersResponse) GetContentType() string { diff --git a/pkg/models/operations/listwallets.go b/pkg/models/operations/listwallets.go index 40ae8ce..a3b3630 100755 --- a/pkg/models/operations/listwallets.go +++ b/pkg/models/operations/listwallets.go @@ -67,11 +67,14 @@ func (o *ListWalletsRequest) GetPageSize() *int64 { } type ListWalletsResponse struct { + // HTTP response content type for this operation ContentType string // OK ListWalletsResponse *shared.ListWalletsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ListWalletsResponse) GetContentType() string { diff --git a/pkg/models/operations/orchestrationgetserverinfo.go b/pkg/models/operations/orchestrationgetserverinfo.go index bf40c7d..fd85187 100755 --- a/pkg/models/operations/orchestrationgetserverinfo.go +++ b/pkg/models/operations/orchestrationgetserverinfo.go @@ -8,12 +8,15 @@ import ( ) type OrchestrationgetServerInfoResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // Server information - ServerInfo *shared.ServerInfo - StatusCode int + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/paymentsgetserverinfo.go b/pkg/models/operations/paymentsgetserverinfo.go index 7bb63ef..9679444 100755 --- a/pkg/models/operations/paymentsgetserverinfo.go +++ b/pkg/models/operations/paymentsgetserverinfo.go @@ -8,10 +8,13 @@ import ( ) type PaymentsgetServerInfoResponse struct { + // HTTP response content type for this operation ContentType string // Server information - ServerInfo *shared.ServerInfo - StatusCode int + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/paymentslistaccounts.go b/pkg/models/operations/paymentslistaccounts.go index 21bedfb..13c34e5 100755 --- a/pkg/models/operations/paymentslistaccounts.go +++ b/pkg/models/operations/paymentslistaccounts.go @@ -57,9 +57,12 @@ func (o *PaymentslistAccountsRequest) GetSort() []string { type PaymentslistAccountsResponse struct { // OK AccountsCursor *shared.AccountsCursor - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *PaymentslistAccountsResponse) GetAccountsCursor() *shared.AccountsCursor { diff --git a/pkg/models/operations/readclient.go b/pkg/models/operations/readclient.go index 8c07ba2..18535c7 100755 --- a/pkg/models/operations/readclient.go +++ b/pkg/models/operations/readclient.go @@ -20,11 +20,14 @@ func (o *ReadClientRequest) GetClientID() string { } type ReadClientResponse struct { + // HTTP response content type for this operation ContentType string // Retrieved client ReadClientResponse *shared.ReadClientResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ReadClientResponse) GetContentType() string { diff --git a/pkg/models/operations/readconnectorconfig.go b/pkg/models/operations/readconnectorconfig.go index a21396f..37da315 100755 --- a/pkg/models/operations/readconnectorconfig.go +++ b/pkg/models/operations/readconnectorconfig.go @@ -22,9 +22,12 @@ func (o *ReadConnectorConfigRequest) GetConnector() shared.Connector { type ReadConnectorConfigResponse struct { // OK ConnectorConfigResponse *shared.ConnectorConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ReadConnectorConfigResponse) GetConnectorConfigResponse() *shared.ConnectorConfigResponse { diff --git a/pkg/models/operations/readscope.go b/pkg/models/operations/readscope.go index 429abd5..ea149cd 100755 --- a/pkg/models/operations/readscope.go +++ b/pkg/models/operations/readscope.go @@ -20,11 +20,14 @@ func (o *ReadScopeRequest) GetScopeID() string { } type ReadScopeResponse struct { + // HTTP response content type for this operation ContentType string // Retrieved scope ReadScopeResponse *shared.ReadScopeResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ReadScopeResponse) GetContentType() string { diff --git a/pkg/models/operations/readstats.go b/pkg/models/operations/readstats.go index 1074ecc..1b72222 100755 --- a/pkg/models/operations/readstats.go +++ b/pkg/models/operations/readstats.go @@ -20,13 +20,16 @@ func (o *ReadStatsRequest) GetLedger() string { } type ReadStatsResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse // OK StatsResponse *shared.StatsResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ReadStatsResponse) GetContentType() string { diff --git a/pkg/models/operations/readuser.go b/pkg/models/operations/readuser.go index d3dff55..a16668a 100755 --- a/pkg/models/operations/readuser.go +++ b/pkg/models/operations/readuser.go @@ -20,11 +20,14 @@ func (o *ReadUserRequest) GetUserID() string { } type ReadUserResponse struct { + // HTTP response content type for this operation ContentType string // Retrieved user ReadUserResponse *shared.ReadUserResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *ReadUserResponse) GetContentType() string { diff --git a/pkg/models/operations/resetconnector.go b/pkg/models/operations/resetconnector.go index b5a04a8..a80d2ad 100755 --- a/pkg/models/operations/resetconnector.go +++ b/pkg/models/operations/resetconnector.go @@ -20,8 +20,11 @@ func (o *ResetConnectorRequest) GetConnector() shared.Connector { } type ResetConnectorResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/reverttransaction.go b/pkg/models/operations/reverttransaction.go index d78de40..ee2bb96 100755 --- a/pkg/models/operations/reverttransaction.go +++ b/pkg/models/operations/reverttransaction.go @@ -29,11 +29,14 @@ func (o *RevertTransactionRequest) GetTxid() int64 { } type RevertTransactionResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response // OK TransactionResponse *shared.TransactionResponse } diff --git a/pkg/models/operations/runscript.go b/pkg/models/operations/runscript.go index 7b38b08..6eceab0 100755 --- a/pkg/models/operations/runscript.go +++ b/pkg/models/operations/runscript.go @@ -37,6 +37,7 @@ func (o *RunScriptRequest) GetPreview() *bool { } type RunScriptResponse struct { + // HTTP response content type for this operation ContentType string // On success, it will return a 200 status code, and the resulting transaction under the `transaction` field. // @@ -46,8 +47,10 @@ type RunScriptResponse struct { // - `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript. // ScriptResponse *shared.ScriptResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *RunScriptResponse) GetContentType() string { diff --git a/pkg/models/operations/runworkflow.go b/pkg/models/operations/runworkflow.go index d443fce..70c9d0c 100755 --- a/pkg/models/operations/runworkflow.go +++ b/pkg/models/operations/runworkflow.go @@ -37,13 +37,16 @@ func (o *RunWorkflowRequest) GetWait() *bool { } type RunWorkflowResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow occurrence RunWorkflowResponse *shared.RunWorkflowResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *RunWorkflowResponse) GetContentType() string { diff --git a/pkg/models/operations/search.go b/pkg/models/operations/search.go index 45aff2e..cd05e1f 100755 --- a/pkg/models/operations/search.go +++ b/pkg/models/operations/search.go @@ -8,10 +8,13 @@ import ( ) type SearchResponse struct { + // HTTP response content type for this operation ContentType string // Success - Response *shared.Response - StatusCode int + Response *shared.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/searchgetserverinfo.go b/pkg/models/operations/searchgetserverinfo.go index 589d611..036e9af 100755 --- a/pkg/models/operations/searchgetserverinfo.go +++ b/pkg/models/operations/searchgetserverinfo.go @@ -8,10 +8,13 @@ import ( ) type SearchgetServerInfoResponse struct { + // HTTP response content type for this operation ContentType string // Server information - ServerInfo *shared.ServerInfo - StatusCode int + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/testconfig.go b/pkg/models/operations/testconfig.go index c630b0d..8083356 100755 --- a/pkg/models/operations/testconfig.go +++ b/pkg/models/operations/testconfig.go @@ -22,9 +22,12 @@ func (o *TestConfigRequest) GetID() string { type TestConfigResponse struct { // OK AttemptResponse *shared.AttemptResponse - ContentType string - StatusCode int - RawResponse *http.Response + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *TestConfigResponse) GetAttemptResponse() *shared.AttemptResponse { diff --git a/pkg/models/operations/uninstallconnector.go b/pkg/models/operations/uninstallconnector.go index 9aece6f..4c2b41d 100755 --- a/pkg/models/operations/uninstallconnector.go +++ b/pkg/models/operations/uninstallconnector.go @@ -20,8 +20,11 @@ func (o *UninstallConnectorRequest) GetConnector() shared.Connector { } type UninstallConnectorResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response } diff --git a/pkg/models/operations/updateclient.go b/pkg/models/operations/updateclient.go index 3a0196f..e2db606 100755 --- a/pkg/models/operations/updateclient.go +++ b/pkg/models/operations/updateclient.go @@ -28,8 +28,11 @@ func (o *UpdateClientRequest) GetClientID() string { } type UpdateClientResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Updated client UpdateClientResponse *shared.UpdateClientResponse diff --git a/pkg/models/operations/updatemapping.go b/pkg/models/operations/updatemapping.go index 65429b3..8c865eb 100755 --- a/pkg/models/operations/updatemapping.go +++ b/pkg/models/operations/updatemapping.go @@ -28,13 +28,16 @@ func (o *UpdateMappingRequest) GetLedger() string { } type UpdateMappingResponse struct { + // HTTP response content type for this operation ContentType string // Error ErrorResponse *shared.ErrorResponse // OK MappingResponse *shared.MappingResponse - StatusCode int - RawResponse *http.Response + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response } func (o *UpdateMappingResponse) GetContentType() string { diff --git a/pkg/models/operations/updatescope.go b/pkg/models/operations/updatescope.go index 3bc14bd..a45bf14 100755 --- a/pkg/models/operations/updatescope.go +++ b/pkg/models/operations/updatescope.go @@ -28,8 +28,11 @@ func (o *UpdateScopeRequest) GetScopeID() string { } type UpdateScopeResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Updated scope UpdateScopeResponse *shared.UpdateScopeResponse diff --git a/pkg/models/operations/updatewallet.go b/pkg/models/operations/updatewallet.go index 6c8852f..afd4e53 100755 --- a/pkg/models/operations/updatewallet.go +++ b/pkg/models/operations/updatewallet.go @@ -39,8 +39,11 @@ func (o *UpdateWalletRequest) GetID() string { } type UpdateWalletResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse diff --git a/pkg/models/operations/voidhold.go b/pkg/models/operations/voidhold.go index 90fd439..c3727f6 100755 --- a/pkg/models/operations/voidhold.go +++ b/pkg/models/operations/voidhold.go @@ -19,8 +19,11 @@ func (o *VoidHoldRequest) GetHoldID() string { } type VoidHoldResponse struct { + // HTTP response content type for this operation ContentType string - StatusCode int + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse diff --git a/pkg/models/operations/walletsgetserverinfo.go b/pkg/models/operations/walletsgetserverinfo.go index 15eb25c..ac2b226 100755 --- a/pkg/models/operations/walletsgetserverinfo.go +++ b/pkg/models/operations/walletsgetserverinfo.go @@ -8,10 +8,13 @@ import ( ) type WalletsgetServerInfoResponse struct { + // HTTP response content type for this operation ContentType string // Server information - ServerInfo *shared.ServerInfo - StatusCode int + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Error WalletsErrorResponse *shared.WalletsErrorResponse diff --git a/pkg/utils/json.go b/pkg/utils/json.go index ab6f410..dd057d5 100755 --- a/pkg/utils/json.go +++ b/pkg/utils/json.go @@ -432,6 +432,9 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa } if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } v = v.Elem() } @@ -498,6 +501,9 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa } if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } v = v.Elem() } diff --git a/pkg/utils/requestbody.go b/pkg/utils/requestbody.go index b8f1864..950f39a 100755 --- a/pkg/utils/requestbody.go +++ b/pkg/utils/requestbody.go @@ -30,7 +30,7 @@ func SerializeRequestBody(ctx context.Context, request interface{}, nullable, op requestValType := reflect.ValueOf(request) if isNil(requestStructType, requestValType) { - if optional || !nullable { + if !nullable && optional { return nil, "", nil } @@ -54,11 +54,11 @@ func SerializeRequestBody(ctx context.Context, request interface{}, nullable, op // request object (non-flattened) requestVal := requestValType.FieldByName(requestFieldName) if isNil(requestField.Type, requestVal) { - if optional || !nullable { + if !nullable && optional { return nil, "", nil } - return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestVal, tag.MediaType) + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) } return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) diff --git a/pkg/utils/security.go b/pkg/utils/security.go index 675cd57..a49445c 100755 --- a/pkg/utils/security.go +++ b/pkg/utils/security.go @@ -3,6 +3,7 @@ package utils import ( + "context" "encoding/base64" "fmt" "net/http" @@ -26,51 +27,79 @@ type securityTag struct { SubType string } -type SecurityClient struct { - client HTTPClient +type securityConfig struct { headers map[string]string queryParams map[string]string } -func newSecurityClient(client HTTPClient) *SecurityClient { +type SecurityClient struct { + HTTPClient + security func(ctx context.Context) (interface{}, error) +} + +func newSecurityClient(client HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { return &SecurityClient{ - client: client, - headers: make(map[string]string), - queryParams: make(map[string]string), + HTTPClient: client, + security: security, } } func (c *SecurityClient) Do(req *http.Request) (*http.Response, error) { - for k, v := range c.headers { + securityCtx, err := c.security(req.Context()) + if err != nil { + return nil, err + } + + ctx := securityConfig{ + headers: make(map[string]string), + queryParams: make(map[string]string), + } + parseSecurityStruct(&ctx, securityCtx) + + for k, v := range ctx.headers { req.Header.Set(k, v) } queryParams := req.URL.Query() - for k, v := range c.queryParams { - queryParams.Set(k, v) + for k, v := range ctx.queryParams { + queryParams.Add(k, v) + } + + for k, v := range queryParams { + for _, z := range v { + queryParams.Add(k, z) + } } req.URL.RawQuery = queryParams.Encode() - return c.client.Do(req) + return c.HTTPClient.Do(req) } -func ConfigureSecurityClient(c HTTPClient, security interface{}) *SecurityClient { - client := parseSecurityStruct(c, security) - if client != nil { - return client - } +func ConfigureSecurityClient(c HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { + return newSecurityClient(c, security) +} - return newSecurityClient(c) +func trueReflectValue(val reflect.Value) reflect.Value { + kind := val.Type().Kind() + for kind == reflect.Interface || kind == reflect.Ptr { + innerVal := val.Elem() + if !innerVal.IsValid() { + break + } + val = innerVal + kind = val.Type().Kind() + } + return val } -func parseSecurityStruct(c HTTPClient, security interface{}) *SecurityClient { - securityStructType := reflect.TypeOf(security) - securityValType := reflect.ValueOf(security) +func parseSecurityStruct(c *securityConfig, security interface{}) { + securityValType := trueReflectValue(reflect.ValueOf(security)) + securityStructType := securityValType.Type() if isNil(securityStructType, securityValType) { - return nil + return } if securityStructType.Kind() == reflect.Ptr { @@ -78,8 +107,6 @@ func parseSecurityStruct(c HTTPClient, security interface{}) *SecurityClient { securityValType = securityValType.Elem() } - client := newSecurityClient(c) - for i := 0; i < securityStructType.NumField(); i++ { fieldType := securityStructType.Field(i) valType := securityValType.Field(i) @@ -97,66 +124,51 @@ func parseSecurityStruct(c HTTPClient, security interface{}) *SecurityClient { secTag := parseSecurityTag(fieldType) if secTag != nil { if secTag.Option { - return parseSecurityOption(c, valType.Interface()) + handleSecurityOption(c, valType.Interface()) } else if secTag.Scheme { // Special case for basic auth which could be a flattened struct if secTag.SubType == "basic" && kind != reflect.Struct { - parseSecurityScheme(client, secTag, security) - return client + parseSecurityScheme(c, secTag, security) } else { - parseSecurityScheme(client, secTag, valType.Interface()) + parseSecurityScheme(c, secTag, valType.Interface()) } } } } - - return client } -func parseSecurityOption(c HTTPClient, option interface{}) *SecurityClient { - optionStructType := reflect.TypeOf(option) - optionValType := reflect.ValueOf(option) +func handleSecurityOption(c *securityConfig, option interface{}) error { + optionValType := trueReflectValue(reflect.ValueOf(option)) + optionStructType := optionValType.Type() if isNil(optionStructType, optionValType) { return nil } - if optionStructType.Kind() == reflect.Ptr { - optionStructType = optionStructType.Elem() - optionValType = optionValType.Elem() - } - - client := newSecurityClient(c) - for i := 0; i < optionStructType.NumField(); i++ { fieldType := optionStructType.Field(i) valType := optionValType.Field(i) secTag := parseSecurityTag(fieldType) if secTag != nil && secTag.Scheme { - parseSecurityScheme(client, secTag, valType.Interface()) + parseSecurityScheme(c, secTag, valType.Interface()) } } - return client + return nil } -func parseSecurityScheme(client *SecurityClient, schemeTag *securityTag, scheme interface{}) { - schemeType := reflect.TypeOf(scheme) - schemeVal := reflect.ValueOf(scheme) +func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme interface{}) { + schemeVal := trueReflectValue(reflect.ValueOf(scheme)) + schemeType := schemeVal.Type() if isNil(schemeType, schemeVal) { return } - if schemeType.Kind() == reflect.Ptr { - schemeType = schemeType.Elem() - schemeVal = schemeVal.Elem() - } - if schemeType.Kind() == reflect.Struct { if schemeTag.Type == "http" && schemeTag.SubType == "basic" { - parseBasicAuthScheme(client, schemeVal.Interface()) + handleBasicAuthScheme(client, schemeVal.Interface()) return } @@ -184,7 +196,7 @@ func parseSecurityScheme(client *SecurityClient, schemeTag *securityTag, scheme } } -func parseSecuritySchemeValue(client *SecurityClient, schemeTag *securityTag, secTag *securityTag, val interface{}) { +func parseSecuritySchemeValue(client *securityConfig, schemeTag *securityTag, secTag *securityTag, val interface{}) { switch schemeTag.Type { case "apiKey": switch schemeTag.SubType { @@ -221,7 +233,7 @@ func prefixBearer(authHeaderValue string) string { return fmt.Sprintf("Bearer %s", authHeaderValue) } -func parseBasicAuthScheme(client *SecurityClient, scheme interface{}) { +func handleBasicAuthScheme(client *securityConfig, scheme interface{}) { schemeStructType := reflect.TypeOf(scheme) schemeValType := reflect.ValueOf(scheme) diff --git a/scopes.go b/scopes.go index 729419a..94b1ebd 100755 --- a/scopes.go +++ b/scopes.go @@ -40,7 +40,7 @@ func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTr return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -89,7 +89,7 @@ func (s *scopes) CreateScope(ctx context.Context, request *shared.CreateScopeReq return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -149,7 +149,7 @@ func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScope return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -196,7 +196,7 @@ func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.De return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -240,7 +240,7 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -298,7 +298,7 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -361,7 +361,7 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/script.go b/script.go index da08ab7..759836c 100755 --- a/script.go +++ b/script.go @@ -49,7 +49,7 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/search.go b/search.go index 2400daf..de5eecf 100755 --- a/search.go +++ b/search.go @@ -45,7 +45,7 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) diff --git a/server.go b/server.go index 9d38425..4427c07 100755 --- a/server.go +++ b/server.go @@ -36,7 +36,7 @@ func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/stats.go b/stats.go index 451a589..e29250f 100755 --- a/stats.go +++ b/stats.go @@ -39,7 +39,7 @@ func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsReque return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/transactions.go b/transactions.go index 9cbb5d7..26d12ab 100755 --- a/transactions.go +++ b/transactions.go @@ -46,7 +46,7 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -122,7 +122,7 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -182,7 +182,7 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -254,7 +254,7 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -329,7 +329,7 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -399,7 +399,7 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -472,7 +472,7 @@ func (s *transactions) RevertTransaction(ctx context.Context, request operations return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/users.go b/users.go index cde77d6..f8bbee4 100755 --- a/users.go +++ b/users.go @@ -37,7 +37,7 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -95,7 +95,7 @@ func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/wallets.go b/wallets.go index f7faef7..2bc493e 100755 --- a/wallets.go +++ b/wallets.go @@ -44,7 +44,7 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -109,7 +109,7 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -182,7 +182,7 @@ func (s *wallets) CreateWallet(ctx context.Context, request *shared.CreateWallet return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -258,7 +258,7 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -323,7 +323,7 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -395,7 +395,7 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -464,7 +464,7 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -530,7 +530,7 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -599,7 +599,7 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -672,7 +672,7 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -742,7 +742,7 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -796,7 +796,7 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -862,7 +862,7 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -922,7 +922,7 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -977,7 +977,7 @@ func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.Wallets return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient diff --git a/webhooks.go b/webhooks.go index 1bbb69d..9ec7663 100755 --- a/webhooks.go +++ b/webhooks.go @@ -40,7 +40,7 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -107,7 +107,7 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -167,7 +167,7 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -226,7 +226,7 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "*/*") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient @@ -270,7 +270,7 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) @@ -360,7 +360,7 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser, req.Header.Set("Accept", "application/json;q=1, text/plain;q=0") } - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -428,7 +428,7 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) client := s.sdkConfiguration.SecurityClient From e64542778cd0741c584e1e4877c9f06fda55336a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 5 Oct 2023 00:38:41 +0000 Subject: [PATCH 3/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.94.0 --- RELEASES.md | 12 +++++- docs/models/shared/error.md | 8 ++-- docs/models/shared/errorerrorcode.md | 8 ++++ docs/models/shared/walletserrorresponse.md | 8 ++-- .../shared/walletserrorresponseerrorcode.md | 8 ++++ files.gen | 2 + formance.go | 6 +-- gen.yaml | 14 +++---- pkg/models/shared/error.go | 41 +++++++++++++------ pkg/models/shared/walletserrorresponse.go | 41 +++++++++++++------ pkg/utils/security.go | 6 --- 11 files changed, 105 insertions(+), 49 deletions(-) create mode 100755 docs/models/shared/errorerrorcode.md create mode 100755 docs/models/shared/walletserrorresponseerrorcode.md diff --git a/RELEASES.md b/RELEASES.md index a29a58d..bc2ca5e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -130,4 +130,14 @@ Based on: ### Generated - [go v0.5.0] . ### Releases -- [Go v0.5.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.5.0 - . \ No newline at end of file +- [Go v0.5.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.5.0 - . + +## 2023-10-05 00:38:21 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.94.0 (2.147.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.6.0] . +### Releases +- [Go v0.6.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.0 - . \ No newline at end of file diff --git a/docs/models/shared/error.md b/docs/models/shared/error.md index dfeeeea..c152dac 100755 --- a/docs/models/shared/error.md +++ b/docs/models/shared/error.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ErrorCode` | *string* | :heavy_check_mark: | N/A | -| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ErrorCode` | [ErrorErrorCode](../../models/shared/errorerrorcode.md) | :heavy_check_mark: | N/A | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/errorerrorcode.md b/docs/models/shared/errorerrorcode.md new file mode 100755 index 0000000..d0e0c2e --- /dev/null +++ b/docs/models/shared/errorerrorcode.md @@ -0,0 +1,8 @@ +# ErrorErrorCode + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `ErrorErrorCodeValidation` | VALIDATION | \ No newline at end of file diff --git a/docs/models/shared/walletserrorresponse.md b/docs/models/shared/walletserrorresponse.md index 2574da7..3e8c815 100755 --- a/docs/models/shared/walletserrorresponse.md +++ b/docs/models/shared/walletserrorresponse.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `ErrorCode` | *string* | :heavy_check_mark: | N/A | -| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ErrorCode` | [WalletsErrorResponseErrorCode](../../models/shared/walletserrorresponseerrorcode.md) | :heavy_check_mark: | N/A | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/walletserrorresponseerrorcode.md b/docs/models/shared/walletserrorresponseerrorcode.md new file mode 100755 index 0000000..a241f6b --- /dev/null +++ b/docs/models/shared/walletserrorresponseerrorcode.md @@ -0,0 +1,8 @@ +# WalletsErrorResponseErrorCode + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `WalletsErrorResponseErrorCodeValidation` | VALIDATION | \ No newline at end of file diff --git a/files.gen b/files.gen index 4a633f7..b7ed300 100755 --- a/files.gen +++ b/files.gen @@ -446,6 +446,7 @@ docs/models/shared/mappingresponse.md docs/models/shared/mapping.md docs/models/shared/contractexpr.md docs/models/shared/contract.md +docs/models/shared/errorerrorcode.md docs/models/shared/error.md docs/models/shared/createworkflowresponse.md docs/models/shared/workflow.md @@ -554,6 +555,7 @@ docs/models/shared/transactionscursorresponse.md docs/models/shared/listusersresponse.md docs/models/shared/user.md docs/models/shared/readuserresponse.md +docs/models/shared/walletserrorresponseerrorcode.md docs/models/shared/walletserrorresponse.md docs/models/shared/confirmholdrequest.md docs/models/shared/createbalanceresponse.md diff --git a/formance.go b/formance.go index 82f12f5..116e2cf 100755 --- a/formance.go +++ b/formance.go @@ -205,9 +205,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.5.0", - GenVersion: "2.139.1", - UserAgent: "speakeasy-sdk/go 0.5.0 2.139.1 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", + SDKVersion: "0.6.0", + GenVersion: "2.147.0", + UserAgent: "speakeasy-sdk/go 0.6.0 2.147.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { diff --git a/gen.yaml b/gen.yaml index 726e77f..8b20330 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.91.3 - generationVersion: 2.139.1 + speakeasyVersion: 1.94.0 + generationVersion: 2.147.0 generation: sdkClassName: formance sdkFlattening: true @@ -11,14 +11,14 @@ generation: telemetryEnabled: false features: go: - constsAndDefaults: 0.1.0 - core: 2.90.0 + constsAndDefaults: 0.1.1 + core: 2.91.2 deprecations: 2.81.1 - globalSecurity: 2.82.0 + globalSecurity: 2.82.1 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 - unions: 2.83.0 + unions: 2.83.1 go: - version: 0.5.0 + version: 0.6.0 maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk diff --git a/pkg/models/shared/error.go b/pkg/models/shared/error.go index 03180f0..bcf4644 100755 --- a/pkg/models/shared/error.go +++ b/pkg/models/shared/error.go @@ -3,27 +3,44 @@ package shared import ( - "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "encoding/json" + "fmt" ) -type Error struct { - errorCode string `const:"VALIDATION" json:"errorCode"` - ErrorMessage string `json:"errorMessage"` -} +type ErrorErrorCode string -func (e Error) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) +const ( + ErrorErrorCodeValidation ErrorErrorCode = "VALIDATION" +) + +func (e ErrorErrorCode) ToPointer() *ErrorErrorCode { + return &e } -func (e *Error) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { +func (e *ErrorErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { return err } - return nil + switch v { + case "VALIDATION": + *e = ErrorErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for ErrorErrorCode: %v", v) + } } -func (o *Error) GetErrorCode() string { - return "VALIDATION" +type Error struct { + ErrorCode ErrorErrorCode `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *Error) GetErrorCode() ErrorErrorCode { + if o == nil { + return ErrorErrorCode("") + } + return o.ErrorCode } func (o *Error) GetErrorMessage() string { diff --git a/pkg/models/shared/walletserrorresponse.go b/pkg/models/shared/walletserrorresponse.go index 35cc659..eca6bd7 100755 --- a/pkg/models/shared/walletserrorresponse.go +++ b/pkg/models/shared/walletserrorresponse.go @@ -3,27 +3,44 @@ package shared import ( - "github.com/speakeasy-sdks/formance-go-sdk/pkg/utils" + "encoding/json" + "fmt" ) -type WalletsErrorResponse struct { - errorCode string `const:"VALIDATION" json:"errorCode"` - ErrorMessage string `json:"errorMessage"` -} +type WalletsErrorResponseErrorCode string -func (w WalletsErrorResponse) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) +const ( + WalletsErrorResponseErrorCodeValidation WalletsErrorResponseErrorCode = "VALIDATION" +) + +func (e WalletsErrorResponseErrorCode) ToPointer() *WalletsErrorResponseErrorCode { + return &e } -func (w *WalletsErrorResponse) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { +func (e *WalletsErrorResponseErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { return err } - return nil + switch v { + case "VALIDATION": + *e = WalletsErrorResponseErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for WalletsErrorResponseErrorCode: %v", v) + } } -func (o *WalletsErrorResponse) GetErrorCode() string { - return "VALIDATION" +type WalletsErrorResponse struct { + ErrorCode WalletsErrorResponseErrorCode `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *WalletsErrorResponse) GetErrorCode() WalletsErrorResponseErrorCode { + if o == nil { + return WalletsErrorResponseErrorCode("") + } + return o.ErrorCode } func (o *WalletsErrorResponse) GetErrorMessage() string { diff --git a/pkg/utils/security.go b/pkg/utils/security.go index a49445c..fa5eff7 100755 --- a/pkg/utils/security.go +++ b/pkg/utils/security.go @@ -66,12 +66,6 @@ func (c *SecurityClient) Do(req *http.Request) (*http.Response, error) { queryParams.Add(k, v) } - for k, v := range queryParams { - for _, z := range v { - queryParams.Add(k, z) - } - } - req.URL.RawQuery = queryParams.Encode() return c.HTTPClient.Do(req) From 5916fc742cdad9b8ae8eaff1ae7afb6923ff909d Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 7 Oct 2023 00:38:11 +0000 Subject: [PATCH 4/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.96.1 --- .gitignore | 2 +- RELEASES.md | 12 +- accounts.go | 56 ++--- balances.go | 28 +-- clients.go | 126 +++++------ .../addmetadataontransactionrequest.md | 2 +- .../operations/addmetadatatoaccountrequest.md | 2 +- .../shared/accountwithvolumesandbalances.md | 4 +- .../shared/aggregatebalancesresponse.md | 6 +- docs/models/shared/configuser.md | 2 +- docs/models/shared/posttransaction.md | 2 +- docs/models/shared/query.md | 6 +- docs/models/shared/script.md | 2 +- docs/models/shared/transaction.md | 6 +- docs/models/shared/transactiondata.md | 2 +- docs/models/shared/webhooksconfig.md | 2 +- docs/sdks/accounts/README.md | 5 +- docs/sdks/clients/README.md | 32 ++- docs/sdks/logs/README.md | 7 - docs/sdks/orchestration/README.md | 9 +- docs/sdks/payments/README.md | 17 +- docs/sdks/scopes/README.md | 6 +- docs/sdks/script/README.md | 3 +- docs/sdks/search/README.md | 49 +++- docs/sdks/transactions/README.md | 25 +-- docs/sdks/wallets/README.md | 36 +-- docs/sdks/webhooks/README.md | 1 + files.gen | 1 + formance.go | 62 +++--- gen.yaml | 11 +- ledger.go | 14 +- logs.go | 14 +- mapping.go | 28 +-- orchestration.go | 98 ++++---- payments.go | 168 +++++++------- scopes.go | 98 ++++---- script.go | 14 +- search.go | 14 +- server.go | 14 +- stats.go | 14 +- transactions.go | 98 ++++---- users.go | 28 +-- wallets.go | 210 +++++++++--------- webhooks.go | 98 ++++---- 44 files changed, 728 insertions(+), 706 deletions(-) diff --git a/.gitignore b/.gitignore index 8b13789..d3c2f59 100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ - +# .gitignore diff --git a/RELEASES.md b/RELEASES.md index bc2ca5e..c38c6ad 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -140,4 +140,14 @@ Based on: ### Generated - [go v0.6.0] . ### Releases -- [Go v0.6.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.0 - . \ No newline at end of file +- [Go v0.6.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.0 - . + +## 2023-10-07 00:37:52 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.96.1 (2.150.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.6.1] . +### Releases +- [Go v0.6.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.1 - . \ No newline at end of file diff --git a/accounts.go b/accounts.go index 3895c23..9d687d9 100755 --- a/accounts.go +++ b/accounts.go @@ -60,13 +60,6 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.AddMetadataToAccountResponse{ @@ -74,6 +67,13 @@ func (s *accounts) AddMetadataToAccount(ctx context.Context, request operations. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -122,13 +122,6 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CountAccountsResponse{ @@ -136,6 +129,13 @@ func (s *accounts) CountAccounts(ctx context.Context, request operations.CountAc ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: res.Headers = httpRes.Header @@ -182,13 +182,6 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetAccountResponse{ @@ -196,6 +189,13 @@ func (s *accounts) GetAccount(ctx context.Context, request operations.GetAccount ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -256,13 +256,6 @@ func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAcco return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListAccountsResponse{ @@ -270,6 +263,13 @@ func (s *accounts) ListAccounts(ctx context.Context, request operations.ListAcco ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/balances.go b/balances.go index a433ade..5d11990 100755 --- a/balances.go +++ b/balances.go @@ -54,13 +54,6 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetBalancesResponse{ @@ -68,6 +61,13 @@ func (s *balances) GetBalances(ctx context.Context, request operations.GetBalanc ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -127,13 +127,6 @@ func (s *balances) GetBalancesAggregated(ctx context.Context, request operations return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetBalancesAggregatedResponse{ @@ -141,6 +134,13 @@ func (s *balances) GetBalancesAggregated(ctx context.Context, request operations ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/clients.go b/clients.go index 4de2df1..0e0de93 100755 --- a/clients.go +++ b/clients.go @@ -51,13 +51,6 @@ func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddSc return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.AddScopeToClientResponse{ @@ -65,6 +58,13 @@ func (s *clients) AddScopeToClient(ctx context.Context, request operations.AddSc ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -101,13 +101,6 @@ func (s *clients) CreateClient(ctx context.Context, request *shared.CreateClient return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateClientResponse{ @@ -115,6 +108,13 @@ func (s *clients) CreateClient(ctx context.Context, request *shared.CreateClient ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { @@ -165,13 +165,6 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateSecretResponse{ @@ -179,6 +172,13 @@ func (s *clients) CreateSecret(ctx context.Context, request operations.CreateSec ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -222,13 +222,6 @@ func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteCli return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteClientResponse{ @@ -236,6 +229,13 @@ func (s *clients) DeleteClient(ctx context.Context, request operations.DeleteCli ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -268,13 +268,6 @@ func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteScopeFromClientResponse{ @@ -282,6 +275,13 @@ func (s *clients) DeleteScopeFromClient(ctx context.Context, request operations. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -314,13 +314,6 @@ func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSec return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteSecretResponse{ @@ -328,6 +321,13 @@ func (s *clients) DeleteSecret(ctx context.Context, request operations.DeleteSec ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -357,13 +357,6 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListClientsResponse{ @@ -371,6 +364,13 @@ func (s *clients) ListClients(ctx context.Context) (*operations.ListClientsRespo ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -414,13 +414,6 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ReadClientResponse{ @@ -428,6 +421,13 @@ func (s *clients) ReadClient(ctx context.Context, request operations.ReadClientR ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -478,13 +478,6 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.UpdateClientResponse{ @@ -492,6 +485,13 @@ func (s *clients) UpdateClient(ctx context.Context, request operations.UpdateCli ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/docs/models/operations/addmetadataontransactionrequest.md b/docs/models/operations/addmetadataontransactionrequest.md index 9121596..f8f76da 100755 --- a/docs/models/operations/addmetadataontransactionrequest.md +++ b/docs/models/operations/addmetadataontransactionrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | -| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | metadata | | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | metadata | [object Object] | | `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | | `Txid` | *int64* | :heavy_check_mark: | Transaction ID. | 1234 | \ No newline at end of file diff --git a/docs/models/operations/addmetadatatoaccountrequest.md b/docs/models/operations/addmetadatatoaccountrequest.md index ebbf36d..17f0b5d 100755 --- a/docs/models/operations/addmetadatatoaccountrequest.md +++ b/docs/models/operations/addmetadatatoaccountrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `RequestBody` | map[string]*interface{}* | :heavy_check_mark: | metadata | | +| `RequestBody` | map[string]*interface{}* | :heavy_check_mark: | metadata | [object Object] | | `Address` | *string* | :heavy_check_mark: | Exact address of the account. It must match the following regular expressions pattern:
```
^\w+(:\w+)*$
```
| users:001 | | `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/shared/accountwithvolumesandbalances.md b/docs/models/shared/accountwithvolumesandbalances.md index e0b9828..4ee3890 100755 --- a/docs/models/shared/accountwithvolumesandbalances.md +++ b/docs/models/shared/accountwithvolumesandbalances.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `Address` | *string* | :heavy_check_mark: | N/A | users:001 | -| `Balances` | map[string]*int64* | :heavy_minus_sign: | N/A | | +| `Balances` | map[string]*int64* | :heavy_minus_sign: | N/A | [object Object] | | `Metadata` | [*AccountWithVolumesAndBalancesMetadata](../../models/shared/accountwithvolumesandbalancesmetadata.md) | :heavy_minus_sign: | N/A | | | `Type` | **string* | :heavy_minus_sign: | N/A | virtual | -| `Volumes` | map[string]map[string]*int64* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `Volumes` | map[string]map[string]*int64* | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/aggregatebalancesresponse.md b/docs/models/shared/aggregatebalancesresponse.md index 4dd70e6..82b9b94 100755 --- a/docs/models/shared/aggregatebalancesresponse.md +++ b/docs/models/shared/aggregatebalancesresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Data` | map[string]*int64* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Data` | map[string]*int64* | :heavy_check_mark: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/configuser.md b/docs/models/shared/configuser.md index 833380f..1bdef6f 100755 --- a/docs/models/shared/configuser.md +++ b/docs/models/shared/configuser.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | | `Endpoint` | *string* | :heavy_check_mark: | N/A | https://example.com | -| `EventTypes` | []*string* | :heavy_check_mark: | N/A | | +| `EventTypes` | []*string* | :heavy_check_mark: | N/A | TYPE1,TYPE2 | | `Secret` | **string* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | \ No newline at end of file diff --git a/docs/models/shared/posttransaction.md b/docs/models/shared/posttransaction.md index 87ad2d9..e5bde6d 100755 --- a/docs/models/shared/posttransaction.md +++ b/docs/models/shared/posttransaction.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | | `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_minus_sign: | N/A | | | `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | | `Script` | [*PostTransactionScript](../../models/shared/posttransactionscript.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/shared/query.md b/docs/models/shared/query.md index 63e5dfb..bca8d31 100755 --- a/docs/models/shared/query.md +++ b/docs/models/shared/query.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `After` | []*string* | :heavy_minus_sign: | N/A | | +| `After` | []*string* | :heavy_minus_sign: | N/A | users:002 | | `Cursor` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | -| `Ledgers` | []*string* | :heavy_minus_sign: | N/A | | +| `Ledgers` | []*string* | :heavy_minus_sign: | N/A | quickstart | | `PageSize` | **int64* | :heavy_minus_sign: | N/A | | | `Policy` | **string* | :heavy_minus_sign: | N/A | OR | | `Sort` | **string* | :heavy_minus_sign: | N/A | txid:asc | | `Target` | **string* | :heavy_minus_sign: | N/A | | -| `Terms` | []*string* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `Terms` | []*string* | :heavy_minus_sign: | N/A | destination=central_bank1 | \ No newline at end of file diff --git a/docs/models/shared/script.md b/docs/models/shared/script.md index 0a3d2d2..f10c12a 100755 --- a/docs/models/shared/script.md +++ b/docs/models/shared/script.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | | `Plain` | *string* | :heavy_check_mark: | N/A | vars {
account $user
}
send [COIN 10] (
source = @world
destination = $user
)
| | `Reference` | **string* | :heavy_minus_sign: | Reference to attach to the generated transaction | order_1234 | | `Vars` | [*ScriptVars](../../models/shared/scriptvars.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/transaction.md b/docs/models/shared/transaction.md index d3f08c1..8bda4c4 100755 --- a/docs/models/shared/transaction.md +++ b/docs/models/shared/transaction.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | -| `PostCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | +| `PostCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | [object Object] | | `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_check_mark: | N/A | | -| `PreCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | | +| `PreCommitVolumes` | map[string]map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | [object Object] | | `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | | `Timestamp` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | | `Txid` | *int64* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/transactiondata.md b/docs/models/shared/transactiondata.md index b3fc32b..1edc82f 100755 --- a/docs/models/shared/transactiondata.md +++ b/docs/models/shared/transactiondata.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | | `Postings` | [][Posting](../../models/shared/posting.md) | :heavy_check_mark: | N/A | | | `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | | `Timestamp` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/webhooksconfig.md b/docs/models/shared/webhooksconfig.md index bd0e2a1..353a2cf 100755 --- a/docs/models/shared/webhooksconfig.md +++ b/docs/models/shared/webhooksconfig.md @@ -8,7 +8,7 @@ | `Active` | **bool* | :heavy_minus_sign: | N/A | true | | `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | | `Endpoint` | **string* | :heavy_minus_sign: | N/A | https://example.com | -| `EventTypes` | []*string* | :heavy_minus_sign: | N/A | | +| `EventTypes` | []*string* | :heavy_minus_sign: | N/A | TYPE1,TYPE2 | | `ID` | **string* | :heavy_minus_sign: | N/A | | | `Secret` | **string* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | | `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md index 519af7d..acfa86f 100755 --- a/docs/sdks/accounts/README.md +++ b/docs/sdks/accounts/README.md @@ -39,7 +39,8 @@ func main() { ctx := context.Background() res, err := s.Accounts.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ RequestBody: map[string]interface{}{ - "adipisci": "silver", + "admin": "Oriental", + "a": "outside", }, Address: "users:001", Ledger: "ledger001", @@ -206,8 +207,6 @@ func main() { Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Ledger: "ledger001", Metadata: &operations.ListAccountsMetadata{}, - PageSize: formancegosdk.Int64(875058), - PageSizeDeprecated: formancegosdk.Int64(336035), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), }) if err != nil { diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index ce13f42..08fbd0b 100755 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -93,20 +93,17 @@ func main() { ) ctx := context.Background() - res, err := s.Clients.CreateClient(ctx, shared.CreateClientRequest{ - Description: formancegosdk.String("Managed optimizing help-desk"), + res, err := s.Clients.CreateClient(ctx, &shared.CreateClientRequest{ Metadata: map[string]interface{}{ - "vero": "Division", + "Dobra": "invoice", }, - Name: "Station East Functionality", + Name: "Dong Station", PostLogoutRedirectUris: []string{ - "24", + "East", }, - Public: formancegosdk.Bool(false), RedirectUris: []string{ - "fuchsia", + "Functionality", }, - Trusted: formancegosdk.Bool(false), }) if err != nil { log.Fatal(err) @@ -159,11 +156,11 @@ func main() { res, err := s.Clients.CreateSecret(ctx, operations.CreateSecretRequest{ CreateSecretRequest: &shared.CreateSecretRequest{ Metadata: map[string]interface{}{ - "aliquid": "Southwest", + "architecture": "hmph", }, - Name: "olive executive Taka", + Name: "National", }, - ClientID: "South", + ClientID: "Taka Alabama", }) if err != nil { log.Fatal(err) @@ -468,21 +465,18 @@ func main() { ctx := context.Background() res, err := s.Clients.UpdateClient(ctx, operations.UpdateClientRequest{ UpdateClientRequest: &shared.UpdateClientRequest{ - Description: formancegosdk.String("Secured static model"), Metadata: map[string]interface{}{ - "temporibus": "Northwest", + "fuchsia": "Configuration", }, - Name: "BMW XML", + Name: "Creative", PostLogoutRedirectUris: []string{ - "magenta", + "shofar", }, - Public: formancegosdk.Bool(false), RedirectUris: []string{ - "collaborative", + "Specialist", }, - Trusted: formancegosdk.Bool(false), }, - ClientID: "male gold", + ClientID: "payment finally Chevrolet", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/logs/README.md b/docs/sdks/logs/README.md index cc530f4..215168a 100755 --- a/docs/sdks/logs/README.md +++ b/docs/sdks/logs/README.md @@ -24,7 +24,6 @@ import( formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) func main() { @@ -38,14 +37,8 @@ func main() { res, err := s.Logs.ListLogs(ctx, operations.ListLogsRequest{ After: formancegosdk.String("1234"), Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - EndTime: types.MustTimeFromString("2022-09-04T05:10:40.788Z"), - EndTimeDeprecated: types.MustTimeFromString("2022-12-21T16:19:06.983Z"), Ledger: "ledger001", - PageSize: formancegosdk.Int64(279551), - PageSizeDeprecated: formancegosdk.Int64(61287), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - StartTime: types.MustTimeFromString("2021-01-03T01:50:13.003Z"), - StartTimeDeprecated: types.MustTimeFromString("2022-01-22T19:40:11.309Z"), }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md index 8144f05..6870446 100755 --- a/docs/sdks/orchestration/README.md +++ b/docs/sdks/orchestration/README.md @@ -39,10 +39,10 @@ func main() { ) ctx := context.Background() - res, err := s.Orchestration.CreateWorkflow(ctx, shared.CreateWorkflowRequest{ + res, err := s.Orchestration.CreateWorkflow(ctx, &shared.CreateWorkflowRequest{ Stages: []map[string]interface{}{ map[string]interface{}{ - "eveniet": "amidst", + "why": "Maryland", }, }, }) @@ -344,10 +344,9 @@ func main() { ctx := context.Background() res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{ RequestBody: map[string]string{ - "delectus": "Accountability", + "off": "quick", }, - FlowID: "newton aggregate Metal", - Wait: formancegosdk.Bool(false), + FlowID: "Ball female loyally", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index c400a7d..d98b78e 100755 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -202,8 +202,14 @@ func main() { ctx := context.Background() res, err := s.Payments.InstallConnector(ctx, operations.InstallConnectorRequest{ - ConnectorConfig: shared.ConnectorConfig{}, - Connector: shared.ConnectorDummyPay, + ConnectorConfig: shared.CreateConnectorConfigDummyPayConfig( + shared.DummyPayConfig{ + Directory: "/tmp/dummypay", + FileGenerationPeriod: formancegosdk.String("60s"), + FilePollingPeriod: formancegosdk.String("60s"), + }, + ), + Connector: shared.ConnectorBankingCircle, }) if err != nil { log.Fatal(err) @@ -350,7 +356,6 @@ func main() { res, err := s.Payments.ListConnectorTasks(ctx, operations.ListConnectorTasksRequest{ Connector: shared.ConnectorDummyPay, Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(501686), }) if err != nil { log.Fatal(err) @@ -402,9 +407,8 @@ func main() { ctx := context.Background() res, err := s.Payments.ListPayments(ctx, operations.ListPaymentsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(13778), Sort: []string{ - "harness", + "East", }, }) if err != nil { @@ -457,9 +461,8 @@ func main() { ctx := context.Background() res, err := s.Payments.PaymentslistAccounts(ctx, operations.PaymentslistAccountsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(227071), Sort: []string{ - "Virginia", + "Rustic", }, }) if err != nil { diff --git a/docs/sdks/scopes/README.md b/docs/sdks/scopes/README.md index 912e53b..eed2546 100755 --- a/docs/sdks/scopes/README.md +++ b/docs/sdks/scopes/README.md @@ -91,10 +91,10 @@ func main() { ) ctx := context.Background() - res, err := s.Scopes.CreateScope(ctx, shared.CreateScopeRequest{ + res, err := s.Scopes.CreateScope(ctx, &shared.CreateScopeRequest{ Label: "neural Sunrise", Metadata: map[string]interface{}{ - "vero": "deposit", + "internal": "Northwest", }, }) if err != nil { @@ -350,7 +350,7 @@ func main() { UpdateScopeRequest: &shared.UpdateScopeRequest{ Label: "East South Luxurious", Metadata: map[string]interface{}{ - "temporibus": "meh", + "Martin": "meh", }, }, ScopeID: "handcuff Xenon Timmy", diff --git a/docs/sdks/script/README.md b/docs/sdks/script/README.md index fda879b..dad78d7 100755 --- a/docs/sdks/script/README.md +++ b/docs/sdks/script/README.md @@ -40,7 +40,8 @@ func main() { res, err := s.Script.RunScript(ctx, operations.RunScriptRequest{ Script: shared.Script{ Metadata: map[string]interface{}{ - "eaque": "Borders", + "admin": "Azerbaijan", + "a": "Mercury", }, Plain: "vars { account $user diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 62e8126..04c7b68 100755 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -35,18 +35,57 @@ func main() { ctx := context.Background() res, err := s.Search.Search(ctx, shared.Query{ After: []string{ - "users:002", + "u", + "s", + "e", + "r", + "s", + ":", + "0", + "0", + "2", }, Cursor: formancegosdk.String("YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="), Ledgers: []string{ - "quickstart", + "q", + "u", + "i", + "c", + "k", + "s", + "t", + "a", + "r", + "t", }, - PageSize: formancegosdk.Int64(307631), Policy: formancegosdk.String("OR"), Sort: formancegosdk.String("txid:asc"), - Target: formancegosdk.String("Movies"), Terms: []string{ - "destination=central_bank1", + "d", + "e", + "s", + "t", + "i", + "n", + "a", + "t", + "i", + "o", + "n", + "=", + "c", + "e", + "n", + "t", + "r", + "a", + "l", + "_", + "b", + "a", + "n", + "k", + "1", }, }) if err != nil { diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 10353c8..1f9a657 100755 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -30,7 +30,6 @@ import( formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) func main() { @@ -46,7 +45,8 @@ func main() { Transactions: []shared.TransactionData{ shared.TransactionData{ Metadata: map[string]interface{}{ - "ipsam": "West", + "admin": "24/7", + "a": "underneath", }, Postings: []shared.Posting{ shared.Posting{ @@ -57,7 +57,6 @@ func main() { }, }, Reference: formancegosdk.String("ref:001"), - Timestamp: types.MustTimeFromString("2023-08-23T17:07:25.890Z"), }, }, }, @@ -113,7 +112,8 @@ func main() { ctx := context.Background() res, err := s.Transactions.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ RequestBody: map[string]interface{}{ - "esse": "Fresh", + "a": "withdrawal", + "admin": "Incredible", }, Ledger: "ledger001", Txid: 1234, @@ -156,7 +156,6 @@ import( formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) func main() { @@ -170,14 +169,10 @@ func main() { res, err := s.Transactions.CountTransactions(ctx, operations.CountTransactionsRequest{ Account: formancegosdk.String("users:001"), Destination: formancegosdk.String("users:001"), - EndTime: types.MustTimeFromString("2021-07-20T09:59:27.603Z"), - EndTimeDeprecated: types.MustTimeFromString("2023-09-27T00:52:47.091Z"), Ledger: "ledger001", Metadata: &operations.CountTransactionsMetadata{}, Reference: formancegosdk.String("ref:001"), Source: formancegosdk.String("users:001"), - StartTime: types.MustTimeFromString("2023-01-18T09:32:22.586Z"), - StartTimeDeprecated: types.MustTimeFromString("2021-04-16T00:36:33.819Z"), }) if err != nil { log.Fatal(err) @@ -217,7 +212,6 @@ import( formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) func main() { @@ -231,7 +225,8 @@ func main() { res, err := s.Transactions.CreateTransaction(ctx, operations.CreateTransactionRequest{ PostTransaction: shared.PostTransaction{ Metadata: map[string]interface{}{ - "reiciendis": "Ball", + "a": "before", + "admin": "zowie", }, Postings: []shared.Posting{ shared.Posting{ @@ -253,7 +248,6 @@ func main() { ", Vars: &shared.PostTransactionScriptVars{}, }, - Timestamp: types.MustTimeFromString("2023-10-22T10:08:19.757Z"), }, Ledger: "ledger001", Preview: formancegosdk.Bool(true), @@ -348,7 +342,6 @@ import( formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/operations" - "github.com/speakeasy-sdks/formance-go-sdk/pkg/types" ) func main() { @@ -364,17 +357,11 @@ func main() { After: formancegosdk.String("1234"), Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Destination: formancegosdk.String("users:001"), - EndTime: types.MustTimeFromString("2022-09-08T16:09:19.098Z"), - EndTimeDeprecated: types.MustTimeFromString("2021-01-02T10:19:36.126Z"), Ledger: "ledger001", Metadata: &operations.ListTransactionsMetadata{}, - PageSize: formancegosdk.Int64(641200), - PageSizeDeprecated: formancegosdk.Int64(459510), PaginationToken: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Reference: formancegosdk.String("ref:001"), Source: formancegosdk.String("users:001"), - StartTime: types.MustTimeFromString("2021-03-19T18:05:01.432Z"), - StartTimeDeprecated: types.MustTimeFromString("2022-09-12T07:36:38.262Z"), }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/wallets/README.md b/docs/sdks/wallets/README.md index 908be75..97bfd10 100755 --- a/docs/sdks/wallets/README.md +++ b/docs/sdks/wallets/README.md @@ -156,11 +156,11 @@ func main() { ) ctx := context.Background() - res, err := s.Wallets.CreateWallet(ctx, shared.CreateWalletRequest{ + res, err := s.Wallets.CreateWallet(ctx, &shared.CreateWalletRequest{ Metadata: map[string]interface{}{ - "deleniti": "Hybrid", + "array": "Islands", }, - Name: "fleck unto Calcium", + Name: "Versatile what orchid", }) if err != nil { log.Fatal(err) @@ -216,13 +216,16 @@ func main() { Amount: 201874, Asset: "second", }, - Balance: formancegosdk.String("Bike"), Metadata: map[string]interface{}{ - "quidem": "Clifton", + "Bedfordshire": "Samarium", }, - Reference: formancegosdk.String("purple Shoreline keenly"), Sources: []shared.Subject{ - shared.Subject{}, + shared.CreateSubjectLedgerAccountSubject( + shared.LedgerAccountSubject{ + Identifier: "Supervisor Clothing purple", + Type: "Tesla", + }, + ), }, }, ID: "", @@ -284,12 +287,15 @@ func main() { Balances: []string{ "Tasty", }, - Description: formancegosdk.String("Total 6th generation conglomeration"), - Destination: &shared.Subject{}, + Destination: shared.CreateSubjectWalletSubject( + shared.WalletSubject{ + Identifier: "Bike", + Type: "impactful", + }, + ), Metadata: map[string]interface{}{ - "non": "Bedfordshire", + "Hop": "SCSI", }, - Pending: formancegosdk.Bool(false), }, ID: "", }) @@ -447,8 +453,6 @@ func main() { res, err := s.Wallets.GetHolds(ctx, operations.GetHoldsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Metadata: &operations.GetHoldsMetadata{}, - PageSize: formancegosdk.Int64(692494), - WalletID: formancegosdk.String("Folding"), }) if err != nil { log.Fatal(err) @@ -498,8 +502,6 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetTransactions(ctx, operations.GetTransactionsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formancegosdk.Int64(680555), - WalletID: formancegosdk.String("Account"), }) if err != nil { log.Fatal(err) @@ -654,8 +656,6 @@ func main() { res, err := s.Wallets.ListWallets(ctx, operations.ListWalletsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Metadata: &operations.ListWalletsMetadata{}, - Name: formancegosdk.String("green Mobility"), - PageSize: formancegosdk.Int64(938918), }) if err != nil { log.Fatal(err) @@ -708,7 +708,7 @@ func main() { res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ RequestBody: &operations.UpdateWalletRequestBody{ Metadata: map[string]interface{}{ - "quas": "Books", + "override": "South", }, }, ID: "", diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 6723782..0bc16a1 100755 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -315,6 +315,7 @@ func main() { Endpoint: "https://example.com", EventTypes: []string{ "TYPE1", + "TYPE2", }, Secret: formancegosdk.String("V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"), }) diff --git a/files.gen b/files.gen index b7ed300..f89cdb0 100755 --- a/files.gen +++ b/files.gen @@ -34,6 +34,7 @@ pkg/utils/requestbody.go pkg/utils/retries.go pkg/utils/security.go pkg/utils/utils.go +tests/helpers.go pkg/models/operations/addmetadatatoaccount.go pkg/models/operations/countaccounts.go pkg/models/operations/getaccount.go diff --git a/formance.go b/formance.go index 116e2cf..232ef5c 100755 --- a/formance.go +++ b/formance.go @@ -171,6 +171,7 @@ func WithClient(client HTTPClient) SDKOption { sdk.sdkConfiguration.DefaultClient = client } } + func withSecurity(security interface{}) func(context.Context) (interface{}, error) { return func(context.Context) (interface{}, error) { return &security, nil @@ -178,18 +179,11 @@ func withSecurity(security interface{}) func(context.Context) (interface{}, erro } // WithSecurity configures the SDK to use the provided security details -func WithSecurity(security shared.Security) SDKOption { - return func(sdk *Formance) { - sdk.sdkConfiguration.Security = withSecurity(security) - } -} -// WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication -func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption { +func WithSecurity(authorization string) SDKOption { return func(sdk *Formance) { - sdk.sdkConfiguration.Security = func(ctx context.Context) (interface{}, error) { - return security(ctx) - } + security := shared.Security{Authorization: authorization} + sdk.sdkConfiguration.Security = withSecurity(&security) } } @@ -205,9 +199,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.6.0", - GenVersion: "2.147.0", - UserAgent: "speakeasy-sdk/go 0.6.0 2.147.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", + SDKVersion: "0.6.1", + GenVersion: "2.150.0", + UserAgent: "speakeasy-sdk/go 0.6.1 2.150.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { @@ -291,13 +285,6 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetServerInfoResponse{ @@ -305,6 +292,13 @@ func (s *Formance) GetServerInfo(ctx context.Context) (*operations.GetServerInfo ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -345,13 +339,6 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.PaymentsgetServerInfoResponse{ @@ -359,6 +346,13 @@ func (s *Formance) PaymentsgetServerInfo(ctx context.Context) (*operations.Payme ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -399,13 +393,6 @@ func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.Searchg return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.SearchgetServerInfoResponse{ @@ -413,6 +400,13 @@ func (s *Formance) SearchgetServerInfo(ctx context.Context) (*operations.Searchg ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/gen.yaml b/gen.yaml index 8b20330..b7785e8 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.94.0 - generationVersion: 2.147.0 + speakeasyVersion: 1.96.1 + generationVersion: 2.150.0 generation: sdkClassName: formance sdkFlattening: true @@ -12,13 +12,14 @@ generation: features: go: constsAndDefaults: 0.1.1 - core: 2.91.2 + core: 2.91.4 deprecations: 2.81.1 - globalSecurity: 2.82.1 + globalSecurity: 2.82.2 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 unions: 2.83.1 go: - version: 0.6.0 + version: 0.6.1 + flattenGlobalSecurity: true maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk diff --git a/ledger.go b/ledger.go index de1108a..102e187 100755 --- a/ledger.go +++ b/ledger.go @@ -50,13 +50,6 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetLedgerInfoResponse{ @@ -64,6 +57,13 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/logs.go b/logs.go index 823bf3c..584efad 100755 --- a/logs.go +++ b/logs.go @@ -55,13 +55,6 @@ func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListLogsResponse{ @@ -69,6 +62,13 @@ func (s *logs) ListLogs(ctx context.Context, request operations.ListLogsRequest) ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/mapping.go b/mapping.go index 884dfdd..182563f 100755 --- a/mapping.go +++ b/mapping.go @@ -50,13 +50,6 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetMappingResponse{ @@ -64,6 +57,13 @@ func (s *mapping) GetMapping(ctx context.Context, request operations.GetMappingR ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -129,13 +129,6 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.UpdateMappingResponse{ @@ -143,6 +136,13 @@ func (s *mapping) UpdateMapping(ctx context.Context, request operations.UpdateMa ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/orchestration.go b/orchestration.go index fade469..213f043 100755 --- a/orchestration.go +++ b/orchestration.go @@ -56,13 +56,6 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request *shared.Crea return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateWorkflowResponse{ @@ -70,6 +63,13 @@ func (s *orchestration) CreateWorkflow(ctx context.Context, request *shared.Crea ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { @@ -126,13 +126,6 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetFlowResponse{ @@ -140,6 +133,13 @@ func (s *orchestration) GetFlow(ctx context.Context, request operations.GetFlowR ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -196,13 +196,6 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetWorkflowOccurrenceResponse{ @@ -210,6 +203,13 @@ func (s *orchestration) GetWorkflowOccurrence(ctx context.Context, request opera ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -263,13 +263,6 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListFlowsResponse{ @@ -277,6 +270,13 @@ func (s *orchestration) ListFlows(ctx context.Context) (*operations.ListFlowsRes ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -333,13 +333,6 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListRunsResponse{ @@ -347,6 +340,13 @@ func (s *orchestration) ListRuns(ctx context.Context, request operations.ListRun ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -399,13 +399,6 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.OrchestrationgetServerInfoResponse{ @@ -413,6 +406,13 @@ func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operat ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -480,13 +480,6 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.RunWorkflowResponse{ @@ -494,6 +487,13 @@ func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunW ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { diff --git a/payments.go b/payments.go index c1eb982..77bb538 100755 --- a/payments.go +++ b/payments.go @@ -59,13 +59,6 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ConnectorsStripeTransferResponse{ @@ -73,6 +66,13 @@ func (s *payments) ConnectorsStripeTransfer(ctx context.Context, request shared. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -117,13 +117,6 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetConnectorTaskResponse{ @@ -131,6 +124,13 @@ func (s *payments) GetConnectorTask(ctx context.Context, request operations.GetC ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -174,13 +174,6 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetPaymentResponse{ @@ -188,6 +181,13 @@ func (s *payments) GetPayment(ctx context.Context, request operations.GetPayment ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -242,13 +242,6 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.InstallConnectorResponse{ @@ -256,6 +249,13 @@ func (s *payments) InstallConnector(ctx context.Context, request operations.Inst ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -286,13 +286,6 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListAllConnectorsResponse{ @@ -300,6 +293,13 @@ func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllCo ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -341,13 +341,6 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListConfigsAvailableConnectorsResponse{ @@ -355,6 +348,13 @@ func (s *payments) ListConfigsAvailableConnectors(ctx context.Context) (*operati ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -403,13 +403,6 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListConnectorTasksResponse{ @@ -417,6 +410,13 @@ func (s *payments) ListConnectorTasks(ctx context.Context, request operations.Li ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -461,13 +461,6 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListPaymentsResponse{ @@ -475,6 +468,13 @@ func (s *payments) ListPayments(ctx context.Context, request operations.ListPaym ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -519,13 +519,6 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.PaymentslistAccountsResponse{ @@ -533,6 +526,13 @@ func (s *payments) PaymentslistAccounts(ctx context.Context, request operations. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -577,13 +577,6 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ReadConnectorConfigResponse{ @@ -591,6 +584,13 @@ func (s *payments) ReadConnectorConfig(ctx context.Context, request operations.R ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -636,13 +636,6 @@ func (s *payments) ResetConnector(ctx context.Context, request operations.ResetC return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ResetConnectorResponse{ @@ -650,6 +643,13 @@ func (s *payments) ResetConnector(ctx context.Context, request operations.ResetC ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -683,13 +683,6 @@ func (s *payments) UninstallConnector(ctx context.Context, request operations.Un return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.UninstallConnectorResponse{ @@ -697,6 +690,13 @@ func (s *payments) UninstallConnector(ctx context.Context, request operations.Un ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } diff --git a/scopes.go b/scopes.go index 94b1ebd..5cbe293 100755 --- a/scopes.go +++ b/scopes.go @@ -52,13 +52,6 @@ func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTr return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.AddTransientScopeResponse{ @@ -66,6 +59,13 @@ func (s *scopes) AddTransientScope(ctx context.Context, request operations.AddTr ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -103,13 +103,6 @@ func (s *scopes) CreateScope(ctx context.Context, request *shared.CreateScopeReq return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateScopeResponse{ @@ -117,6 +110,13 @@ func (s *scopes) CreateScope(ctx context.Context, request *shared.CreateScopeReq ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { @@ -161,13 +161,6 @@ func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScope return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteScopeResponse{ @@ -175,6 +168,13 @@ func (s *scopes) DeleteScope(ctx context.Context, request operations.DeleteScope ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -208,13 +208,6 @@ func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.De return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteTransientScopeResponse{ @@ -222,6 +215,13 @@ func (s *scopes) DeleteTransientScope(ctx context.Context, request operations.De ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: } @@ -252,13 +252,6 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListScopesResponse{ @@ -266,6 +259,13 @@ func (s *scopes) ListScopes(ctx context.Context) (*operations.ListScopesResponse ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -310,13 +310,6 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ReadScopeResponse{ @@ -324,6 +317,13 @@ func (s *scopes) ReadScope(ctx context.Context, request operations.ReadScopeRequ ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -375,13 +375,6 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.UpdateScopeResponse{ @@ -389,6 +382,13 @@ func (s *scopes) UpdateScope(ctx context.Context, request operations.UpdateScope ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/script.go b/script.go index 759836c..c755498 100755 --- a/script.go +++ b/script.go @@ -67,13 +67,6 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.RunScriptResponse{ @@ -81,6 +74,13 @@ func (s *script) RunScript(ctx context.Context, request operations.RunScriptRequ ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/search.go b/search.go index de5eecf..15c5d33 100755 --- a/search.go +++ b/search.go @@ -59,13 +59,6 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.SearchResponse{ @@ -73,6 +66,13 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/server.go b/server.go index 4427c07..428a8e6 100755 --- a/server.go +++ b/server.go @@ -48,13 +48,6 @@ func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetInfoResponse{ @@ -62,6 +55,13 @@ func (s *server) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/stats.go b/stats.go index e29250f..666aa19 100755 --- a/stats.go +++ b/stats.go @@ -51,13 +51,6 @@ func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsReque return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ReadStatsResponse{ @@ -65,6 +58,13 @@ func (s *stats) ReadStats(ctx context.Context, request operations.ReadStatsReque ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/transactions.go b/transactions.go index 26d12ab..f600cb1 100755 --- a/transactions.go +++ b/transactions.go @@ -60,13 +60,6 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateTransactionsResponse{ @@ -74,6 +67,13 @@ func (s *transactions) CreateTransactions(ctx context.Context, request operation ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -136,13 +136,6 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.AddMetadataOnTransactionResponse{ @@ -150,6 +143,13 @@ func (s *transactions) AddMetadataOnTransaction(ctx context.Context, request ope ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -198,13 +198,6 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CountTransactionsResponse{ @@ -212,6 +205,13 @@ func (s *transactions) CountTransactions(ctx context.Context, request operations ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: res.Headers = httpRes.Header @@ -272,13 +272,6 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateTransactionResponse{ @@ -286,6 +279,13 @@ func (s *transactions) CreateTransaction(ctx context.Context, request operations ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -341,13 +341,6 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetTransactionResponse{ @@ -355,6 +348,13 @@ func (s *transactions) GetTransaction(ctx context.Context, request operations.Ge ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -415,13 +415,6 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListTransactionsResponse{ @@ -429,6 +422,13 @@ func (s *transactions) ListTransactions(ctx context.Context, request operations. ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -484,13 +484,6 @@ func (s *transactions) RevertTransaction(ctx context.Context, request operations return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.RevertTransactionResponse{ @@ -498,6 +491,13 @@ func (s *transactions) RevertTransaction(ctx context.Context, request operations ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/users.go b/users.go index f8bbee4..0601daa 100755 --- a/users.go +++ b/users.go @@ -49,13 +49,6 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListUsersResponse{ @@ -63,6 +56,13 @@ func (s *users) ListUsers(ctx context.Context) (*operations.ListUsersResponse, e ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -107,13 +107,6 @@ func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ReadUserResponse{ @@ -121,6 +114,13 @@ func (s *users) ReadUser(ctx context.Context, request operations.ReadUserRequest ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/wallets.go b/wallets.go index 2bc493e..5209aa9 100755 --- a/wallets.go +++ b/wallets.go @@ -58,13 +58,6 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ConfirmHoldResponse{ @@ -72,6 +65,13 @@ func (s *wallets) ConfirmHold(ctx context.Context, request operations.ConfirmHol ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -123,13 +123,6 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateBalanceResponse{ @@ -137,6 +130,13 @@ func (s *wallets) CreateBalance(ctx context.Context, request operations.CreateBa ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { @@ -196,13 +196,6 @@ func (s *wallets) CreateWallet(ctx context.Context, request *shared.CreateWallet return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreateWalletResponse{ @@ -210,6 +203,13 @@ func (s *wallets) CreateWallet(ctx context.Context, request *shared.CreateWallet ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 201: switch { @@ -272,13 +272,6 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.CreditWalletResponse{ @@ -286,6 +279,13 @@ func (s *wallets) CreditWallet(ctx context.Context, request operations.CreditWal ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -337,13 +337,6 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DebitWalletResponse{ @@ -351,6 +344,13 @@ func (s *wallets) DebitWallet(ctx context.Context, request operations.DebitWalle ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -407,13 +407,6 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetBalanceResponse{ @@ -421,6 +414,13 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -476,13 +476,6 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetHoldResponse{ @@ -490,6 +483,13 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -546,13 +546,6 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetHoldsResponse{ @@ -560,6 +553,13 @@ func (s *wallets) GetHolds(ctx context.Context, request operations.GetHoldsReque ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -615,13 +615,6 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetTransactionsResponse{ @@ -629,6 +622,13 @@ func (s *wallets) GetTransactions(ctx context.Context, request operations.GetTra ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -684,13 +684,6 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetWalletResponse{ @@ -698,6 +691,13 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -754,13 +754,6 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListBalancesResponse{ @@ -768,6 +761,13 @@ func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalan ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -812,13 +812,6 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ListWalletsResponse{ @@ -826,6 +819,13 @@ func (s *wallets) ListWallets(ctx context.Context, request operations.ListWallet ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -876,13 +876,6 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.UpdateWalletResponse{ @@ -890,6 +883,13 @@ func (s *wallets) UpdateWallet(ctx context.Context, request operations.UpdateWal ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -934,13 +934,6 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.VoidHoldResponse{ @@ -948,6 +941,13 @@ func (s *wallets) VoidHold(ctx context.Context, request operations.VoidHoldReque ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 204: default: @@ -989,13 +989,6 @@ func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.Wallets return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.WalletsgetServerInfoResponse{ @@ -1003,6 +996,13 @@ func (s *wallets) WalletsgetServerInfo(ctx context.Context) (*operations.Wallets ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { diff --git a/webhooks.go b/webhooks.go index 9ec7663..8b002dc 100755 --- a/webhooks.go +++ b/webhooks.go @@ -52,13 +52,6 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ActivateConfigResponse{ @@ -66,6 +59,13 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -121,13 +121,6 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.ChangeConfigSecretResponse{ @@ -135,6 +128,13 @@ func (s *webhooks) ChangeConfigSecret(ctx context.Context, request operations.Ch ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -179,13 +179,6 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeactivateConfigResponse{ @@ -193,6 +186,13 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -238,13 +238,6 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.DeleteConfigResponse{ @@ -252,6 +245,13 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: } @@ -286,13 +286,6 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.GetManyConfigsResponse{ @@ -300,6 +293,13 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -374,13 +374,6 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser, return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.InsertConfigResponse{ @@ -388,6 +381,13 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser, ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { @@ -440,13 +440,6 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig return nil, fmt.Errorf("error sending request: no response") } - rawBody, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - httpRes.Body.Close() - httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) - contentType := httpRes.Header.Get("Content-Type") res := &operations.TestConfigResponse{ @@ -454,6 +447,13 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig ContentType: contentType, RawResponse: httpRes, } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { case httpRes.StatusCode == 200: switch { From 5e0dfd81a1267226b89fca3f2efd6018a07dc409 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 14 Oct 2023 00:37:38 +0000 Subject: [PATCH 5/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.99.2 --- README.md | 33 +++++++++-------- RELEASES.md | 12 ++++++- USAGE.md | 29 ++++++++------- docs/sdks/accounts/README.md | 16 +++------ docs/sdks/balances/README.md | 8 ++--- docs/sdks/clients/README.md | 36 +++++-------------- docs/sdks/formance/README.md | 12 ++----- docs/sdks/ledger/README.md | 4 +-- docs/sdks/logs/README.md | 4 +-- docs/sdks/mapping/README.md | 8 ++--- docs/sdks/orchestration/README.md | 28 ++++----------- docs/sdks/payments/README.md | 48 +++++++------------------ docs/sdks/scopes/README.md | 28 ++++----------- docs/sdks/script/README.md | 4 +-- docs/sdks/search/README.md | 4 +-- docs/sdks/server/README.md | 4 +-- docs/sdks/stats/README.md | 4 +-- docs/sdks/transactions/README.md | 32 +++++------------ docs/sdks/users/README.md | 8 ++--- docs/sdks/wallets/README.md | 60 ++++++++----------------------- docs/sdks/webhooks/README.md | 28 ++++----------- formance.go | 6 ++-- gen.yaml | 8 ++--- pkg/utils/utils.go | 8 +++++ 24 files changed, 141 insertions(+), 291 deletions(-) diff --git a/README.md b/README.md index 937c5d2..bc0221d 100755 --- a/README.md +++ b/README.md @@ -25,30 +25,29 @@ go get github.com/speakeasy-sdks/formance-go-sdk ```go package main -import( +import ( "context" - "log" formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "log" ) func main() { - s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), - ) - - ctx := context.Background() - res, err := s.GetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } + s := formancegosdk.New( + formancegosdk.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Formance.GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } } + ``` diff --git a/RELEASES.md b/RELEASES.md index c38c6ad..81f5a4f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -150,4 +150,14 @@ Based on: ### Generated - [go v0.6.1] . ### Releases -- [Go v0.6.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.1 - . \ No newline at end of file +- [Go v0.6.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.1 - . + +## 2023-10-14 00:37:20 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.99.2 (2.155.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.6.2] . +### Releases +- [Go v0.6.2] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.2 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 7e4eb72..797b372 100755 --- a/USAGE.md +++ b/USAGE.md @@ -4,29 +4,28 @@ ```go package main -import( +import ( "context" - "log" formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "log" ) func main() { - s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), - ) + s := formancegosdk.New( + formancegosdk.WithSecurity(""), + ) - ctx := context.Background() - res, err := s.GetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } + ctx := context.Background() + res, err := s.Formance.GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } - if res.ServerInfo != nil { - // handle response - } + if res.ServerInfo != nil { + // handle response + } } + ``` \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md index acfa86f..b6f5b17 100755 --- a/docs/sdks/accounts/README.md +++ b/docs/sdks/accounts/README.md @@ -31,9 +31,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -87,9 +85,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -140,9 +136,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -192,9 +186,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/balances/README.md b/docs/sdks/balances/README.md index e67e198..1ce0470 100755 --- a/docs/sdks/balances/README.md +++ b/docs/sdks/balances/README.md @@ -29,9 +29,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -84,9 +82,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index 08fbd0b..2db1922 100755 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -36,9 +36,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -87,9 +85,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -147,9 +143,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -204,9 +198,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -255,9 +247,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -307,9 +297,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -358,9 +346,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -406,9 +392,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -457,9 +441,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/formance/README.md b/docs/sdks/formance/README.md index 2c709e7..49281e8 100755 --- a/docs/sdks/formance/README.md +++ b/docs/sdks/formance/README.md @@ -40,9 +40,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -87,9 +85,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -134,9 +130,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/ledger/README.md b/docs/sdks/ledger/README.md index 7405d72..ec8c3ba 100755 --- a/docs/sdks/ledger/README.md +++ b/docs/sdks/ledger/README.md @@ -28,9 +28,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/logs/README.md b/docs/sdks/logs/README.md index 215168a..c395921 100755 --- a/docs/sdks/logs/README.md +++ b/docs/sdks/logs/README.md @@ -28,9 +28,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/mapping/README.md b/docs/sdks/mapping/README.md index 07e2202..37b5c28 100755 --- a/docs/sdks/mapping/README.md +++ b/docs/sdks/mapping/README.md @@ -29,9 +29,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -80,9 +78,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md index 6870446..306d9b3 100755 --- a/docs/sdks/orchestration/README.md +++ b/docs/sdks/orchestration/README.md @@ -33,9 +33,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -88,9 +86,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -139,9 +135,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -190,9 +184,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -238,9 +230,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -288,9 +278,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -336,9 +324,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index d98b78e..6a8a9df 100755 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -38,9 +38,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -92,9 +90,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -144,9 +140,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -195,9 +189,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -252,9 +244,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -299,9 +289,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -347,9 +335,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -399,9 +385,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -453,9 +437,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -507,9 +489,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -560,9 +540,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -611,9 +589,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/scopes/README.md b/docs/sdks/scopes/README.md index eed2546..62e3fa6 100755 --- a/docs/sdks/scopes/README.md +++ b/docs/sdks/scopes/README.md @@ -34,9 +34,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -85,9 +83,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -139,9 +135,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -190,9 +184,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -241,9 +233,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -289,9 +279,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -340,9 +328,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/script/README.md b/docs/sdks/script/README.md index dad78d7..0866b49 100755 --- a/docs/sdks/script/README.md +++ b/docs/sdks/script/README.md @@ -31,9 +31,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 04c7b68..1d28559 100755 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -27,9 +27,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 3effdcb..6bc139d 100755 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -27,9 +27,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/stats/README.md b/docs/sdks/stats/README.md index 2656b29..3bae618 100755 --- a/docs/sdks/stats/README.md +++ b/docs/sdks/stats/README.md @@ -29,9 +29,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 1f9a657..277012d 100755 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -34,9 +34,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -104,16 +102,14 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() res, err := s.Transactions.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ RequestBody: map[string]interface{}{ - "a": "withdrawal", - "admin": "Incredible", + "admin": "withdrawal", + "a": "Incredible", }, Ledger: "ledger001", Txid: 1234, @@ -160,9 +156,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -216,9 +210,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -294,9 +286,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -346,9 +336,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -405,9 +393,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index ae90300..b8b6108 100755 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -28,9 +28,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -76,9 +74,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/wallets/README.md b/docs/sdks/wallets/README.md index 97bfd10..65c53b9 100755 --- a/docs/sdks/wallets/README.md +++ b/docs/sdks/wallets/README.md @@ -42,9 +42,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -97,9 +95,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -150,9 +146,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -204,9 +198,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -272,9 +264,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -341,9 +331,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -393,9 +381,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -444,9 +430,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -494,9 +478,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -545,9 +527,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -596,9 +576,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -647,9 +625,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -699,9 +675,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -755,9 +729,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -805,9 +777,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 0bc16a1..4feac4f 100755 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -34,9 +34,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -89,9 +87,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -143,9 +139,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -194,9 +188,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -245,9 +237,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -305,9 +295,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() @@ -361,9 +349,7 @@ import( func main() { s := formancegosdk.New( - formancegosdk.WithSecurity(shared.Security{ - Authorization: "", - }), + formancegosdk.WithSecurity(""), ) ctx := context.Background() diff --git a/formance.go b/formance.go index 232ef5c..3ed042c 100755 --- a/formance.go +++ b/formance.go @@ -199,9 +199,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.6.1", - GenVersion: "2.150.0", - UserAgent: "speakeasy-sdk/go 0.6.1 2.150.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", + SDKVersion: "0.6.2", + GenVersion: "2.155.1", + UserAgent: "speakeasy-sdk/go 0.6.2 2.155.1 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { diff --git a/gen.yaml b/gen.yaml index b7785e8..9d055dc 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.96.1 - generationVersion: 2.150.0 + speakeasyVersion: 1.99.2 + generationVersion: 2.155.1 generation: sdkClassName: formance sdkFlattening: true @@ -12,14 +12,14 @@ generation: features: go: constsAndDefaults: 0.1.1 - core: 2.91.4 + core: 2.91.5 deprecations: 2.81.1 globalSecurity: 2.82.2 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 unions: 2.83.1 go: - version: 0.6.1 + version: 0.6.2 flattenGlobalSecurity: true maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index f630a32..4ef632a 100755 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -155,6 +155,14 @@ func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, p } func isNil(typ reflect.Type, val reflect.Value) bool { + // `reflect.TypeOf(nil) == nil` so calling typ.Kind() will cause a nil pointer + // dereference panic. Catch it and return early. + // https://github.com/golang/go/issues/51649 + // https://github.com/golang/go/issues/54208 + if typ == nil { + return true + } + if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { return val.IsNil() } From 88c0ae47749ee5a3573df8ec0dcde1b7c04f98a1 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sat, 21 Oct 2023 00:37:29 +0000 Subject: [PATCH 6/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.104.0 --- RELEASES.md | 12 +++++++++- docs/sdks/accounts/README.md | 4 ++-- docs/sdks/clients/README.md | 40 +++++++++++++++---------------- docs/sdks/orchestration/README.md | 14 +++++------ docs/sdks/payments/README.md | 8 +++---- docs/sdks/scopes/README.md | 22 ++++++++--------- docs/sdks/script/README.md | 4 ++-- docs/sdks/transactions/README.md | 12 +++++----- docs/sdks/users/README.md | 2 +- docs/sdks/wallets/README.md | 38 ++++++++++++++--------------- formance.go | 6 ++--- gen.yaml | 14 +++++++---- 12 files changed, 95 insertions(+), 81 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 81f5a4f..2d69169 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -160,4 +160,14 @@ Based on: ### Generated - [go v0.6.2] . ### Releases -- [Go v0.6.2] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.2 - . \ No newline at end of file +- [Go v0.6.2] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.6.2 - . + +## 2023-10-21 00:37:07 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.104.0 (2.169.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.7.0] . +### Releases +- [Go v0.7.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.7.0 - . \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md index b6f5b17..f28c6ce 100755 --- a/docs/sdks/accounts/README.md +++ b/docs/sdks/accounts/README.md @@ -37,8 +37,8 @@ func main() { ctx := context.Background() res, err := s.Accounts.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ RequestBody: map[string]interface{}{ - "admin": "Oriental", - "a": "outside", + "a": "string", + "admin": "string", }, Address: "users:001", Ledger: "ledger001", diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index 2db1922..0eb71df 100755 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -41,8 +41,8 @@ func main() { ctx := context.Background() res, err := s.Clients.AddScopeToClient(ctx, operations.AddScopeToClientRequest{ - ClientID: "East laudantium HTTP", - ScopeID: "boo Senior", + ClientID: "string", + ScopeID: "string", }) if err != nil { log.Fatal(err) @@ -91,14 +91,14 @@ func main() { ctx := context.Background() res, err := s.Clients.CreateClient(ctx, &shared.CreateClientRequest{ Metadata: map[string]interface{}{ - "Dobra": "invoice", + "key": "string", }, - Name: "Dong Station", + Name: "string", PostLogoutRedirectUris: []string{ - "East", + "string", }, RedirectUris: []string{ - "Functionality", + "string", }, }) if err != nil { @@ -150,11 +150,11 @@ func main() { res, err := s.Clients.CreateSecret(ctx, operations.CreateSecretRequest{ CreateSecretRequest: &shared.CreateSecretRequest{ Metadata: map[string]interface{}{ - "architecture": "hmph", + "key": "string", }, - Name: "National", + Name: "string", }, - ClientID: "Taka Alabama", + ClientID: "string", }) if err != nil { log.Fatal(err) @@ -203,7 +203,7 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteClient(ctx, operations.DeleteClientRequest{ - ClientID: "salmon synergize", + ClientID: "string", }) if err != nil { log.Fatal(err) @@ -252,8 +252,8 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteScopeFromClient(ctx, operations.DeleteScopeFromClientRequest{ - ClientID: "Northeast synergy zowie", - ScopeID: "befriend coherent", + ClientID: "string", + ScopeID: "string", }) if err != nil { log.Fatal(err) @@ -302,8 +302,8 @@ func main() { ctx := context.Background() res, err := s.Clients.DeleteSecret(ctx, operations.DeleteSecretRequest{ - ClientID: "ashamed transform past", - SecretID: "Afghani rosemary South", + ClientID: "string", + SecretID: "string", }) if err != nil { log.Fatal(err) @@ -397,7 +397,7 @@ func main() { ctx := context.Background() res, err := s.Clients.ReadClient(ctx, operations.ReadClientRequest{ - ClientID: "COM Wagon", + ClientID: "string", }) if err != nil { log.Fatal(err) @@ -448,17 +448,17 @@ func main() { res, err := s.Clients.UpdateClient(ctx, operations.UpdateClientRequest{ UpdateClientRequest: &shared.UpdateClientRequest{ Metadata: map[string]interface{}{ - "fuchsia": "Configuration", + "key": "string", }, - Name: "Creative", + Name: "string", PostLogoutRedirectUris: []string{ - "shofar", + "string", }, RedirectUris: []string{ - "Specialist", + "string", }, }, - ClientID: "payment finally Chevrolet", + ClientID: "string", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md index 306d9b3..657d93a 100755 --- a/docs/sdks/orchestration/README.md +++ b/docs/sdks/orchestration/README.md @@ -40,7 +40,7 @@ func main() { res, err := s.Orchestration.CreateWorkflow(ctx, &shared.CreateWorkflowRequest{ Stages: []map[string]interface{}{ map[string]interface{}{ - "why": "Maryland", + "key": "string", }, }, }) @@ -91,7 +91,7 @@ func main() { ctx := context.Background() res, err := s.Orchestration.GetFlow(ctx, operations.GetFlowRequest{ - FlowID: "male extend", + FlowID: "string", }) if err != nil { log.Fatal(err) @@ -140,8 +140,8 @@ func main() { ctx := context.Background() res, err := s.Orchestration.GetWorkflowOccurrence(ctx, operations.GetWorkflowOccurrenceRequest{ - FlowID: "granular B2B", - RunID: "sticky African Islands", + FlowID: "string", + RunID: "string", }) if err != nil { log.Fatal(err) @@ -235,7 +235,7 @@ func main() { ctx := context.Background() res, err := s.Orchestration.ListRuns(ctx, operations.ListRunsRequest{ - FlowID: "Cambridgeshire Southeast", + FlowID: "string", }) if err != nil { log.Fatal(err) @@ -330,9 +330,9 @@ func main() { ctx := context.Background() res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{ RequestBody: map[string]string{ - "off": "quick", + "key": "string", }, - FlowID: "Ball female loyally", + FlowID: "string", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index 6a8a9df..9151a13 100755 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -96,7 +96,7 @@ func main() { ctx := context.Background() res, err := s.Payments.GetConnectorTask(ctx, operations.GetConnectorTaskRequest{ Connector: shared.ConnectorBankingCircle, - TaskID: "Recycled male", + TaskID: "string", }) if err != nil { log.Fatal(err) @@ -145,7 +145,7 @@ func main() { ctx := context.Background() res, err := s.Payments.GetPayment(ctx, operations.GetPaymentRequest{ - PaymentID: "West", + PaymentID: "string", }) if err != nil { log.Fatal(err) @@ -392,7 +392,7 @@ func main() { res, err := s.Payments.ListPayments(ctx, operations.ListPaymentsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Sort: []string{ - "East", + "string", }, }) if err != nil { @@ -444,7 +444,7 @@ func main() { res, err := s.Payments.PaymentslistAccounts(ctx, operations.PaymentslistAccountsRequest{ Cursor: formancegosdk.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), Sort: []string{ - "Rustic", + "string", }, }) if err != nil { diff --git a/docs/sdks/scopes/README.md b/docs/sdks/scopes/README.md index 62e3fa6..d6a4309 100755 --- a/docs/sdks/scopes/README.md +++ b/docs/sdks/scopes/README.md @@ -39,8 +39,8 @@ func main() { ctx := context.Background() res, err := s.Scopes.AddTransientScope(ctx, operations.AddTransientScopeRequest{ - ScopeID: "executive Soul", - TransientScopeID: "Keyboard neural tan", + ScopeID: "string", + TransientScopeID: "string", }) if err != nil { log.Fatal(err) @@ -88,9 +88,9 @@ func main() { ctx := context.Background() res, err := s.Scopes.CreateScope(ctx, &shared.CreateScopeRequest{ - Label: "neural Sunrise", + Label: "string", Metadata: map[string]interface{}{ - "internal": "Northwest", + "key": "string", }, }) if err != nil { @@ -140,7 +140,7 @@ func main() { ctx := context.Background() res, err := s.Scopes.DeleteScope(ctx, operations.DeleteScopeRequest{ - ScopeID: "impedit Bronze", + ScopeID: "string", }) if err != nil { log.Fatal(err) @@ -189,8 +189,8 @@ func main() { ctx := context.Background() res, err := s.Scopes.DeleteTransientScope(ctx, operations.DeleteTransientScopeRequest{ - ScopeID: "billion Chips", - TransientScopeID: "Account untidy haptic", + ScopeID: "string", + TransientScopeID: "string", }) if err != nil { log.Fatal(err) @@ -284,7 +284,7 @@ func main() { ctx := context.Background() res, err := s.Scopes.ReadScope(ctx, operations.ReadScopeRequest{ - ScopeID: "Internal Credit Hermaphrodite", + ScopeID: "string", }) if err != nil { log.Fatal(err) @@ -334,12 +334,12 @@ func main() { ctx := context.Background() res, err := s.Scopes.UpdateScope(ctx, operations.UpdateScopeRequest{ UpdateScopeRequest: &shared.UpdateScopeRequest{ - Label: "East South Luxurious", + Label: "string", Metadata: map[string]interface{}{ - "Martin": "meh", + "key": "string", }, }, - ScopeID: "handcuff Xenon Timmy", + ScopeID: "string", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/script/README.md b/docs/sdks/script/README.md index 0866b49..35b3298 100755 --- a/docs/sdks/script/README.md +++ b/docs/sdks/script/README.md @@ -38,8 +38,8 @@ func main() { res, err := s.Script.RunScript(ctx, operations.RunScriptRequest{ Script: shared.Script{ Metadata: map[string]interface{}{ - "admin": "Azerbaijan", - "a": "Mercury", + "admin": "string", + "a": "string", }, Plain: "vars { account $user diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 277012d..e526104 100755 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -43,8 +43,8 @@ func main() { Transactions: []shared.TransactionData{ shared.TransactionData{ Metadata: map[string]interface{}{ - "admin": "24/7", - "a": "underneath", + "admin": "string", + "a": "string", }, Postings: []shared.Posting{ shared.Posting{ @@ -108,8 +108,8 @@ func main() { ctx := context.Background() res, err := s.Transactions.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ RequestBody: map[string]interface{}{ - "admin": "withdrawal", - "a": "Incredible", + "admin": "string", + "a": "string", }, Ledger: "ledger001", Txid: 1234, @@ -217,8 +217,8 @@ func main() { res, err := s.Transactions.CreateTransaction(ctx, operations.CreateTransactionRequest{ PostTransaction: shared.PostTransaction{ Metadata: map[string]interface{}{ - "a": "before", - "admin": "zowie", + "admin": "string", + "a": "string", }, Postings: []shared.Posting{ shared.Posting{ diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index b8b6108..3b391e7 100755 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -79,7 +79,7 @@ func main() { ctx := context.Background() res, err := s.Users.ReadUser(ctx, operations.ReadUserRequest{ - UserID: "Goodwin Folding always", + UserID: "string", }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/wallets/README.md b/docs/sdks/wallets/README.md index 65c53b9..b65ce6d 100755 --- a/docs/sdks/wallets/README.md +++ b/docs/sdks/wallets/README.md @@ -51,7 +51,7 @@ func main() { Amount: formancegosdk.Int64(100), Final: formancegosdk.Bool(true), }, - HoldID: "Missouri holistic", + HoldID: "string", }) if err != nil { log.Fatal(err) @@ -101,7 +101,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.CreateBalance(ctx, operations.CreateBalanceRequest{ CreateBalanceRequest: &shared.CreateBalanceRequest{ - Name: "Cab Lawrence female", + Name: "string", }, ID: "", }) @@ -152,9 +152,9 @@ func main() { ctx := context.Background() res, err := s.Wallets.CreateWallet(ctx, &shared.CreateWalletRequest{ Metadata: map[string]interface{}{ - "array": "Islands", + "key": "string", }, - Name: "Versatile what orchid", + Name: "string", }) if err != nil { log.Fatal(err) @@ -206,16 +206,16 @@ func main() { CreditWalletRequest: &shared.CreditWalletRequest{ Amount: shared.Monetary{ Amount: 201874, - Asset: "second", + Asset: "string", }, Metadata: map[string]interface{}{ - "Bedfordshire": "Samarium", + "key": "string", }, Sources: []shared.Subject{ shared.CreateSubjectLedgerAccountSubject( shared.LedgerAccountSubject{ - Identifier: "Supervisor Clothing purple", - Type: "Tesla", + Identifier: "string", + Type: "string", }, ), }, @@ -272,19 +272,19 @@ func main() { DebitWalletRequest: &shared.DebitWalletRequest{ Amount: shared.Monetary{ Amount: 245256, - Asset: "azure", + Asset: "string", }, Balances: []string{ - "Tasty", + "string", }, - Destination: shared.CreateSubjectWalletSubject( - shared.WalletSubject{ - Identifier: "Bike", - Type: "impactful", + Destination: shared.CreateSubjectLedgerAccountSubject( + shared.LedgerAccountSubject{ + Identifier: "string", + Type: "string", }, ), Metadata: map[string]interface{}{ - "Hop": "SCSI", + "key": "string", }, }, ID: "", @@ -336,7 +336,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetBalance(ctx, operations.GetBalanceRequest{ - BalanceName: "Kids Franc hmph", + BalanceName: "string", ID: "", }) if err != nil { @@ -386,7 +386,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.GetHold(ctx, operations.GetHoldRequest{ - HoldID: "taper", + HoldID: "string", }) if err != nil { log.Fatal(err) @@ -682,7 +682,7 @@ func main() { res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ RequestBody: &operations.UpdateWalletRequestBody{ Metadata: map[string]interface{}{ - "override": "South", + "key": "string", }, }, ID: "", @@ -734,7 +734,7 @@ func main() { ctx := context.Background() res, err := s.Wallets.VoidHold(ctx, operations.VoidHoldRequest{ - HoldID: "redundant yesterday Hat", + HoldID: "string", }) if err != nil { log.Fatal(err) diff --git a/formance.go b/formance.go index 3ed042c..fb774a3 100755 --- a/formance.go +++ b/formance.go @@ -199,9 +199,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.6.2", - GenVersion: "2.155.1", - UserAgent: "speakeasy-sdk/go 0.6.2 2.155.1 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", + SDKVersion: "0.7.0", + GenVersion: "2.169.0", + UserAgent: "speakeasy-sdk/go 0.7.0 2.169.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { diff --git a/gen.yaml b/gen.yaml index 9d055dc..c18874a 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,9 +2,10 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.99.2 - generationVersion: 2.155.1 + speakeasyVersion: 1.104.0 + generationVersion: 2.169.0 generation: + repoURL: https://github.com/speakeasy-sdks/formance-go-sdk.git sdkClassName: formance sdkFlattening: true singleTagPerOp: false @@ -12,14 +13,17 @@ generation: features: go: constsAndDefaults: 0.1.1 - core: 2.91.5 + core: 2.94.0 deprecations: 2.81.1 globalSecurity: 2.82.2 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 - unions: 2.83.1 + unions: 2.84.0 go: - version: 0.6.2 + version: 0.7.0 flattenGlobalSecurity: true + installationURL: https://github.com/speakeasy-sdks/formance-go-sdk maxMethodParams: 0 packageName: github.com/speakeasy-sdks/formance-go-sdk + published: true + repoSubDirectory: . From fbf4272ce5134befcb549778a3a30892abb91ea7 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 1 Nov 2023 00:41:28 +0000 Subject: [PATCH 7/7] ci: regenerated with OpenAPI Doc v1.0.0-rc.5, Speakeay CLI 1.109.2 --- README.md | 127 +++++++++++++++++++++++++++ RELEASES.md | 12 ++- docs/sdks/accounts/README.md | 2 +- formance.go | 6 +- gen.yaml | 8 +- pkg/models/shared/connectorconfig.go | 24 ++--- pkg/models/shared/taskresponse.go | 24 ++--- pkg/models/shared/taskscursor.go | 24 ++--- 8 files changed, 182 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index bc0221d..df990bb 100755 --- a/README.md +++ b/README.md @@ -216,6 +216,133 @@ Here's an example of one such pagination call: + + + +# Error Handling + +Handling errors in your SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass. + + + + + + + +# Server Selection + +## Select Server by Index + +You can override the default server globally using the `WithServerIndex` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: + +| # | Server | Variables | +| - | ------ | --------- | +| 0 | `http://localhost` | None | +| 1 | `https://{organization}.sandbox.formance.cloud` | `organization` | + + +Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so: + * `WithOrganization string` + +For example: + + +```go +package main + +import ( + "context" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "log" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(""), + formancegosdk.WithServerIndex(1), + ) + + ctx := context.Background() + res, err := s.Formance.GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} + +``` + + +## Override Server URL Per-Client + +The default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example: + + +```go +package main + +import ( + "context" + formancegosdk "github.com/speakeasy-sdks/formance-go-sdk" + "github.com/speakeasy-sdks/formance-go-sdk/pkg/models/shared" + "log" +) + +func main() { + s := formancegosdk.New( + formancegosdk.WithSecurity(""), + formancegosdk.WithServerURL("http://localhost"), + ) + + ctx := context.Background() + res, err := s.Formance.GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ServerInfo != nil { + // handle response + } +} + +``` + + + + + +# Custom HTTP Client + +The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface: + +```go +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} +``` + +The built-in `net/http` client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout. + +```go +import ( + "net/http" + "time" + "github.com/myorg/your-go-sdk" +) + +var ( + httpClient = &http.Client{Timeout: 30 * time.Second} + sdkClient = sdk.New(sdk.WithClient(httpClient)) +) +``` + +This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration. + + diff --git a/RELEASES.md b/RELEASES.md index 2d69169..430a35e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -170,4 +170,14 @@ Based on: ### Generated - [go v0.7.0] . ### Releases -- [Go v0.7.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.7.0 - . \ No newline at end of file +- [Go v0.7.0] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.7.0 - . + +## 2023-11-01 00:41:09 +### Changes +Based on: +- OpenAPI Doc v1.0.0-rc.5 ./stack.yaml +- Speakeasy CLI 1.109.2 (2.173.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.7.1] . +### Releases +- [Go v0.7.1] https://github.com/speakeasy-sdks/formance-go-sdk/releases/tag/v0.7.1 - . \ No newline at end of file diff --git a/docs/sdks/accounts/README.md b/docs/sdks/accounts/README.md index f28c6ce..284d888 100755 --- a/docs/sdks/accounts/README.md +++ b/docs/sdks/accounts/README.md @@ -37,8 +37,8 @@ func main() { ctx := context.Background() res, err := s.Accounts.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ RequestBody: map[string]interface{}{ - "a": "string", "admin": "string", + "a": "string", }, Address: "users:001", Ledger: "ledger001", diff --git a/formance.go b/formance.go index fb774a3..b271372 100755 --- a/formance.go +++ b/formance.go @@ -199,9 +199,9 @@ func New(opts ...SDKOption) *Formance { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "v1.0.0-rc.5", - SDKVersion: "0.7.0", - GenVersion: "2.169.0", - UserAgent: "speakeasy-sdk/go 0.7.0 2.169.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", + SDKVersion: "0.7.1", + GenVersion: "2.173.0", + UserAgent: "speakeasy-sdk/go 0.7.1 2.173.0 v1.0.0-rc.5 github.com/speakeasy-sdks/formance-go-sdk", ServerDefaults: []map[string]string{ {}, { diff --git a/gen.yaml b/gen.yaml index c18874a..9d54b82 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,8 +2,8 @@ configVersion: 1.0.0 management: docChecksum: e2d62c3257abdb44d60905723bd6484e docVersion: v1.0.0-rc.5 - speakeasyVersion: 1.104.0 - generationVersion: 2.169.0 + speakeasyVersion: 1.109.2 + generationVersion: 2.173.0 generation: repoURL: https://github.com/speakeasy-sdks/formance-go-sdk.git sdkClassName: formance @@ -18,9 +18,9 @@ features: globalSecurity: 2.82.2 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 - unions: 2.84.0 + unions: 2.84.1 go: - version: 0.7.0 + version: 0.7.1 flattenGlobalSecurity: true installationURL: https://github.com/speakeasy-sdks/formance-go-sdk maxMethodParams: 0 diff --git a/pkg/models/shared/connectorconfig.go b/pkg/models/shared/connectorconfig.go index df1609f..4ae32fe 100755 --- a/pkg/models/shared/connectorconfig.go +++ b/pkg/models/shared/connectorconfig.go @@ -85,44 +85,44 @@ func CreateConnectorConfigBankingCircleConfig(bankingCircleConfig BankingCircleC func (u *ConnectorConfig) UnmarshalJSON(data []byte) error { - wiseConfig := new(WiseConfig) + wiseConfig := WiseConfig{} if err := utils.UnmarshalJSON(data, &wiseConfig, "", true, true); err == nil { - u.WiseConfig = wiseConfig + u.WiseConfig = &wiseConfig u.Type = ConnectorConfigTypeWiseConfig return nil } - stripeConfig := new(StripeConfig) + stripeConfig := StripeConfig{} if err := utils.UnmarshalJSON(data, &stripeConfig, "", true, true); err == nil { - u.StripeConfig = stripeConfig + u.StripeConfig = &stripeConfig u.Type = ConnectorConfigTypeStripeConfig return nil } - dummyPayConfig := new(DummyPayConfig) + dummyPayConfig := DummyPayConfig{} if err := utils.UnmarshalJSON(data, &dummyPayConfig, "", true, true); err == nil { - u.DummyPayConfig = dummyPayConfig + u.DummyPayConfig = &dummyPayConfig u.Type = ConnectorConfigTypeDummyPayConfig return nil } - modulrConfig := new(ModulrConfig) + modulrConfig := ModulrConfig{} if err := utils.UnmarshalJSON(data, &modulrConfig, "", true, true); err == nil { - u.ModulrConfig = modulrConfig + u.ModulrConfig = &modulrConfig u.Type = ConnectorConfigTypeModulrConfig return nil } - currencyCloudConfig := new(CurrencyCloudConfig) + currencyCloudConfig := CurrencyCloudConfig{} if err := utils.UnmarshalJSON(data, ¤cyCloudConfig, "", true, true); err == nil { - u.CurrencyCloudConfig = currencyCloudConfig + u.CurrencyCloudConfig = ¤cyCloudConfig u.Type = ConnectorConfigTypeCurrencyCloudConfig return nil } - bankingCircleConfig := new(BankingCircleConfig) + bankingCircleConfig := BankingCircleConfig{} if err := utils.UnmarshalJSON(data, &bankingCircleConfig, "", true, true); err == nil { - u.BankingCircleConfig = bankingCircleConfig + u.BankingCircleConfig = &bankingCircleConfig u.Type = ConnectorConfigTypeBankingCircleConfig return nil } diff --git a/pkg/models/shared/taskresponse.go b/pkg/models/shared/taskresponse.go index d8fda9a..d11912e 100755 --- a/pkg/models/shared/taskresponse.go +++ b/pkg/models/shared/taskresponse.go @@ -85,44 +85,44 @@ func CreateTaskResponseDataTaskBankingCircle(taskBankingCircle TaskBankingCircle func (u *TaskResponseData) UnmarshalJSON(data []byte) error { - taskStripe := new(TaskStripe) + taskStripe := TaskStripe{} if err := utils.UnmarshalJSON(data, &taskStripe, "", true, true); err == nil { - u.TaskStripe = taskStripe + u.TaskStripe = &taskStripe u.Type = TaskResponseDataTypeTaskStripe return nil } - taskWise := new(TaskWise) + taskWise := TaskWise{} if err := utils.UnmarshalJSON(data, &taskWise, "", true, true); err == nil { - u.TaskWise = taskWise + u.TaskWise = &taskWise u.Type = TaskResponseDataTypeTaskWise return nil } - taskCurrencyCloud := new(TaskCurrencyCloud) + taskCurrencyCloud := TaskCurrencyCloud{} if err := utils.UnmarshalJSON(data, &taskCurrencyCloud, "", true, true); err == nil { - u.TaskCurrencyCloud = taskCurrencyCloud + u.TaskCurrencyCloud = &taskCurrencyCloud u.Type = TaskResponseDataTypeTaskCurrencyCloud return nil } - taskDummyPay := new(TaskDummyPay) + taskDummyPay := TaskDummyPay{} if err := utils.UnmarshalJSON(data, &taskDummyPay, "", true, true); err == nil { - u.TaskDummyPay = taskDummyPay + u.TaskDummyPay = &taskDummyPay u.Type = TaskResponseDataTypeTaskDummyPay return nil } - taskModulr := new(TaskModulr) + taskModulr := TaskModulr{} if err := utils.UnmarshalJSON(data, &taskModulr, "", true, true); err == nil { - u.TaskModulr = taskModulr + u.TaskModulr = &taskModulr u.Type = TaskResponseDataTypeTaskModulr return nil } - taskBankingCircle := new(TaskBankingCircle) + taskBankingCircle := TaskBankingCircle{} if err := utils.UnmarshalJSON(data, &taskBankingCircle, "", true, true); err == nil { - u.TaskBankingCircle = taskBankingCircle + u.TaskBankingCircle = &taskBankingCircle u.Type = TaskResponseDataTypeTaskBankingCircle return nil } diff --git a/pkg/models/shared/taskscursor.go b/pkg/models/shared/taskscursor.go index 34f725b..ab85946 100755 --- a/pkg/models/shared/taskscursor.go +++ b/pkg/models/shared/taskscursor.go @@ -85,44 +85,44 @@ func CreateTasksCursorCursorDataTaskBankingCircle(taskBankingCircle TaskBankingC func (u *TasksCursorCursorData) UnmarshalJSON(data []byte) error { - taskStripe := new(TaskStripe) + taskStripe := TaskStripe{} if err := utils.UnmarshalJSON(data, &taskStripe, "", true, true); err == nil { - u.TaskStripe = taskStripe + u.TaskStripe = &taskStripe u.Type = TasksCursorCursorDataTypeTaskStripe return nil } - taskWise := new(TaskWise) + taskWise := TaskWise{} if err := utils.UnmarshalJSON(data, &taskWise, "", true, true); err == nil { - u.TaskWise = taskWise + u.TaskWise = &taskWise u.Type = TasksCursorCursorDataTypeTaskWise return nil } - taskCurrencyCloud := new(TaskCurrencyCloud) + taskCurrencyCloud := TaskCurrencyCloud{} if err := utils.UnmarshalJSON(data, &taskCurrencyCloud, "", true, true); err == nil { - u.TaskCurrencyCloud = taskCurrencyCloud + u.TaskCurrencyCloud = &taskCurrencyCloud u.Type = TasksCursorCursorDataTypeTaskCurrencyCloud return nil } - taskDummyPay := new(TaskDummyPay) + taskDummyPay := TaskDummyPay{} if err := utils.UnmarshalJSON(data, &taskDummyPay, "", true, true); err == nil { - u.TaskDummyPay = taskDummyPay + u.TaskDummyPay = &taskDummyPay u.Type = TasksCursorCursorDataTypeTaskDummyPay return nil } - taskModulr := new(TaskModulr) + taskModulr := TaskModulr{} if err := utils.UnmarshalJSON(data, &taskModulr, "", true, true); err == nil { - u.TaskModulr = taskModulr + u.TaskModulr = &taskModulr u.Type = TasksCursorCursorDataTypeTaskModulr return nil } - taskBankingCircle := new(TaskBankingCircle) + taskBankingCircle := TaskBankingCircle{} if err := utils.UnmarshalJSON(data, &taskBankingCircle, "", true, true); err == nil { - u.TaskBankingCircle = taskBankingCircle + u.TaskBankingCircle = &taskBankingCircle u.Type = TasksCursorCursorDataTypeTaskBankingCircle return nil }