From c234a90e7da53c8a12f28f166298a414154353d6 Mon Sep 17 00:00:00 2001 From: NumaryBot Date: Tue, 19 Dec 2023 14:38:31 +0000 Subject: [PATCH] release(sdk): v2.0.0-beta.1 --- .gitattributes | 2 + .github/workflows/speakeasy_sdk_publish.yml | 38 +- .gitignore | 1 + LICENSE | 21 + README.md | 426 ++- USAGE.md | 29 +- auth.go | 608 +---- docs/auth/README.md | 783 ------ docs/flows/README.md | 475 ---- docs/formance/README.md | 54 - docs/ledger/README.md | 984 ------- .../operations/activateconfigrequest.md | 8 + .../operations/activateconfigresponse.md | 12 + .../addmetadataontransactionrequest.md | 10 + .../addmetadataontransactionresponse.md | 11 + .../operations/addmetadatatoaccountrequest.md | 10 + .../addmetadatatoaccountresponse.md | 11 + docs/models/operations/canceleventrequest.md | 8 + docs/models/operations/canceleventresponse.md | 11 + .../operations/changeconfigsecretrequest.md | 9 + .../operations/changeconfigsecretresponse.md | 12 + docs/models/operations/confirmholdrequest.md | 9 + docs/models/operations/confirmholdresponse.md | 11 + .../models/operations/countaccountsrequest.md | 10 + .../operations/countaccountsresponse.md | 12 + .../operations/counttransactionsmetadata.md | 9 + .../operations/counttransactionsrequest.md | 15 + .../operations/counttransactionsresponse.md | 12 + .../models/operations/createbalancerequest.md | 9 + .../operations/createbalanceresponse.md | 12 + .../models/operations/createclientresponse.md | 11 + .../models/operations/createpolicyresponse.md | 12 + 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 + .../operations/createtriggerresponse.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 | 12 + 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 | 11 + docs/models/operations/deletepolicyrequest.md | 8 + .../models/operations/deletepolicyresponse.md | 11 + docs/models/operations/deletesecretrequest.md | 9 + .../models/operations/deletesecretresponse.md | 10 + .../models/operations/deletetriggerrequest.md | 8 + .../operations/deletetriggerresponse.md | 11 + .../operations/deleteworkflowrequest.md | 8 + .../operations/deleteworkflowresponse.md | 11 + docs/models/operations/getaccountrequest.md | 9 + docs/models/operations/getaccountresponse.md | 12 + ...uthwellknownopenidconfigurationresponse.md | 10 + docs/models/operations/getbalancerequest.md | 9 + docs/models/operations/getbalanceresponse.md | 12 + .../getbalancesaggregatedrequest.md | 9 + .../getbalancesaggregatedresponse.md | 12 + docs/models/operations/getbalancesrequest.md | 11 + docs/models/operations/getbalancesresponse.md | 12 + docs/models/operations/getholdrequest.md | 8 + docs/models/operations/getholdresponse.md | 12 + docs/models/operations/getholdsrequest.md | 11 + docs/models/operations/getholdsresponse.md | 12 + docs/models/operations/getinforesponse.md | 12 + .../operations/getinstancehistoryrequest.md | 8 + .../operations/getinstancehistoryresponse.md | 12 + docs/models/operations/getinstancerequest.md | 8 + docs/models/operations/getinstanceresponse.md | 12 + .../getinstancestagehistoryrequest.md | 9 + .../getinstancestagehistoryresponse.md | 12 + .../models/operations/getledgerinforequest.md | 8 + .../operations/getledgerinforesponse.md | 12 + .../operations/getmanyconfigsrequest.md | 9 + .../operations/getmanyconfigsresponse.md | 12 + docs/models/operations/getmappingrequest.md | 8 + docs/models/operations/getmappingresponse.md | 12 + docs/models/operations/getpolicyrequest.md | 8 + docs/models/operations/getpolicyresponse.md | 12 + .../operations/getreconciliationrequest.md | 8 + .../operations/getreconciliationresponse.md | 12 + .../operations/getserverinforesponse.md | 11 + .../operations/gettransactionrequest.md | 9 + .../operations/gettransactionresponse.md | 12 + .../operations/gettransactionsrequest.md | 10 + .../operations/gettransactionsresponse.md | 12 + docs/models/operations/getversionsresponse.md | 11 + docs/models/operations/getwalletrequest.md | 8 + docs/models/operations/getwalletresponse.md | 12 + .../operations/getwalletsummaryrequest.md | 8 + .../operations/getwalletsummaryresponse.md | 12 + docs/models/operations/getworkflowrequest.md | 8 + docs/models/operations/getworkflowresponse.md | 12 + .../models/operations/insertconfigresponse.md | 12 + docs/models/operations/listaccountsrequest.md | 15 + .../models/operations/listaccountsresponse.md | 12 + docs/models/operations/listbalancesrequest.md | 8 + .../models/operations/listbalancesresponse.md | 11 + docs/models/operations/listclientsresponse.md | 11 + .../models/operations/listinstancesrequest.md | 9 + .../operations/listinstancesresponse.md | 12 + docs/models/operations/listlogsrequest.md | 13 + docs/models/operations/listlogsresponse.md | 12 + docs/models/operations/listpoliciesrequest.md | 9 + .../models/operations/listpoliciesresponse.md | 12 + .../operations/listreconciliationsrequest.md | 9 + .../operations/listreconciliationsresponse.md | 12 + .../operations/listtransactionsrequest.md | 18 + .../operations/listtransactionsresponse.md | 12 + .../listtriggersoccurrencesrequest.md | 8 + .../listtriggersoccurrencesresponse.md | 12 + .../models/operations/listtriggersresponse.md | 12 + docs/models/operations/listusersresponse.md | 11 + docs/models/operations/listwalletsrequest.md | 11 + docs/models/operations/listwalletsresponse.md | 11 + .../operations/listworkflowsresponse.md | 12 + .../orchestrationgetserverinforesponse.md | 12 + docs/models/operations/readclientrequest.md | 8 + docs/models/operations/readclientresponse.md | 11 + docs/models/operations/readstatsrequest.md | 8 + docs/models/operations/readstatsresponse.md | 12 + docs/models/operations/readtriggerrequest.md | 8 + docs/models/operations/readtriggerresponse.md | 12 + docs/models/operations/readuserrequest.md | 8 + docs/models/operations/readuserresponse.md | 11 + docs/models/operations/reconcilerequest.md | 9 + docs/models/operations/reconcileresponse.md | 12 + .../reconciliationgetserverinforesponse.md | 12 + .../operations/reverttransactionrequest.md | 10 + .../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/sendeventrequest.md | 9 + .../models/operations/sendeventrequestbody.md | 8 + docs/models/operations/sendeventresponse.md | 11 + docs/models/operations/testconfigrequest.md | 8 + docs/models/operations/testconfigresponse.md | 12 + docs/models/operations/updateclientrequest.md | 9 + .../models/operations/updateclientresponse.md | 11 + .../models/operations/updatemappingrequest.md | 9 + .../operations/updatemappingresponse.md | 12 + docs/models/operations/updatewalletrequest.md | 9 + .../operations/updatewalletrequestbody.md | 8 + .../models/operations/updatewalletresponse.md | 11 + .../v2addmetadataontransactionrequest.md | 12 + .../v2addmetadataontransactionresponse.md | 11 + .../v2addmetadatatoaccountrequest.md | 12 + .../v2addmetadatatoaccountresponse.md | 11 + .../models/operations/v2canceleventrequest.md | 8 + .../operations/v2canceleventresponse.md | 11 + .../operations/v2countaccountsrequest.md | 10 + .../operations/v2countaccountsresponse.md | 12 + .../operations/v2counttransactionsrequest.md | 10 + .../operations/v2counttransactionsresponse.md | 12 + docs/models/operations/v2createbulkrequest.md | 9 + .../models/operations/v2createbulkresponse.md | 12 + .../operations/v2createledgerrequest.md | 9 + .../operations/v2createledgerresponse.md | 11 + .../operations/v2createtransactionrequest.md | 11 + .../operations/v2createtransactionresponse.md | 12 + .../operations/v2createtriggerresponse.md | 12 + .../operations/v2createworkflowresponse.md | 12 + .../v2deleteaccountmetadatarequest.md | 10 + .../v2deleteaccountmetadataresponse.md | 10 + .../v2deletetransactionmetadatarequest.md | 10 + .../v2deletetransactionmetadataresponse.md | 11 + .../operations/v2deletetriggerrequest.md | 8 + .../operations/v2deletetriggerresponse.md | 11 + .../operations/v2deleteworkflowrequest.md | 8 + .../operations/v2deleteworkflowresponse.md | 11 + docs/models/operations/v2getaccountrequest.md | 11 + .../models/operations/v2getaccountresponse.md | 12 + .../v2getbalancesaggregatedrequest.md | 10 + .../v2getbalancesaggregatedresponse.md | 12 + docs/models/operations/v2getinforesponse.md | 12 + .../operations/v2getinstancehistoryrequest.md | 8 + .../v2getinstancehistoryresponse.md | 12 + .../models/operations/v2getinstancerequest.md | 8 + .../operations/v2getinstanceresponse.md | 12 + .../v2getinstancestagehistoryrequest.md | 9 + .../v2getinstancestagehistoryresponse.md | 12 + .../operations/v2getledgerinforequest.md | 8 + .../operations/v2getledgerinforesponse.md | 12 + docs/models/operations/v2getledgerrequest.md | 8 + docs/models/operations/v2getledgerresponse.md | 12 + .../operations/v2getserverinforesponse.md | 12 + .../operations/v2gettransactionrequest.md | 11 + .../operations/v2gettransactionresponse.md | 12 + .../models/operations/v2getworkflowrequest.md | 8 + .../operations/v2getworkflowresponse.md | 12 + .../operations/v2listaccountsrequest.md | 13 + .../operations/v2listaccountsresponse.md | 12 + .../operations/v2listinstancesrequest.md | 9 + .../operations/v2listinstancesresponse.md | 12 + .../models/operations/v2listledgersrequest.md | 9 + .../operations/v2listledgersresponse.md | 12 + docs/models/operations/v2listlogsrequest.md | 12 + docs/models/operations/v2listlogsresponse.md | 12 + .../operations/v2listtransactionsrequest.md | 13 + .../operations/v2listtransactionsresponse.md | 12 + .../v2listtriggersoccurrencesrequest.md | 8 + .../v2listtriggersoccurrencesresponse.md | 12 + .../operations/v2listtriggersresponse.md | 12 + .../operations/v2listworkflowsresponse.md | 12 + docs/models/operations/v2readstatsrequest.md | 8 + docs/models/operations/v2readstatsresponse.md | 12 + .../models/operations/v2readtriggerrequest.md | 8 + .../operations/v2readtriggerresponse.md | 12 + .../operations/v2reverttransactionrequest.md | 10 + .../operations/v2reverttransactionresponse.md | 12 + .../models/operations/v2runworkflowrequest.md | 10 + .../operations/v2runworkflowresponse.md | 12 + docs/models/operations/v2sendeventrequest.md | 9 + .../operations/v2sendeventrequestbody.md | 8 + docs/models/operations/v2sendeventresponse.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/accountresponse.md | 8 + docs/models/shared/accountscursorresponse.md | 8 + .../shared/accountscursorresponsecursor.md | 12 + .../shared/accountwithvolumesandbalances.md | 12 + docs/models/shared/activityconfirmhold.md | 8 + .../shared/activitycreatetransaction.md | 9 + .../shared/activitycreatetransactionoutput.md | 8 + docs/models/shared/activitycreditwallet.md | 9 + docs/models/shared/activitydebitwallet.md | 9 + .../shared/activitydebitwalletoutput.md | 8 + docs/models/shared/activitygetaccount.md | 9 + .../models/shared/activitygetaccountoutput.md | 8 + docs/models/shared/activitygetpayment.md | 8 + .../models/shared/activitygetpaymentoutput.md | 8 + docs/models/shared/activitygetwallet.md | 8 + docs/models/shared/activitygetwalletoutput.md | 8 + docs/models/shared/activitystripetransfer.md | 13 + .../shared/activitystripetransfermetadata.md | 11 + docs/models/shared/activityvoidhold.md | 8 + .../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 | 10 + docs/models/shared/balancescursorresponse.md | 8 + .../shared/balancescursorresponsecursor.md | 12 + docs/models/shared/balancewithassets.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 | 9 + docs/models/shared/configuser.md | 10 + docs/models/shared/confirmholdrequest.md | 9 + docs/models/shared/connector.md | 15 + docs/models/shared/contract.md | 9 + docs/models/shared/contractexpr.md | 7 + docs/models/shared/createbalancerequest.md | 10 + docs/models/shared/createbalanceresponse.md | 8 + docs/models/shared/createclientrequest.md | 15 + docs/models/shared/createclientresponse.md | 8 + docs/models/shared/createsecretrequest.md | 9 + docs/models/shared/createsecretresponse.md | 8 + docs/models/shared/createtriggerresponse.md | 8 + docs/models/shared/createwalletrequest.md | 9 + docs/models/shared/createwalletresponse.md | 8 + docs/models/shared/createworkflowrequest.md | 9 + docs/models/shared/createworkflowresponse.md | 8 + docs/models/shared/creditwalletrequest.md | 12 + docs/models/shared/debitwalletrequest.md | 13 + docs/models/shared/debitwalletresponse.md | 8 + docs/models/shared/error.md | 9 + docs/models/shared/errorerrorcode.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/getversionsresponse.md | 10 + docs/models/shared/getwalletresponse.md | 8 + .../models/shared/getwalletsummaryresponse.md | 12 + .../getworkflowinstancehistoryresponse.md | 8 + ...getworkflowinstancehistorystageresponse.md | 8 + .../shared/getworkflowinstanceresponse.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 + .../shared/listtriggersoccurrencesresponse.md | 8 + docs/models/shared/listtriggersresponse.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/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/monetary.md | 9 + docs/models/shared/orchestrationaccount.md | 11 + .../shared/orchestrationposttransaction.md | 12 + .../orchestrationposttransactionscript.md | 9 + .../models/shared/orchestrationtransaction.md | 12 + .../shared/orchestrationv2transaction.md | 12 + docs/models/shared/payment.md | 22 + docs/models/shared/paymentadjustment.md | 12 + docs/models/shared/paymentadjustmentraw.md | 7 + docs/models/shared/paymentmetadata.md | 8 + docs/models/shared/paymentraw.md | 7 + docs/models/shared/paymentscheme.md | 25 + docs/models/shared/paymentstatus.md | 13 + docs/models/shared/paymenttype.md | 11 + docs/models/shared/policiescursorresponse.md | 8 + .../shared/policiescursorresponsecursor.md | 12 + docs/models/shared/policy.md | 13 + docs/models/shared/policyrequest.md | 11 + docs/models/shared/policyresponse.md | 8 + docs/models/shared/posting.md | 11 + docs/models/shared/posttransaction.md | 12 + docs/models/shared/posttransactionscript.md | 9 + docs/models/shared/query.md | 16 + docs/models/shared/queryraw.md | 7 + docs/models/shared/readclientresponse.md | 8 + docs/models/shared/readtriggerresponse.md | 8 + docs/models/shared/readuserresponse.md | 8 + docs/models/shared/reconciliation.md | 17 + .../shared/reconciliationerrorresponse.md | 10 + docs/models/shared/reconciliationrequest.md | 9 + docs/models/shared/reconciliationresponse.md | 8 + .../shared/reconciliationscursorresponse.md | 8 + .../reconciliationscursorresponsecursor.md | 12 + docs/models/shared/response.md | 9 + docs/models/shared/responsecursor.md | 13 + docs/models/shared/responsecursortotal.md | 9 + docs/models/shared/runworkflowresponse.md | 8 + docs/models/shared/script.md | 11 + docs/models/shared/scriptresponse.md | 11 + docs/models/shared/secret.md | 12 + docs/models/shared/serverinfo.md | 8 + docs/models/shared/stage.md | 23 + docs/models/shared/stagedelay.md | 9 + docs/models/shared/stagesend.md | 10 + docs/models/shared/stagesenddestination.md | 10 + .../shared/stagesenddestinationaccount.md | 9 + .../shared/stagesenddestinationpayment.md | 8 + .../shared/stagesenddestinationwallet.md | 9 + docs/models/shared/stagesendsource.md | 10 + docs/models/shared/stagesendsourceaccount.md | 9 + docs/models/shared/stagesendsourcepayment.md | 8 + docs/models/shared/stagesendsourcewallet.md | 9 + docs/models/shared/stagestatus.md | 12 + docs/models/shared/stagewaitevent.md | 8 + docs/models/shared/stats.md | 9 + docs/models/shared/statsresponse.md | 8 + docs/models/shared/subject.md | 17 + 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/trigger.md | 13 + docs/models/shared/triggerdata.md | 11 + docs/models/shared/triggeroccurrence.md | 11 + docs/models/shared/updateclientrequest.md | 15 + docs/models/shared/updateclientresponse.md | 8 + docs/models/shared/user.md | 10 + docs/models/shared/v2account.md | 11 + docs/models/shared/v2accountresponse.md | 8 + .../models/shared/v2accountscursorresponse.md | 8 + .../shared/v2accountscursorresponsecursor.md | 12 + docs/models/shared/v2activityconfirmhold.md | 8 + .../shared/v2activitycreatetransaction.md | 9 + .../v2activitycreatetransactionoutput.md | 8 + docs/models/shared/v2activitycreditwallet.md | 9 + docs/models/shared/v2activitydebitwallet.md | 9 + .../shared/v2activitydebitwalletoutput.md | 8 + docs/models/shared/v2activitygetaccount.md | 9 + .../shared/v2activitygetaccountoutput.md | 8 + docs/models/shared/v2activitygetpayment.md | 8 + .../shared/v2activitygetpaymentoutput.md | 8 + docs/models/shared/v2activitygetwallet.md | 8 + .../shared/v2activitygetwalletoutput.md | 8 + .../models/shared/v2activitystripetransfer.md | 13 + .../v2activitystripetransfermetadata.md | 11 + docs/models/shared/v2activityvoidhold.md | 8 + .../shared/v2aggregatebalancesresponse.md | 8 + docs/models/shared/v2assetholder.md | 8 + docs/models/shared/v2bulkelement.md | 29 + docs/models/shared/v2bulkelementresult.md | 35 + ...entresultv2bulkelementresultaddmetadata.md | 8 + ...ultv2bulkelementresultcreatetransaction.md | 9 + ...resultv2bulkelementresultdeletemetadata.md | 8 + ...lkelementresultv2bulkelementresulterror.md | 11 + ...ultv2bulkelementresultreverttransaction.md | 9 + .../v2bulkelementv2bulkelementaddmetadata.md | 10 + ...bulkelementv2bulkelementaddmetadatadata.md | 10 + ...lkelementv2bulkelementcreatetransaction.md | 10 + ...2bulkelementv2bulkelementdeletemetadata.md | 10 + ...kelementv2bulkelementdeletemetadatadata.md | 10 + ...lkelementv2bulkelementreverttransaction.md | 10 + ...ementv2bulkelementreverttransactiondata.md | 9 + docs/models/shared/v2bulkresponse.md | 8 + docs/models/shared/v2configinforesponse.md | 9 + docs/models/shared/v2connector.md | 15 + docs/models/shared/v2createledgerrequest.md | 8 + .../shared/v2createtransactionresponse.md | 8 + docs/models/shared/v2createtriggerresponse.md | 8 + docs/models/shared/v2createworkflowrequest.md | 9 + .../models/shared/v2createworkflowresponse.md | 8 + docs/models/shared/v2creditwalletrequest.md | 12 + docs/models/shared/v2debitwalletrequest.md | 13 + docs/models/shared/v2error.md | 9 + docs/models/shared/v2errorerrorcode.md | 9 + docs/models/shared/v2errorresponse.md | 10 + docs/models/shared/v2errorsenum.md | 17 + docs/models/shared/v2expandedtransaction.md | 15 + .../models/shared/v2gettransactionresponse.md | 8 + .../v2getworkflowinstancehistoryresponse.md | 8 + ...getworkflowinstancehistorystageresponse.md | 8 + .../shared/v2getworkflowinstanceresponse.md | 8 + docs/models/shared/v2getworkflowresponse.md | 8 + docs/models/shared/v2hold.md | 12 + docs/models/shared/v2ledger.md | 10 + docs/models/shared/v2ledgeraccountsubject.md | 9 + docs/models/shared/v2ledgerinfo.md | 9 + docs/models/shared/v2ledgerinforesponse.md | 8 + docs/models/shared/v2ledgerinfostorage.md | 8 + docs/models/shared/v2ledgerlistresponse.md | 8 + .../shared/v2ledgerlistresponsecursor.md | 12 + docs/models/shared/v2listrunsresponse.md | 8 + .../models/shared/v2listrunsresponsecursor.md | 12 + .../v2listtriggersoccurrencesresponse.md | 8 + ...v2listtriggersoccurrencesresponsecursor.md | 12 + docs/models/shared/v2listtriggersresponse.md | 8 + .../shared/v2listtriggersresponsecursor.md | 12 + docs/models/shared/v2listworkflowsresponse.md | 8 + .../shared/v2listworkflowsresponsecursor.md | 12 + docs/models/shared/v2log.md | 12 + docs/models/shared/v2logscursorresponse.md | 8 + .../shared/v2logscursorresponsecursor.md | 12 + docs/models/shared/v2logtype.md | 10 + docs/models/shared/v2migrationinfo.md | 11 + docs/models/shared/v2migrationinfostate.md | 9 + docs/models/shared/v2monetary.md | 9 + docs/models/shared/v2payment.md | 22 + docs/models/shared/v2paymentadjustment.md | 12 + docs/models/shared/v2paymentadjustmentraw.md | 7 + docs/models/shared/v2paymentmetadata.md | 8 + docs/models/shared/v2paymentraw.md | 7 + docs/models/shared/v2paymentscheme.md | 25 + docs/models/shared/v2paymentstatus.md | 13 + docs/models/shared/v2paymenttype.md | 11 + docs/models/shared/v2posting.md | 11 + docs/models/shared/v2posttransaction.md | 12 + docs/models/shared/v2posttransactionscript.md | 9 + docs/models/shared/v2readtriggerresponse.md | 8 + .../shared/v2reverttransactionresponse.md | 8 + docs/models/shared/v2runworkflowresponse.md | 8 + docs/models/shared/v2serverinfo.md | 8 + docs/models/shared/v2stage.md | 23 + docs/models/shared/v2stagedelay.md | 9 + docs/models/shared/v2stagesend.md | 10 + docs/models/shared/v2stagesenddestination.md | 10 + .../shared/v2stagesenddestinationaccount.md | 9 + .../shared/v2stagesenddestinationpayment.md | 8 + .../shared/v2stagesenddestinationwallet.md | 9 + docs/models/shared/v2stagesendsource.md | 10 + .../models/shared/v2stagesendsourceaccount.md | 9 + .../models/shared/v2stagesendsourcepayment.md | 8 + docs/models/shared/v2stagesendsourcewallet.md | 9 + docs/models/shared/v2stagestatus.md | 12 + docs/models/shared/v2stagewaitevent.md | 8 + docs/models/shared/v2stats.md | 9 + docs/models/shared/v2statsresponse.md | 8 + docs/models/shared/v2subject.md | 17 + docs/models/shared/v2targetid.md | 17 + docs/models/shared/v2targettype.md | 9 + docs/models/shared/v2transaction.md | 13 + .../shared/v2transactionscursorresponse.md | 8 + .../v2transactionscursorresponsecursor.md | 12 + docs/models/shared/v2trigger.md | 13 + docs/models/shared/v2triggerdata.md | 11 + docs/models/shared/v2triggeroccurrence.md | 11 + docs/models/shared/v2volume.md | 10 + docs/models/shared/v2walletsubject.md | 10 + docs/models/shared/v2walletwithbalances.md | 13 + .../shared/v2walletwithbalancesbalances.md | 8 + docs/models/shared/v2workflow.md | 11 + docs/models/shared/v2workflowconfig.md | 9 + docs/models/shared/v2workflowinstance.md | 15 + .../shared/v2workflowinstancehistory.md | 13 + .../shared/v2workflowinstancehistorystage.md | 17 + .../v2workflowinstancehistorystageinput.md | 16 + .../v2workflowinstancehistorystageoutput.md | 12 + docs/models/shared/version.md | 10 + docs/models/shared/volume.md | 10 + docs/models/shared/wallet.md | 12 + docs/models/shared/walletserrorresponse.md | 9 + .../shared/walletserrorresponseerrorcode.md | 11 + docs/models/shared/walletstransaction.md | 15 + 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/webhookserrorresponse.md | 10 + docs/models/shared/webhookserrorsenum.md | 10 + docs/models/shared/workflow.md | 11 + docs/models/shared/workflowconfig.md | 9 + docs/models/shared/workflowinstance.md | 15 + docs/models/shared/workflowinstancehistory.md | 13 + .../shared/workflowinstancehistorystage.md | 17 + .../workflowinstancehistorystageinput.md | 16 + .../workflowinstancehistorystageoutput.md | 12 + docs/payments/README.md | 647 ----- docs/sdks/auth/README.md | 499 ++++ docs/sdks/formance/README.md | 104 + docs/sdks/ledger/README.md | 2145 +++++++++++++++ docs/sdks/orchestration/README.md | 1605 +++++++++++ docs/sdks/reconciliation/README.md | 386 +++ docs/sdks/search/README.md | 148 ++ docs/sdks/wallets/README.md | 815 ++++++ docs/sdks/webhooks/README.md | 357 +++ docs/search/README.md | 105 - docs/wallets/README.md | 680 ----- docs/webhooks/README.md | 292 -- files.gen | 888 ++++++- flows.go | 742 ------ formance.go | 245 +- gen.yaml | 12 +- go.mod | 3 + go.sum | 6 + ledger.go | 2164 +++++++++++++-- orchestration.go | 2358 +++++++++++++++++ payments.go | 827 ------ pkg/models/operations/activateconfig.go | 51 +- .../operations/addmetadataontransaction.go | 71 +- pkg/models/operations/addmetadatatoaccount.go | 56 +- pkg/models/operations/addscopetoclient.go | 20 - pkg/models/operations/addtransientscope.go | 20 - pkg/models/operations/cancelevent.go | 42 +- pkg/models/operations/changeconfigsecret.go | 58 +- pkg/models/operations/confirmhold.go | 47 +- .../operations/connectorsstripetransfer.go | 15 - pkg/models/operations/connectorstransfer.go | 22 - pkg/models/operations/countaccounts.go | 63 +- pkg/models/operations/counttransactions.go | 116 +- pkg/models/operations/createbalance.go | 56 +- pkg/models/operations/createclient.go | 35 +- pkg/models/operations/createpolicy.go | 56 + pkg/models/operations/createscope.go | 16 - pkg/models/operations/createsecret.go | 49 +- pkg/models/operations/createtransaction.go | 63 +- pkg/models/operations/createtransactions.go | 56 +- pkg/models/operations/createtrigger.go | 56 + pkg/models/operations/createwallet.go | 42 +- pkg/models/operations/createworkflow.go | 42 +- pkg/models/operations/creditwallet.go | 47 +- pkg/models/operations/deactivateconfig.go | 51 +- pkg/models/operations/debitwallet.go | 56 +- pkg/models/operations/deleteclient.go | 33 +- pkg/models/operations/deleteconfig.go | 40 +- pkg/models/operations/deletepolicy.go | 59 + pkg/models/operations/deletescope.go | 18 - .../operations/deletescopefromclient.go | 20 - pkg/models/operations/deletesecret.go | 40 +- pkg/models/operations/deletetransientscope.go | 20 - pkg/models/operations/deletetrigger.go | 59 + pkg/models/operations/deleteworkflow.go | 42 +- pkg/models/operations/getaccount.go | 58 +- .../getapiauthwellknownopenidconfiguration.go | 37 + pkg/models/operations/getbalance.go | 56 +- pkg/models/operations/getbalances.go | 79 +- .../operations/getbalancesaggregated.go | 58 +- pkg/models/operations/getconnectortask.go | 23 - pkg/models/operations/gethold.go | 49 +- pkg/models/operations/getholds.go | 84 +- pkg/models/operations/getinfo.go | 44 +- pkg/models/operations/getinstance.go | 49 +- pkg/models/operations/getinstancehistory.go | 49 +- .../operations/getinstancestagehistory.go | 56 +- pkg/models/operations/getledgerinfo.go | 49 +- pkg/models/operations/getmanyconfigs.go | 58 +- pkg/models/operations/getmapping.go | 49 +- pkg/models/operations/getpayment.go | 21 - pkg/models/operations/getpolicy.go | 68 + pkg/models/operations/getreconciliation.go | 68 + pkg/models/operations/getserverinfo.go | 35 +- pkg/models/operations/gettransaction.go | 71 +- pkg/models/operations/gettransactions.go | 77 +- pkg/models/operations/getversions.go | 35 +- pkg/models/operations/getwallet.go | 49 +- pkg/models/operations/getwalletsummary.go | 49 +- pkg/models/operations/getworkflow.go | 49 +- pkg/models/operations/insertconfig.go | 44 +- pkg/models/operations/installconnector.go | 20 - pkg/models/operations/listaccounts.go | 164 +- pkg/models/operations/listallconnectors.go | 16 - pkg/models/operations/listbalances.go | 42 +- pkg/models/operations/listclients.go | 35 +- .../listconfigsavailableconnectors.go | 16 - .../operations/listconnectorstransfers.go | 21 - pkg/models/operations/listconnectortasks.go | 30 - pkg/models/operations/listinstances.go | 56 +- pkg/models/operations/listlogs.go | 107 +- pkg/models/operations/listpayments.go | 30 - pkg/models/operations/listpolicies.go | 82 + pkg/models/operations/listreconciliations.go | 82 + pkg/models/operations/listscopes.go | 16 - pkg/models/operations/listtransactions.go | 142 +- pkg/models/operations/listtriggers.go | 56 + .../operations/listtriggersoccurrences.go | 68 + pkg/models/operations/listusers.go | 35 +- pkg/models/operations/listwallets.go | 77 +- pkg/models/operations/listworkflows.go | 42 +- .../operations/orchestrationgetserverinfo.go | 42 +- .../operations/paymentsgetserverinfo.go | 16 - pkg/models/operations/paymentslistaccounts.go | 30 - pkg/models/operations/readclient.go | 42 +- pkg/models/operations/readconnectorconfig.go | 21 - pkg/models/operations/readscope.go | 21 - pkg/models/operations/readstats.go | 49 +- pkg/models/operations/readtrigger.go | 68 + pkg/models/operations/readuser.go | 42 +- pkg/models/operations/reconcile.go | 76 + .../operations/reconciliationgetserverinfo.go | 56 + pkg/models/operations/resetconnector.go | 19 - pkg/models/operations/reverttransaction.go | 78 +- pkg/models/operations/runscript.go | 56 +- pkg/models/operations/runworkflow.go | 63 +- pkg/models/operations/search.go | 35 +- pkg/models/operations/searchgetserverinfo.go | 35 +- pkg/models/operations/sendevent.go | 56 +- pkg/models/operations/testconfig.go | 51 +- pkg/models/operations/uninstallconnector.go | 19 - pkg/models/operations/updateclient.go | 47 +- pkg/models/operations/updatemapping.go | 58 +- pkg/models/operations/updatemetadata.go | 20 - pkg/models/operations/updatescope.go | 22 - pkg/models/operations/updatewallet.go | 54 +- .../operations/v2addmetadataontransaction.go | 108 + .../operations/v2addmetadatatoaccount.go | 99 + pkg/models/operations/v2cancelevent.go | 59 + pkg/models/operations/v2countaccounts.go | 96 + pkg/models/operations/v2counttransactions.go | 96 + pkg/models/operations/v2createbulk.go | 76 + pkg/models/operations/v2createledger.go | 67 + pkg/models/operations/v2createtransaction.go | 98 + pkg/models/operations/v2createtrigger.go | 56 + pkg/models/operations/v2createworkflow.go | 56 + .../operations/v2deleteaccountmetadata.go | 67 + .../operations/v2deletetransactionmetadata.go | 90 + pkg/models/operations/v2deletetrigger.go | 59 + pkg/models/operations/v2deleteworkflow.go | 59 + pkg/models/operations/v2getaccount.go | 110 + .../operations/v2getbalancesaggregated.go | 97 + pkg/models/operations/v2getinfo.go | 56 + pkg/models/operations/v2getinstance.go | 68 + pkg/models/operations/v2getinstancehistory.go | 68 + .../operations/v2getinstancestagehistory.go | 77 + pkg/models/operations/v2getledger.go | 68 + pkg/models/operations/v2getledgerinfo.go | 68 + pkg/models/operations/v2getserverinfo.go | 56 + pkg/models/operations/v2gettransaction.go | 107 + pkg/models/operations/v2getworkflow.go | 68 + pkg/models/operations/v2listaccounts.go | 128 + pkg/models/operations/v2listinstances.go | 77 + pkg/models/operations/v2listledgers.go | 82 + pkg/models/operations/v2listlogs.go | 120 + pkg/models/operations/v2listtransactions.go | 128 + pkg/models/operations/v2listtriggers.go | 56 + .../operations/v2listtriggersoccurrences.go | 68 + pkg/models/operations/v2listworkflows.go | 56 + pkg/models/operations/v2readstats.go | 68 + pkg/models/operations/v2readtrigger.go | 68 + pkg/models/operations/v2reverttransaction.go | 99 + pkg/models/operations/v2runworkflow.go | 85 + pkg/models/operations/v2sendevent.go | 78 + pkg/models/operations/voidhold.go | 40 +- pkg/models/operations/walletsgetserverinfo.go | 42 +- pkg/models/sdkerrors/sdkerror.go | 35 + pkg/models/shared/account.go | 21 + pkg/models/shared/accountresponse.go | 8 +- pkg/models/shared/accountscursor.go | 16 - pkg/models/shared/accountscursorresponse.go | 43 +- .../shared/accountwithvolumesandbalances.go | 57 +- pkg/models/shared/activityconfirmhold.go | 7 + .../shared/activitycreatetransaction.go | 18 +- .../shared/activitycreatetransactionoutput.go | 9 +- pkg/models/shared/activitycreditwallet.go | 14 + pkg/models/shared/activitydebitwallet.go | 14 + .../shared/activitydebitwalletoutput.go | 7 + pkg/models/shared/activitygetaccount.go | 14 + pkg/models/shared/activitygetaccountoutput.go | 9 +- pkg/models/shared/activitygetpayment.go | 7 + pkg/models/shared/activitygetpaymentoutput.go | 7 + pkg/models/shared/activitygetwallet.go | 7 + pkg/models/shared/activitygetwalletoutput.go | 7 + .../shared/activityreverttransaction.go | 8 - .../shared/activityreverttransactionoutput.go | 7 - pkg/models/shared/activitystripetransfer.go | 73 +- pkg/models/shared/activityvoidhold.go | 7 + .../shared/aggregatebalancesresponse.go | 14 +- pkg/models/shared/assetholder.go | 19 + pkg/models/shared/attempt.go | 82 + pkg/models/shared/attemptresponse.go | 8 +- pkg/models/shared/balance.go | 33 + pkg/models/shared/balancescursorresponse.go | 57 +- pkg/models/shared/balancewithassets.go | 40 + pkg/models/shared/bankingcircleconfig.go | 15 - pkg/models/shared/client.go | 70 + pkg/models/shared/clientsecret.go | 28 + pkg/models/shared/config.go | 7 + pkg/models/shared/configchangesecret.go | 7 + pkg/models/shared/configinfo.go | 21 + pkg/models/shared/configinforesponse.go | 8 +- pkg/models/shared/configresponse.go | 8 +- pkg/models/shared/configsresponse.go | 22 +- pkg/models/shared/configuser.go | 21 + pkg/models/shared/confirmholdrequest.go | 26 + pkg/models/shared/connector.go | 1 - pkg/models/shared/connectorconfigresponse.go | 8 - .../shared/connectorsconfigsresponse.go | 21 - pkg/models/shared/connectorsresponse.go | 13 - pkg/models/shared/contract.go | 21 +- pkg/models/shared/createbalancerequest.go | 33 + pkg/models/shared/createbalanceresponse.go | 8 +- pkg/models/shared/createclientrequest.go | 57 + pkg/models/shared/createclientresponse.go | 8 +- pkg/models/shared/createscoperequest.go | 8 - pkg/models/shared/createscoperesponse.go | 8 - pkg/models/shared/createsecretrequest.go | 14 + pkg/models/shared/createsecretresponse.go | 8 +- pkg/models/shared/createtriggerresponse.go | 14 + pkg/models/shared/createwalletrequest.go | 14 + pkg/models/shared/createwalletresponse.go | 8 +- pkg/models/shared/createworkflowrequest.go | 14 + pkg/models/shared/createworkflowresponse.go | 8 +- pkg/models/shared/creditwalletrequest.go | 35 + pkg/models/shared/currencycloudconfig.go | 13 - pkg/models/shared/debitwalletrequest.go | 56 + pkg/models/shared/debitwalletresponse.go | 8 +- pkg/models/shared/dummypayconfig.go | 11 - pkg/models/shared/error.go | 15 +- pkg/models/shared/errorresponse.go | 28 +- pkg/models/shared/expandeddebithold.go | 75 + pkg/models/shared/getbalanceresponse.go | 8 +- pkg/models/shared/getholdresponse.go | 8 +- pkg/models/shared/getholdsresponse.go | 43 +- pkg/models/shared/gettransactionsresponse.go | 43 +- pkg/models/shared/getversionsresponse.go | 22 +- pkg/models/shared/getwalletresponse.go | 8 +- pkg/models/shared/getwalletsummaryresponse.go | 48 +- .../getworkflowinstancehistoryresponse.go | 8 +- ...getworkflowinstancehistorystageresponse.go | 8 +- .../shared/getworkflowinstanceresponse.go | 8 +- pkg/models/shared/getworkflowresponse.go | 8 +- pkg/models/shared/hold.go | 49 + pkg/models/shared/ledgeraccountsubject.go | 14 + pkg/models/shared/ledgerinfo.go | 21 + pkg/models/shared/ledgerinforesponse.go | 8 +- pkg/models/shared/ledgerstorage.go | 14 + pkg/models/shared/listbalancesresponse.go | 43 +- pkg/models/shared/listclientsresponse.go | 8 +- pkg/models/shared/listrunsresponse.go | 8 +- pkg/models/shared/listscopesresponse.go | 8 - .../shared/listtriggersoccurrencesresponse.go | 14 + pkg/models/shared/listtriggersresponse.go | 14 + pkg/models/shared/listusersresponse.go | 8 +- pkg/models/shared/listwalletsresponse.go | 43 +- pkg/models/shared/listworkflowsresponse.go | 8 +- pkg/models/shared/log.go | 47 + pkg/models/shared/logscursorresponse.go | 43 +- pkg/models/shared/mangopayconfig.go | 12 - pkg/models/shared/mapping.go | 7 + pkg/models/shared/mappingresponse.go | 8 +- pkg/models/shared/migrationinfo.go | 40 + pkg/models/shared/modulrconfig.go | 12 - pkg/models/shared/monetary.go | 26 + pkg/models/shared/moneycorpconfig.go | 12 - pkg/models/shared/orchestrationaccount.go | 38 + .../shared/orchestrationposttransaction.go | 81 + pkg/models/shared/orchestrationtransaction.go | 63 + .../shared/orchestrationv2transaction.go | 63 + pkg/models/shared/payment.go | 149 +- pkg/models/shared/paymentadjustment.go | 61 +- pkg/models/shared/paymentmetadata.go | 7 + pkg/models/shared/paymentresponse.go | 8 - pkg/models/shared/paymentsaccount.go | 44 - pkg/models/shared/paymentscursor.go | 16 - pkg/models/shared/policiescursorresponse.go | 57 + pkg/models/shared/policy.go | 70 + pkg/models/shared/policyrequest.go | 38 + pkg/models/shared/policyresponse.go | 14 + pkg/models/shared/posting.go | 40 + pkg/models/shared/posttransaction.go | 64 +- pkg/models/shared/query.go | 84 +- pkg/models/shared/readclientresponse.go | 8 +- pkg/models/shared/readscoperesponse.go | 8 - pkg/models/shared/readtriggerresponse.go | 14 + pkg/models/shared/readuserresponse.go | 8 +- pkg/models/shared/reconciliation.go | 103 + .../shared/reconciliationerrorresponse.go | 30 + pkg/models/shared/reconciliationrequest.go | 38 + pkg/models/shared/reconciliationresponse.go | 14 + .../shared/reconciliationscursorresponse.go | 57 + pkg/models/shared/response.go | 71 +- pkg/models/shared/runworkflowresponse.go | 8 +- pkg/models/shared/scope.go | 10 - pkg/models/shared/script.go | 28 + pkg/models/shared/scriptresponse.go | 34 +- pkg/models/shared/secret.go | 35 + pkg/models/shared/security.go | 7 - pkg/models/shared/serverinfo.go | 8 +- pkg/models/shared/stage.go | 93 + pkg/models/shared/stagedelay.go | 26 + pkg/models/shared/stagesend.go | 21 + pkg/models/shared/stagesenddestination.go | 21 + .../shared/stagesenddestinationaccount.go | 14 + .../shared/stagesenddestinationpayment.go | 7 + .../shared/stagesenddestinationwallet.go | 14 + pkg/models/shared/stagesendsource.go | 21 + pkg/models/shared/stagesendsourceaccount.go | 14 + pkg/models/shared/stagesendsourcepayment.go | 7 + pkg/models/shared/stagesendsourcewallet.go | 14 + pkg/models/shared/stagestatus.go | 47 + pkg/models/shared/stagewaitevent.go | 7 + pkg/models/shared/stats.go | 14 + pkg/models/shared/statsresponse.go | 8 +- pkg/models/shared/stripeconfig.go | 13 - pkg/models/shared/stripetransferrequest.go | 13 - pkg/models/shared/subject.go | 17 +- pkg/models/shared/taskbankingcircle.go | 23 - pkg/models/shared/taskcurrencycloud.go | 22 - pkg/models/shared/taskdummypay.go | 24 - pkg/models/shared/taskmangopay.go | 24 - pkg/models/shared/taskmodulr.go | 24 - pkg/models/shared/taskmoneycorp.go | 24 - pkg/models/shared/taskresponse.go | 226 -- pkg/models/shared/taskscursor.go | 234 -- pkg/models/shared/taskstripe.go | 24 - pkg/models/shared/taskwise.go | 24 - pkg/models/shared/transaction.go | 64 +- pkg/models/shared/transactiondata.go | 40 + pkg/models/shared/transactionresponse.go | 8 +- pkg/models/shared/transactions.go | 7 + .../shared/transactionscursorresponse.go | 43 +- pkg/models/shared/transactionsresponse.go | 8 +- pkg/models/shared/transferrequest.go | 10 - pkg/models/shared/transferresponse.go | 8 - pkg/models/shared/transfersresponse.go | 19 - pkg/models/shared/trigger.go | 70 + pkg/models/shared/triggerdata.go | 38 + pkg/models/shared/triggeroccurrence.go | 54 + pkg/models/shared/updateclientrequest.go | 57 + pkg/models/shared/updateclientresponse.go | 8 +- pkg/models/shared/updatescoperequest.go | 8 - pkg/models/shared/updatescoperesponse.go | 8 - pkg/models/shared/user.go | 21 + pkg/models/shared/v2account.go | 38 + pkg/models/shared/v2accountresponse.go | 14 + pkg/models/shared/v2accountscursorresponse.go | 57 + pkg/models/shared/v2activityconfirmhold.go | 14 + .../shared/v2activitycreatetransaction.go | 22 + .../v2activitycreatetransactionoutput.go | 14 + pkg/models/shared/v2activitycreditwallet.go | 22 + pkg/models/shared/v2activitydebitwallet.go | 22 + .../shared/v2activitydebitwalletoutput.go | 14 + pkg/models/shared/v2activitygetaccount.go | 22 + .../shared/v2activitygetaccountoutput.go | 14 + pkg/models/shared/v2activitygetpayment.go | 14 + .../shared/v2activitygetpaymentoutput.go | 14 + pkg/models/shared/v2activitygetwallet.go | 14 + .../shared/v2activitygetwalletoutput.go | 14 + pkg/models/shared/v2activitystripetransfer.go | 78 + pkg/models/shared/v2activityvoidhold.go | 14 + .../shared/v2aggregatebalancesresponse.go | 30 + pkg/models/shared/v2assetholder.go | 30 + pkg/models/shared/v2bulkelement.go | 338 +++ pkg/models/shared/v2bulkelementresult.go | 266 ++ pkg/models/shared/v2bulkresponse.go | 14 + pkg/models/shared/v2configinforesponse.go | 22 + pkg/models/shared/v2connector.go | 53 + pkg/models/shared/v2createledgerrequest.go | 14 + .../shared/v2createtransactionresponse.go | 14 + pkg/models/shared/v2createtriggerresponse.go | 14 + pkg/models/shared/v2createworkflowrequest.go | 22 + pkg/models/shared/v2createworkflowresponse.go | 14 + pkg/models/shared/v2creditwalletrequest.go | 48 + pkg/models/shared/v2debitwalletrequest.go | 70 + pkg/models/shared/v2error.go | 54 + pkg/models/shared/v2errorresponse.go | 30 + pkg/models/shared/v2errorsenum.go | 59 + pkg/models/shared/v2expandedtransaction.go | 87 + pkg/models/shared/v2gettransactionresponse.go | 14 + .../v2getworkflowinstancehistoryresponse.go | 14 + ...getworkflowinstancehistorystageresponse.go | 14 + .../shared/v2getworkflowinstanceresponse.go | 14 + pkg/models/shared/v2getworkflowresponse.go | 14 + pkg/models/shared/v2hold.go | 63 + pkg/models/shared/v2ledger.go | 46 + pkg/models/shared/v2ledgeraccountsubject.go | 22 + pkg/models/shared/v2ledgerinfo.go | 33 + pkg/models/shared/v2ledgerinforesponse.go | 14 + pkg/models/shared/v2ledgerlistresponse.go | 57 + pkg/models/shared/v2listrunsresponse.go | 57 + .../v2listtriggersoccurrencesresponse.go | 57 + pkg/models/shared/v2listtriggersresponse.go | 57 + pkg/models/shared/v2listworkflowsresponse.go | 57 + pkg/models/shared/v2log.go | 95 + pkg/models/shared/v2logscursorresponse.go | 57 + pkg/models/shared/v2migrationinfo.go | 83 + pkg/models/shared/v2monetary.go | 40 + pkg/models/shared/v2payment.go | 256 ++ pkg/models/shared/v2paymentadjustment.go | 66 + pkg/models/shared/v2paymentmetadata.go | 14 + pkg/models/shared/v2paymentstatus.go | 47 + pkg/models/shared/v2posting.go | 54 + pkg/models/shared/v2posttransaction.go | 81 + pkg/models/shared/v2readtriggerresponse.go | 14 + .../shared/v2reverttransactionresponse.go | 14 + pkg/models/shared/v2runworkflowresponse.go | 14 + pkg/models/shared/v2serverinfo.go | 14 + pkg/models/shared/v2stage.go | 93 + pkg/models/shared/v2stagedelay.go | 38 + pkg/models/shared/v2stagesend.go | 30 + pkg/models/shared/v2stagesenddestination.go | 30 + .../shared/v2stagesenddestinationaccount.go | 22 + .../shared/v2stagesenddestinationpayment.go | 14 + .../shared/v2stagesenddestinationwallet.go | 22 + pkg/models/shared/v2stagesendsource.go | 30 + pkg/models/shared/v2stagesendsourceaccount.go | 22 + pkg/models/shared/v2stagesendsourcepayment.go | 14 + pkg/models/shared/v2stagesendsourcewallet.go | 22 + pkg/models/shared/v2stagestatus.go | 62 + pkg/models/shared/v2stagewaitevent.go | 14 + pkg/models/shared/v2stats.go | 38 + pkg/models/shared/v2statsresponse.go | 14 + pkg/models/shared/v2subject.go | 93 + pkg/models/shared/v2targetid.go | 72 + pkg/models/shared/v2targettype.go | 35 + pkg/models/shared/v2transaction.go | 71 + .../shared/v2transactionscursorresponse.go | 57 + pkg/models/shared/v2trigger.go | 70 + pkg/models/shared/v2triggerdata.go | 38 + pkg/models/shared/v2triggeroccurrence.go | 54 + pkg/models/shared/v2volume.go | 46 + pkg/models/shared/v2walletsubject.go | 30 + pkg/models/shared/v2walletwithbalances.go | 83 + pkg/models/shared/v2workflow.go | 54 + pkg/models/shared/v2workflowconfig.go | 22 + pkg/models/shared/v2workflowinstance.go | 86 + .../shared/v2workflowinstancehistory.go | 70 + .../shared/v2workflowinstancehistorystage.go | 102 + .../v2workflowinstancehistorystageinput.go | 78 + .../v2workflowinstancehistorystageoutput.go | 46 + pkg/models/shared/version.go | 21 + pkg/models/shared/volume.go | 33 + pkg/models/shared/wallet.go | 47 + pkg/models/shared/walletserrorresponse.go | 15 +- pkg/models/shared/walletsposting.go | 14 - pkg/models/shared/walletstransaction.go | 72 +- pkg/models/shared/walletsubject.go | 21 + pkg/models/shared/walletsvolume.go | 33 + pkg/models/shared/walletwithbalances.go | 61 + pkg/models/shared/webhooksconfig.go | 61 + pkg/models/shared/webhookserrorresponse.go | 22 +- pkg/models/shared/webhookserrorsenum.go | 27 +- pkg/models/shared/wiseconfig.go | 10 - pkg/models/shared/workflow.go | 40 + pkg/models/shared/workflowconfig.go | 14 + pkg/models/shared/workflowinstance.go | 68 + pkg/models/shared/workflowinstancehistory.go | 66 +- .../shared/workflowinstancehistorystage.go | 82 + .../workflowinstancehistorystageinput.go | 64 +- .../workflowinstancehistorystageoutput.go | 36 +- pkg/types/bigint.go | 41 +- pkg/types/date.go | 4 + pkg/types/decimal.go | 20 + pkg/types/pointers.go | 10 + pkg/utils/form.go | 21 +- pkg/utils/headers.go | 14 +- pkg/utils/json.go | 579 ++++ pkg/utils/pathparams.go | 61 +- pkg/utils/queryparams.go | 24 +- pkg/utils/requestbody.go | 65 +- pkg/utils/security.go | 138 +- pkg/utils/utils.go | 31 +- reconciliation.go | 586 ++++ search.go | 69 +- wallets.go | 487 ++-- webhooks.go | 253 +- 1024 files changed, 35883 insertions(+), 9071 deletions(-) create mode 100755 .gitattributes create mode 100644 LICENSE delete mode 100755 docs/auth/README.md delete mode 100755 docs/flows/README.md delete mode 100755 docs/formance/README.md delete mode 100755 docs/ledger/README.md 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/canceleventrequest.md create mode 100755 docs/models/operations/canceleventresponse.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/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/createpolicyresponse.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/createtriggerresponse.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/deletepolicyrequest.md create mode 100755 docs/models/operations/deletepolicyresponse.md create mode 100755 docs/models/operations/deletesecretrequest.md create mode 100755 docs/models/operations/deletesecretresponse.md create mode 100755 docs/models/operations/deletetriggerrequest.md create mode 100755 docs/models/operations/deletetriggerresponse.md create mode 100755 docs/models/operations/deleteworkflowrequest.md create mode 100755 docs/models/operations/deleteworkflowresponse.md create mode 100755 docs/models/operations/getaccountrequest.md create mode 100755 docs/models/operations/getaccountresponse.md create mode 100755 docs/models/operations/getapiauthwellknownopenidconfigurationresponse.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/getholdrequest.md create mode 100755 docs/models/operations/getholdresponse.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/getinstancehistoryrequest.md create mode 100755 docs/models/operations/getinstancehistoryresponse.md create mode 100755 docs/models/operations/getinstancerequest.md create mode 100755 docs/models/operations/getinstanceresponse.md create mode 100755 docs/models/operations/getinstancestagehistoryrequest.md create mode 100755 docs/models/operations/getinstancestagehistoryresponse.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/getpolicyrequest.md create mode 100755 docs/models/operations/getpolicyresponse.md create mode 100755 docs/models/operations/getreconciliationrequest.md create mode 100755 docs/models/operations/getreconciliationresponse.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/getversionsresponse.md create mode 100755 docs/models/operations/getwalletrequest.md create mode 100755 docs/models/operations/getwalletresponse.md create mode 100755 docs/models/operations/getwalletsummaryrequest.md create mode 100755 docs/models/operations/getwalletsummaryresponse.md create mode 100755 docs/models/operations/getworkflowrequest.md create mode 100755 docs/models/operations/getworkflowresponse.md create mode 100755 docs/models/operations/insertconfigresponse.md create mode 100755 docs/models/operations/listaccountsrequest.md create mode 100755 docs/models/operations/listaccountsresponse.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/listinstancesrequest.md create mode 100755 docs/models/operations/listinstancesresponse.md create mode 100755 docs/models/operations/listlogsrequest.md create mode 100755 docs/models/operations/listlogsresponse.md create mode 100755 docs/models/operations/listpoliciesrequest.md create mode 100755 docs/models/operations/listpoliciesresponse.md create mode 100755 docs/models/operations/listreconciliationsrequest.md create mode 100755 docs/models/operations/listreconciliationsresponse.md create mode 100755 docs/models/operations/listtransactionsrequest.md create mode 100755 docs/models/operations/listtransactionsresponse.md create mode 100755 docs/models/operations/listtriggersoccurrencesrequest.md create mode 100755 docs/models/operations/listtriggersoccurrencesresponse.md create mode 100755 docs/models/operations/listtriggersresponse.md create mode 100755 docs/models/operations/listusersresponse.md create mode 100755 docs/models/operations/listwalletsrequest.md create mode 100755 docs/models/operations/listwalletsresponse.md create mode 100755 docs/models/operations/listworkflowsresponse.md create mode 100755 docs/models/operations/orchestrationgetserverinforesponse.md create mode 100755 docs/models/operations/readclientrequest.md create mode 100755 docs/models/operations/readclientresponse.md create mode 100755 docs/models/operations/readstatsrequest.md create mode 100755 docs/models/operations/readstatsresponse.md create mode 100755 docs/models/operations/readtriggerrequest.md create mode 100755 docs/models/operations/readtriggerresponse.md create mode 100755 docs/models/operations/readuserrequest.md create mode 100755 docs/models/operations/readuserresponse.md create mode 100755 docs/models/operations/reconcilerequest.md create mode 100755 docs/models/operations/reconcileresponse.md create mode 100755 docs/models/operations/reconciliationgetserverinforesponse.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/sendeventrequest.md create mode 100755 docs/models/operations/sendeventrequestbody.md create mode 100755 docs/models/operations/sendeventresponse.md create mode 100755 docs/models/operations/testconfigrequest.md create mode 100755 docs/models/operations/testconfigresponse.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/updatewalletrequest.md create mode 100755 docs/models/operations/updatewalletrequestbody.md create mode 100755 docs/models/operations/updatewalletresponse.md create mode 100755 docs/models/operations/v2addmetadataontransactionrequest.md create mode 100755 docs/models/operations/v2addmetadataontransactionresponse.md create mode 100755 docs/models/operations/v2addmetadatatoaccountrequest.md create mode 100755 docs/models/operations/v2addmetadatatoaccountresponse.md create mode 100755 docs/models/operations/v2canceleventrequest.md create mode 100755 docs/models/operations/v2canceleventresponse.md create mode 100755 docs/models/operations/v2countaccountsrequest.md create mode 100755 docs/models/operations/v2countaccountsresponse.md create mode 100755 docs/models/operations/v2counttransactionsrequest.md create mode 100755 docs/models/operations/v2counttransactionsresponse.md create mode 100755 docs/models/operations/v2createbulkrequest.md create mode 100755 docs/models/operations/v2createbulkresponse.md create mode 100755 docs/models/operations/v2createledgerrequest.md create mode 100755 docs/models/operations/v2createledgerresponse.md create mode 100755 docs/models/operations/v2createtransactionrequest.md create mode 100755 docs/models/operations/v2createtransactionresponse.md create mode 100755 docs/models/operations/v2createtriggerresponse.md create mode 100755 docs/models/operations/v2createworkflowresponse.md create mode 100755 docs/models/operations/v2deleteaccountmetadatarequest.md create mode 100755 docs/models/operations/v2deleteaccountmetadataresponse.md create mode 100755 docs/models/operations/v2deletetransactionmetadatarequest.md create mode 100755 docs/models/operations/v2deletetransactionmetadataresponse.md create mode 100755 docs/models/operations/v2deletetriggerrequest.md create mode 100755 docs/models/operations/v2deletetriggerresponse.md create mode 100755 docs/models/operations/v2deleteworkflowrequest.md create mode 100755 docs/models/operations/v2deleteworkflowresponse.md create mode 100755 docs/models/operations/v2getaccountrequest.md create mode 100755 docs/models/operations/v2getaccountresponse.md create mode 100755 docs/models/operations/v2getbalancesaggregatedrequest.md create mode 100755 docs/models/operations/v2getbalancesaggregatedresponse.md create mode 100755 docs/models/operations/v2getinforesponse.md create mode 100755 docs/models/operations/v2getinstancehistoryrequest.md create mode 100755 docs/models/operations/v2getinstancehistoryresponse.md create mode 100755 docs/models/operations/v2getinstancerequest.md create mode 100755 docs/models/operations/v2getinstanceresponse.md create mode 100755 docs/models/operations/v2getinstancestagehistoryrequest.md create mode 100755 docs/models/operations/v2getinstancestagehistoryresponse.md create mode 100755 docs/models/operations/v2getledgerinforequest.md create mode 100755 docs/models/operations/v2getledgerinforesponse.md create mode 100755 docs/models/operations/v2getledgerrequest.md create mode 100755 docs/models/operations/v2getledgerresponse.md create mode 100755 docs/models/operations/v2getserverinforesponse.md create mode 100755 docs/models/operations/v2gettransactionrequest.md create mode 100755 docs/models/operations/v2gettransactionresponse.md create mode 100755 docs/models/operations/v2getworkflowrequest.md create mode 100755 docs/models/operations/v2getworkflowresponse.md create mode 100755 docs/models/operations/v2listaccountsrequest.md create mode 100755 docs/models/operations/v2listaccountsresponse.md create mode 100755 docs/models/operations/v2listinstancesrequest.md create mode 100755 docs/models/operations/v2listinstancesresponse.md create mode 100755 docs/models/operations/v2listledgersrequest.md create mode 100755 docs/models/operations/v2listledgersresponse.md create mode 100755 docs/models/operations/v2listlogsrequest.md create mode 100755 docs/models/operations/v2listlogsresponse.md create mode 100755 docs/models/operations/v2listtransactionsrequest.md create mode 100755 docs/models/operations/v2listtransactionsresponse.md create mode 100755 docs/models/operations/v2listtriggersoccurrencesrequest.md create mode 100755 docs/models/operations/v2listtriggersoccurrencesresponse.md create mode 100755 docs/models/operations/v2listtriggersresponse.md create mode 100755 docs/models/operations/v2listworkflowsresponse.md create mode 100755 docs/models/operations/v2readstatsrequest.md create mode 100755 docs/models/operations/v2readstatsresponse.md create mode 100755 docs/models/operations/v2readtriggerrequest.md create mode 100755 docs/models/operations/v2readtriggerresponse.md create mode 100755 docs/models/operations/v2reverttransactionrequest.md create mode 100755 docs/models/operations/v2reverttransactionresponse.md create mode 100755 docs/models/operations/v2runworkflowrequest.md create mode 100755 docs/models/operations/v2runworkflowresponse.md create mode 100755 docs/models/operations/v2sendeventrequest.md create mode 100755 docs/models/operations/v2sendeventrequestbody.md create mode 100755 docs/models/operations/v2sendeventresponse.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/accountresponse.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/activityconfirmhold.md create mode 100755 docs/models/shared/activitycreatetransaction.md create mode 100755 docs/models/shared/activitycreatetransactionoutput.md create mode 100755 docs/models/shared/activitycreditwallet.md create mode 100755 docs/models/shared/activitydebitwallet.md create mode 100755 docs/models/shared/activitydebitwalletoutput.md create mode 100755 docs/models/shared/activitygetaccount.md create mode 100755 docs/models/shared/activitygetaccountoutput.md create mode 100755 docs/models/shared/activitygetpayment.md create mode 100755 docs/models/shared/activitygetpaymentoutput.md create mode 100755 docs/models/shared/activitygetwallet.md create mode 100755 docs/models/shared/activitygetwalletoutput.md create mode 100755 docs/models/shared/activitystripetransfer.md create mode 100755 docs/models/shared/activitystripetransfermetadata.md create mode 100755 docs/models/shared/activityvoidhold.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/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/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/createsecretrequest.md create mode 100755 docs/models/shared/createsecretresponse.md create mode 100755 docs/models/shared/createtriggerresponse.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/debitwalletrequest.md create mode 100755 docs/models/shared/debitwalletresponse.md create mode 100755 docs/models/shared/error.md create mode 100755 docs/models/shared/errorerrorcode.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/getversionsresponse.md create mode 100755 docs/models/shared/getwalletresponse.md create mode 100755 docs/models/shared/getwalletsummaryresponse.md create mode 100755 docs/models/shared/getworkflowinstancehistoryresponse.md create mode 100755 docs/models/shared/getworkflowinstancehistorystageresponse.md create mode 100755 docs/models/shared/getworkflowinstanceresponse.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/listtriggersoccurrencesresponse.md create mode 100755 docs/models/shared/listtriggersresponse.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/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/monetary.md create mode 100755 docs/models/shared/orchestrationaccount.md create mode 100755 docs/models/shared/orchestrationposttransaction.md create mode 100755 docs/models/shared/orchestrationposttransactionscript.md create mode 100755 docs/models/shared/orchestrationtransaction.md create mode 100755 docs/models/shared/orchestrationv2transaction.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/paymentraw.md create mode 100755 docs/models/shared/paymentscheme.md create mode 100755 docs/models/shared/paymentstatus.md create mode 100755 docs/models/shared/paymenttype.md create mode 100755 docs/models/shared/policiescursorresponse.md create mode 100755 docs/models/shared/policiescursorresponsecursor.md create mode 100755 docs/models/shared/policy.md create mode 100755 docs/models/shared/policyrequest.md create mode 100755 docs/models/shared/policyresponse.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/query.md create mode 100755 docs/models/shared/queryraw.md create mode 100755 docs/models/shared/readclientresponse.md create mode 100755 docs/models/shared/readtriggerresponse.md create mode 100755 docs/models/shared/readuserresponse.md create mode 100755 docs/models/shared/reconciliation.md create mode 100755 docs/models/shared/reconciliationerrorresponse.md create mode 100755 docs/models/shared/reconciliationrequest.md create mode 100755 docs/models/shared/reconciliationresponse.md create mode 100755 docs/models/shared/reconciliationscursorresponse.md create mode 100755 docs/models/shared/reconciliationscursorresponsecursor.md create mode 100755 docs/models/shared/response.md create mode 100755 docs/models/shared/responsecursor.md create mode 100755 docs/models/shared/responsecursortotal.md create mode 100755 docs/models/shared/runworkflowresponse.md create mode 100755 docs/models/shared/script.md create mode 100755 docs/models/shared/scriptresponse.md create mode 100755 docs/models/shared/secret.md create mode 100755 docs/models/shared/serverinfo.md create mode 100755 docs/models/shared/stage.md create mode 100755 docs/models/shared/stagedelay.md create mode 100755 docs/models/shared/stagesend.md create mode 100755 docs/models/shared/stagesenddestination.md create mode 100755 docs/models/shared/stagesenddestinationaccount.md create mode 100755 docs/models/shared/stagesenddestinationpayment.md create mode 100755 docs/models/shared/stagesenddestinationwallet.md create mode 100755 docs/models/shared/stagesendsource.md create mode 100755 docs/models/shared/stagesendsourceaccount.md create mode 100755 docs/models/shared/stagesendsourcepayment.md create mode 100755 docs/models/shared/stagesendsourcewallet.md create mode 100755 docs/models/shared/stagestatus.md create mode 100755 docs/models/shared/stagewaitevent.md create mode 100755 docs/models/shared/stats.md create mode 100755 docs/models/shared/statsresponse.md create mode 100755 docs/models/shared/subject.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/trigger.md create mode 100755 docs/models/shared/triggerdata.md create mode 100755 docs/models/shared/triggeroccurrence.md create mode 100755 docs/models/shared/updateclientrequest.md create mode 100755 docs/models/shared/updateclientresponse.md create mode 100755 docs/models/shared/user.md create mode 100755 docs/models/shared/v2account.md create mode 100755 docs/models/shared/v2accountresponse.md create mode 100755 docs/models/shared/v2accountscursorresponse.md create mode 100755 docs/models/shared/v2accountscursorresponsecursor.md create mode 100755 docs/models/shared/v2activityconfirmhold.md create mode 100755 docs/models/shared/v2activitycreatetransaction.md create mode 100755 docs/models/shared/v2activitycreatetransactionoutput.md create mode 100755 docs/models/shared/v2activitycreditwallet.md create mode 100755 docs/models/shared/v2activitydebitwallet.md create mode 100755 docs/models/shared/v2activitydebitwalletoutput.md create mode 100755 docs/models/shared/v2activitygetaccount.md create mode 100755 docs/models/shared/v2activitygetaccountoutput.md create mode 100755 docs/models/shared/v2activitygetpayment.md create mode 100755 docs/models/shared/v2activitygetpaymentoutput.md create mode 100755 docs/models/shared/v2activitygetwallet.md create mode 100755 docs/models/shared/v2activitygetwalletoutput.md create mode 100755 docs/models/shared/v2activitystripetransfer.md create mode 100755 docs/models/shared/v2activitystripetransfermetadata.md create mode 100755 docs/models/shared/v2activityvoidhold.md create mode 100755 docs/models/shared/v2aggregatebalancesresponse.md create mode 100755 docs/models/shared/v2assetholder.md create mode 100755 docs/models/shared/v2bulkelement.md create mode 100755 docs/models/shared/v2bulkelementresult.md create mode 100755 docs/models/shared/v2bulkelementresultv2bulkelementresultaddmetadata.md create mode 100755 docs/models/shared/v2bulkelementresultv2bulkelementresultcreatetransaction.md create mode 100755 docs/models/shared/v2bulkelementresultv2bulkelementresultdeletemetadata.md create mode 100755 docs/models/shared/v2bulkelementresultv2bulkelementresulterror.md create mode 100755 docs/models/shared/v2bulkelementresultv2bulkelementresultreverttransaction.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementaddmetadata.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementaddmetadatadata.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementcreatetransaction.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementdeletemetadata.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementreverttransaction.md create mode 100755 docs/models/shared/v2bulkelementv2bulkelementreverttransactiondata.md create mode 100755 docs/models/shared/v2bulkresponse.md create mode 100755 docs/models/shared/v2configinforesponse.md create mode 100755 docs/models/shared/v2connector.md create mode 100755 docs/models/shared/v2createledgerrequest.md create mode 100755 docs/models/shared/v2createtransactionresponse.md create mode 100755 docs/models/shared/v2createtriggerresponse.md create mode 100755 docs/models/shared/v2createworkflowrequest.md create mode 100755 docs/models/shared/v2createworkflowresponse.md create mode 100755 docs/models/shared/v2creditwalletrequest.md create mode 100755 docs/models/shared/v2debitwalletrequest.md create mode 100755 docs/models/shared/v2error.md create mode 100755 docs/models/shared/v2errorerrorcode.md create mode 100755 docs/models/shared/v2errorresponse.md create mode 100755 docs/models/shared/v2errorsenum.md create mode 100755 docs/models/shared/v2expandedtransaction.md create mode 100755 docs/models/shared/v2gettransactionresponse.md create mode 100755 docs/models/shared/v2getworkflowinstancehistoryresponse.md create mode 100755 docs/models/shared/v2getworkflowinstancehistorystageresponse.md create mode 100755 docs/models/shared/v2getworkflowinstanceresponse.md create mode 100755 docs/models/shared/v2getworkflowresponse.md create mode 100755 docs/models/shared/v2hold.md create mode 100755 docs/models/shared/v2ledger.md create mode 100755 docs/models/shared/v2ledgeraccountsubject.md create mode 100755 docs/models/shared/v2ledgerinfo.md create mode 100755 docs/models/shared/v2ledgerinforesponse.md create mode 100755 docs/models/shared/v2ledgerinfostorage.md create mode 100755 docs/models/shared/v2ledgerlistresponse.md create mode 100755 docs/models/shared/v2ledgerlistresponsecursor.md create mode 100755 docs/models/shared/v2listrunsresponse.md create mode 100755 docs/models/shared/v2listrunsresponsecursor.md create mode 100755 docs/models/shared/v2listtriggersoccurrencesresponse.md create mode 100755 docs/models/shared/v2listtriggersoccurrencesresponsecursor.md create mode 100755 docs/models/shared/v2listtriggersresponse.md create mode 100755 docs/models/shared/v2listtriggersresponsecursor.md create mode 100755 docs/models/shared/v2listworkflowsresponse.md create mode 100755 docs/models/shared/v2listworkflowsresponsecursor.md create mode 100755 docs/models/shared/v2log.md create mode 100755 docs/models/shared/v2logscursorresponse.md create mode 100755 docs/models/shared/v2logscursorresponsecursor.md create mode 100755 docs/models/shared/v2logtype.md create mode 100755 docs/models/shared/v2migrationinfo.md create mode 100755 docs/models/shared/v2migrationinfostate.md create mode 100755 docs/models/shared/v2monetary.md create mode 100755 docs/models/shared/v2payment.md create mode 100755 docs/models/shared/v2paymentadjustment.md create mode 100755 docs/models/shared/v2paymentadjustmentraw.md create mode 100755 docs/models/shared/v2paymentmetadata.md create mode 100755 docs/models/shared/v2paymentraw.md create mode 100755 docs/models/shared/v2paymentscheme.md create mode 100755 docs/models/shared/v2paymentstatus.md create mode 100755 docs/models/shared/v2paymenttype.md create mode 100755 docs/models/shared/v2posting.md create mode 100755 docs/models/shared/v2posttransaction.md create mode 100755 docs/models/shared/v2posttransactionscript.md create mode 100755 docs/models/shared/v2readtriggerresponse.md create mode 100755 docs/models/shared/v2reverttransactionresponse.md create mode 100755 docs/models/shared/v2runworkflowresponse.md create mode 100755 docs/models/shared/v2serverinfo.md create mode 100755 docs/models/shared/v2stage.md create mode 100755 docs/models/shared/v2stagedelay.md create mode 100755 docs/models/shared/v2stagesend.md create mode 100755 docs/models/shared/v2stagesenddestination.md create mode 100755 docs/models/shared/v2stagesenddestinationaccount.md create mode 100755 docs/models/shared/v2stagesenddestinationpayment.md create mode 100755 docs/models/shared/v2stagesenddestinationwallet.md create mode 100755 docs/models/shared/v2stagesendsource.md create mode 100755 docs/models/shared/v2stagesendsourceaccount.md create mode 100755 docs/models/shared/v2stagesendsourcepayment.md create mode 100755 docs/models/shared/v2stagesendsourcewallet.md create mode 100755 docs/models/shared/v2stagestatus.md create mode 100755 docs/models/shared/v2stagewaitevent.md create mode 100755 docs/models/shared/v2stats.md create mode 100755 docs/models/shared/v2statsresponse.md create mode 100755 docs/models/shared/v2subject.md create mode 100755 docs/models/shared/v2targetid.md create mode 100755 docs/models/shared/v2targettype.md create mode 100755 docs/models/shared/v2transaction.md create mode 100755 docs/models/shared/v2transactionscursorresponse.md create mode 100755 docs/models/shared/v2transactionscursorresponsecursor.md create mode 100755 docs/models/shared/v2trigger.md create mode 100755 docs/models/shared/v2triggerdata.md create mode 100755 docs/models/shared/v2triggeroccurrence.md create mode 100755 docs/models/shared/v2volume.md create mode 100755 docs/models/shared/v2walletsubject.md create mode 100755 docs/models/shared/v2walletwithbalances.md create mode 100755 docs/models/shared/v2walletwithbalancesbalances.md create mode 100755 docs/models/shared/v2workflow.md create mode 100755 docs/models/shared/v2workflowconfig.md create mode 100755 docs/models/shared/v2workflowinstance.md create mode 100755 docs/models/shared/v2workflowinstancehistory.md create mode 100755 docs/models/shared/v2workflowinstancehistorystage.md create mode 100755 docs/models/shared/v2workflowinstancehistorystageinput.md create mode 100755 docs/models/shared/v2workflowinstancehistorystageoutput.md create mode 100755 docs/models/shared/version.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/walletserrorresponseerrorcode.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/webhookserrorresponse.md create mode 100755 docs/models/shared/webhookserrorsenum.md create mode 100755 docs/models/shared/workflow.md create mode 100755 docs/models/shared/workflowconfig.md create mode 100755 docs/models/shared/workflowinstance.md create mode 100755 docs/models/shared/workflowinstancehistory.md create mode 100755 docs/models/shared/workflowinstancehistorystage.md create mode 100755 docs/models/shared/workflowinstancehistorystageinput.md create mode 100755 docs/models/shared/workflowinstancehistorystageoutput.md delete mode 100755 docs/payments/README.md create mode 100755 docs/sdks/auth/README.md create mode 100755 docs/sdks/formance/README.md create mode 100755 docs/sdks/ledger/README.md create mode 100755 docs/sdks/orchestration/README.md create mode 100755 docs/sdks/reconciliation/README.md create mode 100755 docs/sdks/search/README.md create mode 100755 docs/sdks/wallets/README.md create mode 100755 docs/sdks/webhooks/README.md delete mode 100755 docs/search/README.md delete mode 100755 docs/wallets/README.md delete mode 100755 docs/webhooks/README.md delete mode 100755 flows.go create mode 100755 orchestration.go delete mode 100755 payments.go delete mode 100755 pkg/models/operations/addscopetoclient.go delete mode 100755 pkg/models/operations/addtransientscope.go delete mode 100755 pkg/models/operations/connectorsstripetransfer.go delete mode 100755 pkg/models/operations/connectorstransfer.go create mode 100755 pkg/models/operations/createpolicy.go delete mode 100755 pkg/models/operations/createscope.go create mode 100755 pkg/models/operations/createtrigger.go create mode 100755 pkg/models/operations/deletepolicy.go delete mode 100755 pkg/models/operations/deletescope.go delete mode 100755 pkg/models/operations/deletescopefromclient.go delete mode 100755 pkg/models/operations/deletetransientscope.go create mode 100755 pkg/models/operations/deletetrigger.go create mode 100755 pkg/models/operations/getapiauthwellknownopenidconfiguration.go delete mode 100755 pkg/models/operations/getconnectortask.go delete mode 100755 pkg/models/operations/getpayment.go create mode 100755 pkg/models/operations/getpolicy.go create mode 100755 pkg/models/operations/getreconciliation.go delete mode 100755 pkg/models/operations/installconnector.go delete mode 100755 pkg/models/operations/listallconnectors.go delete mode 100755 pkg/models/operations/listconfigsavailableconnectors.go delete mode 100755 pkg/models/operations/listconnectorstransfers.go delete mode 100755 pkg/models/operations/listconnectortasks.go delete mode 100755 pkg/models/operations/listpayments.go create mode 100755 pkg/models/operations/listpolicies.go create mode 100755 pkg/models/operations/listreconciliations.go delete mode 100755 pkg/models/operations/listscopes.go create mode 100755 pkg/models/operations/listtriggers.go create mode 100755 pkg/models/operations/listtriggersoccurrences.go delete mode 100755 pkg/models/operations/paymentsgetserverinfo.go delete mode 100755 pkg/models/operations/paymentslistaccounts.go delete mode 100755 pkg/models/operations/readconnectorconfig.go delete mode 100755 pkg/models/operations/readscope.go create mode 100755 pkg/models/operations/readtrigger.go create mode 100755 pkg/models/operations/reconcile.go create mode 100755 pkg/models/operations/reconciliationgetserverinfo.go delete mode 100755 pkg/models/operations/resetconnector.go delete mode 100755 pkg/models/operations/uninstallconnector.go delete mode 100755 pkg/models/operations/updatemetadata.go delete mode 100755 pkg/models/operations/updatescope.go create mode 100755 pkg/models/operations/v2addmetadataontransaction.go create mode 100755 pkg/models/operations/v2addmetadatatoaccount.go create mode 100755 pkg/models/operations/v2cancelevent.go create mode 100755 pkg/models/operations/v2countaccounts.go create mode 100755 pkg/models/operations/v2counttransactions.go create mode 100755 pkg/models/operations/v2createbulk.go create mode 100755 pkg/models/operations/v2createledger.go create mode 100755 pkg/models/operations/v2createtransaction.go create mode 100755 pkg/models/operations/v2createtrigger.go create mode 100755 pkg/models/operations/v2createworkflow.go create mode 100755 pkg/models/operations/v2deleteaccountmetadata.go create mode 100755 pkg/models/operations/v2deletetransactionmetadata.go create mode 100755 pkg/models/operations/v2deletetrigger.go create mode 100755 pkg/models/operations/v2deleteworkflow.go create mode 100755 pkg/models/operations/v2getaccount.go create mode 100755 pkg/models/operations/v2getbalancesaggregated.go create mode 100755 pkg/models/operations/v2getinfo.go create mode 100755 pkg/models/operations/v2getinstance.go create mode 100755 pkg/models/operations/v2getinstancehistory.go create mode 100755 pkg/models/operations/v2getinstancestagehistory.go create mode 100755 pkg/models/operations/v2getledger.go create mode 100755 pkg/models/operations/v2getledgerinfo.go create mode 100755 pkg/models/operations/v2getserverinfo.go create mode 100755 pkg/models/operations/v2gettransaction.go create mode 100755 pkg/models/operations/v2getworkflow.go create mode 100755 pkg/models/operations/v2listaccounts.go create mode 100755 pkg/models/operations/v2listinstances.go create mode 100755 pkg/models/operations/v2listledgers.go create mode 100755 pkg/models/operations/v2listlogs.go create mode 100755 pkg/models/operations/v2listtransactions.go create mode 100755 pkg/models/operations/v2listtriggers.go create mode 100755 pkg/models/operations/v2listtriggersoccurrences.go create mode 100755 pkg/models/operations/v2listworkflows.go create mode 100755 pkg/models/operations/v2readstats.go create mode 100755 pkg/models/operations/v2readtrigger.go create mode 100755 pkg/models/operations/v2reverttransaction.go create mode 100755 pkg/models/operations/v2runworkflow.go create mode 100755 pkg/models/operations/v2sendevent.go create mode 100755 pkg/models/sdkerrors/sdkerror.go delete mode 100755 pkg/models/shared/accountscursor.go delete mode 100755 pkg/models/shared/activityreverttransaction.go delete mode 100755 pkg/models/shared/activityreverttransactionoutput.go delete mode 100755 pkg/models/shared/bankingcircleconfig.go delete mode 100755 pkg/models/shared/connectorconfigresponse.go delete mode 100755 pkg/models/shared/connectorsconfigsresponse.go delete mode 100755 pkg/models/shared/connectorsresponse.go delete mode 100755 pkg/models/shared/createscoperequest.go delete mode 100755 pkg/models/shared/createscoperesponse.go create mode 100755 pkg/models/shared/createtriggerresponse.go delete mode 100755 pkg/models/shared/currencycloudconfig.go delete mode 100755 pkg/models/shared/dummypayconfig.go delete mode 100755 pkg/models/shared/listscopesresponse.go create mode 100755 pkg/models/shared/listtriggersoccurrencesresponse.go create mode 100755 pkg/models/shared/listtriggersresponse.go delete mode 100755 pkg/models/shared/mangopayconfig.go delete mode 100755 pkg/models/shared/modulrconfig.go delete mode 100755 pkg/models/shared/moneycorpconfig.go create mode 100755 pkg/models/shared/orchestrationaccount.go create mode 100755 pkg/models/shared/orchestrationposttransaction.go create mode 100755 pkg/models/shared/orchestrationtransaction.go create mode 100755 pkg/models/shared/orchestrationv2transaction.go delete mode 100755 pkg/models/shared/paymentresponse.go delete mode 100755 pkg/models/shared/paymentsaccount.go delete mode 100755 pkg/models/shared/paymentscursor.go create mode 100755 pkg/models/shared/policiescursorresponse.go create mode 100755 pkg/models/shared/policy.go create mode 100755 pkg/models/shared/policyrequest.go create mode 100755 pkg/models/shared/policyresponse.go delete mode 100755 pkg/models/shared/readscoperesponse.go create mode 100755 pkg/models/shared/readtriggerresponse.go create mode 100755 pkg/models/shared/reconciliation.go create mode 100755 pkg/models/shared/reconciliationerrorresponse.go create mode 100755 pkg/models/shared/reconciliationrequest.go create mode 100755 pkg/models/shared/reconciliationresponse.go create mode 100755 pkg/models/shared/reconciliationscursorresponse.go delete mode 100755 pkg/models/shared/scope.go delete mode 100755 pkg/models/shared/security.go create mode 100755 pkg/models/shared/stage.go delete mode 100755 pkg/models/shared/stripeconfig.go delete mode 100755 pkg/models/shared/stripetransferrequest.go delete mode 100755 pkg/models/shared/taskbankingcircle.go delete mode 100755 pkg/models/shared/taskcurrencycloud.go delete mode 100755 pkg/models/shared/taskdummypay.go delete mode 100755 pkg/models/shared/taskmangopay.go delete mode 100755 pkg/models/shared/taskmodulr.go delete mode 100755 pkg/models/shared/taskmoneycorp.go delete mode 100755 pkg/models/shared/taskresponse.go delete mode 100755 pkg/models/shared/taskscursor.go delete mode 100755 pkg/models/shared/taskstripe.go delete mode 100755 pkg/models/shared/taskwise.go delete mode 100755 pkg/models/shared/transferrequest.go delete mode 100755 pkg/models/shared/transferresponse.go delete mode 100755 pkg/models/shared/transfersresponse.go create mode 100755 pkg/models/shared/trigger.go create mode 100755 pkg/models/shared/triggerdata.go create mode 100755 pkg/models/shared/triggeroccurrence.go delete mode 100755 pkg/models/shared/updatescoperequest.go delete mode 100755 pkg/models/shared/updatescoperesponse.go create mode 100755 pkg/models/shared/v2account.go create mode 100755 pkg/models/shared/v2accountresponse.go create mode 100755 pkg/models/shared/v2accountscursorresponse.go create mode 100755 pkg/models/shared/v2activityconfirmhold.go create mode 100755 pkg/models/shared/v2activitycreatetransaction.go create mode 100755 pkg/models/shared/v2activitycreatetransactionoutput.go create mode 100755 pkg/models/shared/v2activitycreditwallet.go create mode 100755 pkg/models/shared/v2activitydebitwallet.go create mode 100755 pkg/models/shared/v2activitydebitwalletoutput.go create mode 100755 pkg/models/shared/v2activitygetaccount.go create mode 100755 pkg/models/shared/v2activitygetaccountoutput.go create mode 100755 pkg/models/shared/v2activitygetpayment.go create mode 100755 pkg/models/shared/v2activitygetpaymentoutput.go create mode 100755 pkg/models/shared/v2activitygetwallet.go create mode 100755 pkg/models/shared/v2activitygetwalletoutput.go create mode 100755 pkg/models/shared/v2activitystripetransfer.go create mode 100755 pkg/models/shared/v2activityvoidhold.go create mode 100755 pkg/models/shared/v2aggregatebalancesresponse.go create mode 100755 pkg/models/shared/v2assetholder.go create mode 100755 pkg/models/shared/v2bulkelement.go create mode 100755 pkg/models/shared/v2bulkelementresult.go create mode 100755 pkg/models/shared/v2bulkresponse.go create mode 100755 pkg/models/shared/v2configinforesponse.go create mode 100755 pkg/models/shared/v2connector.go create mode 100755 pkg/models/shared/v2createledgerrequest.go create mode 100755 pkg/models/shared/v2createtransactionresponse.go create mode 100755 pkg/models/shared/v2createtriggerresponse.go create mode 100755 pkg/models/shared/v2createworkflowrequest.go create mode 100755 pkg/models/shared/v2createworkflowresponse.go create mode 100755 pkg/models/shared/v2creditwalletrequest.go create mode 100755 pkg/models/shared/v2debitwalletrequest.go create mode 100755 pkg/models/shared/v2error.go create mode 100755 pkg/models/shared/v2errorresponse.go create mode 100755 pkg/models/shared/v2errorsenum.go create mode 100755 pkg/models/shared/v2expandedtransaction.go create mode 100755 pkg/models/shared/v2gettransactionresponse.go create mode 100755 pkg/models/shared/v2getworkflowinstancehistoryresponse.go create mode 100755 pkg/models/shared/v2getworkflowinstancehistorystageresponse.go create mode 100755 pkg/models/shared/v2getworkflowinstanceresponse.go create mode 100755 pkg/models/shared/v2getworkflowresponse.go create mode 100755 pkg/models/shared/v2hold.go create mode 100755 pkg/models/shared/v2ledger.go create mode 100755 pkg/models/shared/v2ledgeraccountsubject.go create mode 100755 pkg/models/shared/v2ledgerinfo.go create mode 100755 pkg/models/shared/v2ledgerinforesponse.go create mode 100755 pkg/models/shared/v2ledgerlistresponse.go create mode 100755 pkg/models/shared/v2listrunsresponse.go create mode 100755 pkg/models/shared/v2listtriggersoccurrencesresponse.go create mode 100755 pkg/models/shared/v2listtriggersresponse.go create mode 100755 pkg/models/shared/v2listworkflowsresponse.go create mode 100755 pkg/models/shared/v2log.go create mode 100755 pkg/models/shared/v2logscursorresponse.go create mode 100755 pkg/models/shared/v2migrationinfo.go create mode 100755 pkg/models/shared/v2monetary.go create mode 100755 pkg/models/shared/v2payment.go create mode 100755 pkg/models/shared/v2paymentadjustment.go create mode 100755 pkg/models/shared/v2paymentmetadata.go create mode 100755 pkg/models/shared/v2paymentstatus.go create mode 100755 pkg/models/shared/v2posting.go create mode 100755 pkg/models/shared/v2posttransaction.go create mode 100755 pkg/models/shared/v2readtriggerresponse.go create mode 100755 pkg/models/shared/v2reverttransactionresponse.go create mode 100755 pkg/models/shared/v2runworkflowresponse.go create mode 100755 pkg/models/shared/v2serverinfo.go create mode 100755 pkg/models/shared/v2stage.go create mode 100755 pkg/models/shared/v2stagedelay.go create mode 100755 pkg/models/shared/v2stagesend.go create mode 100755 pkg/models/shared/v2stagesenddestination.go create mode 100755 pkg/models/shared/v2stagesenddestinationaccount.go create mode 100755 pkg/models/shared/v2stagesenddestinationpayment.go create mode 100755 pkg/models/shared/v2stagesenddestinationwallet.go create mode 100755 pkg/models/shared/v2stagesendsource.go create mode 100755 pkg/models/shared/v2stagesendsourceaccount.go create mode 100755 pkg/models/shared/v2stagesendsourcepayment.go create mode 100755 pkg/models/shared/v2stagesendsourcewallet.go create mode 100755 pkg/models/shared/v2stagestatus.go create mode 100755 pkg/models/shared/v2stagewaitevent.go create mode 100755 pkg/models/shared/v2stats.go create mode 100755 pkg/models/shared/v2statsresponse.go create mode 100755 pkg/models/shared/v2subject.go create mode 100755 pkg/models/shared/v2targetid.go create mode 100755 pkg/models/shared/v2targettype.go create mode 100755 pkg/models/shared/v2transaction.go create mode 100755 pkg/models/shared/v2transactionscursorresponse.go create mode 100755 pkg/models/shared/v2trigger.go create mode 100755 pkg/models/shared/v2triggerdata.go create mode 100755 pkg/models/shared/v2triggeroccurrence.go create mode 100755 pkg/models/shared/v2volume.go create mode 100755 pkg/models/shared/v2walletsubject.go create mode 100755 pkg/models/shared/v2walletwithbalances.go create mode 100755 pkg/models/shared/v2workflow.go create mode 100755 pkg/models/shared/v2workflowconfig.go create mode 100755 pkg/models/shared/v2workflowinstance.go create mode 100755 pkg/models/shared/v2workflowinstancehistory.go create mode 100755 pkg/models/shared/v2workflowinstancehistorystage.go create mode 100755 pkg/models/shared/v2workflowinstancehistorystageinput.go create mode 100755 pkg/models/shared/v2workflowinstancehistorystageoutput.go delete mode 100755 pkg/models/shared/walletsposting.go delete mode 100755 pkg/models/shared/wiseconfig.go create mode 100755 pkg/types/decimal.go create mode 100755 pkg/types/pointers.go create mode 100755 pkg/utils/json.go create mode 100755 reconciliation.go diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 00000000..e6a99441 --- /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/.github/workflows/speakeasy_sdk_publish.yml b/.github/workflows/speakeasy_sdk_publish.yml index 05c218b4..3bef0698 100644 --- a/.github/workflows/speakeasy_sdk_publish.yml +++ b/.github/workflows/speakeasy_sdk_publish.yml @@ -2,27 +2,27 @@ name: Publish "on": push: branches: - - main - # paths: - # - RELEASES.md + - release/v*.*.* + - release/v*.*.*-alpha.* + - release/v*.*.*-beta.* + - release/v*.*.*-rc.*version jobs: Release: name: 'Release' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Get version from gen.yaml - id: get_version - uses: mikefarah/yq@master - with: - cmd: yq '.go.version' gen.yaml - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ steps.get_version.outputs.result }} - release_name: Release ${{ steps.get_version.outputs.result }} - draft: false - prerelease: false + - uses: actions/checkout@v4 + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/release/}}" >> $GITHUB_OUTPUT + id: extract_branch + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ steps.extract_branch.outputs.branch }} + release_name: Release ${{ steps.extract_branch.outputs.branch }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.gitignore b/.gitignore index e43b0f98..310cfb33 100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +# .gitignore .DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..442dbb7b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Formance, Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index d44d04cc..3be7b7ae 100755 --- a/README.md +++ b/README.md @@ -13,153 +13,313 @@ go get github.com/formancehq/formance-sdk-go ```go package main -import( +import ( "context" + formancesdkgo "github.com/formancehq/formance-sdk-go" "log" - "github.com/formancehq/formance-sdk-go" ) func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.GetVersions(ctx) - if err != nil { - log.Fatal(err) - } - - if res.GetVersionsResponse != nil { - // handle response - } + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Formance.GetVersions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.GetVersionsResponse != nil { + // handle response + } } + ``` ## Available Resources and Operations -### [Formance SDK](docs/formance/README.md) - -* [GetVersions](docs/formance/README.md#getversions) - Show stack version information - -### [Auth](docs/auth/README.md) - -* [AddScopeToClient](docs/auth/README.md#addscopetoclient) - Add scope to client -* [AddTransientScope](docs/auth/README.md#addtransientscope) - Add a transient scope to a scope -* [CreateClient](docs/auth/README.md#createclient) - Create client -* [CreateScope](docs/auth/README.md#createscope) - Create scope -* [CreateSecret](docs/auth/README.md#createsecret) - Add a secret to a client -* [DeleteClient](docs/auth/README.md#deleteclient) - Delete client -* [DeleteScope](docs/auth/README.md#deletescope) - Delete scope -* [DeleteScopeFromClient](docs/auth/README.md#deletescopefromclient) - Delete scope from client -* [DeleteSecret](docs/auth/README.md#deletesecret) - Delete a secret from a client -* [DeleteTransientScope](docs/auth/README.md#deletetransientscope) - Delete a transient scope from a scope -* [GetServerInfo](docs/auth/README.md#getserverinfo) - Get server info -* [ListClients](docs/auth/README.md#listclients) - List clients -* [ListScopes](docs/auth/README.md#listscopes) - List scopes -* [ListUsers](docs/auth/README.md#listusers) - List users -* [ReadClient](docs/auth/README.md#readclient) - Read client -* [ReadScope](docs/auth/README.md#readscope) - Read scope -* [ReadUser](docs/auth/README.md#readuser) - Read user -* [UpdateClient](docs/auth/README.md#updateclient) - Update client -* [UpdateScope](docs/auth/README.md#updatescope) - Update scope - -### [Flows](docs/flows/README.md) - -* [CancelEvent](docs/flows/README.md#cancelevent) - Cancel a running workflow -* [CreateWorkflow](docs/flows/README.md#createworkflow) - Create workflow -* [DeleteWorkflow](docs/flows/README.md#deleteworkflow) - Delete a flow by id -* [GetInstance](docs/flows/README.md#getinstance) - Get a workflow instance by id -* [GetInstanceHistory](docs/flows/README.md#getinstancehistory) - Get a workflow instance history by id -* [GetInstanceStageHistory](docs/flows/README.md#getinstancestagehistory) - Get a workflow instance stage history -* [GetWorkflow](docs/flows/README.md#getworkflow) - Get a flow by id -* [ListInstances](docs/flows/README.md#listinstances) - List instances of a workflow -* [ListWorkflows](docs/flows/README.md#listworkflows) - List registered workflows -* [OrchestrationgetServerInfo](docs/flows/README.md#orchestrationgetserverinfo) - Get server info -* [RunWorkflow](docs/flows/README.md#runworkflow) - Run workflow -* [SendEvent](docs/flows/README.md#sendevent) - Send an event to a running workflow - -### [Ledger](docs/ledger/README.md) - -* [CreateTransactions](docs/ledger/README.md#createtransactions) - Create a new batch of transactions to a ledger -* [AddMetadataOnTransaction](docs/ledger/README.md#addmetadataontransaction) - Set the metadata of a transaction by its ID -* [AddMetadataToAccount](docs/ledger/README.md#addmetadatatoaccount) - Add metadata to an account -* [CountAccounts](docs/ledger/README.md#countaccounts) - Count the accounts from a ledger -* [CountTransactions](docs/ledger/README.md#counttransactions) - Count the transactions from a ledger -* [CreateTransaction](docs/ledger/README.md#createtransaction) - Create a new transaction to a ledger -* [GetAccount](docs/ledger/README.md#getaccount) - Get account by its address -* [GetBalances](docs/ledger/README.md#getbalances) - Get the balances from a ledger's account -* [GetBalancesAggregated](docs/ledger/README.md#getbalancesaggregated) - Get the aggregated balances from selected accounts -* [GetInfo](docs/ledger/README.md#getinfo) - Show server information -* [GetLedgerInfo](docs/ledger/README.md#getledgerinfo) - Get information about a ledger -* [GetMapping](docs/ledger/README.md#getmapping) - Get the mapping of a ledger -* [GetTransaction](docs/ledger/README.md#gettransaction) - Get transaction from a ledger by its ID -* [ListAccounts](docs/ledger/README.md#listaccounts) - List accounts from a ledger -* [ListLogs](docs/ledger/README.md#listlogs) - List the logs from a ledger -* [ListTransactions](docs/ledger/README.md#listtransactions) - List transactions from a ledger -* [ReadStats](docs/ledger/README.md#readstats) - Get statistics from a ledger -* [RevertTransaction](docs/ledger/README.md#reverttransaction) - Revert a ledger transaction by its ID -* [~~RunScript~~](docs/ledger/README.md#runscript) - Execute a Numscript :warning: **Deprecated** -* [UpdateMapping](docs/ledger/README.md#updatemapping) - Update the mapping of a ledger - -### [Payments](docs/payments/README.md) - -* [ConnectorsStripeTransfer](docs/payments/README.md#connectorsstripetransfer) - Transfer funds between Stripe accounts -* [ConnectorsTransfer](docs/payments/README.md#connectorstransfer) - Transfer funds between Connector accounts -* [GetConnectorTask](docs/payments/README.md#getconnectortask) - Read a specific task of the connector -* [GetPayment](docs/payments/README.md#getpayment) - Get a payment -* [InstallConnector](docs/payments/README.md#installconnector) - Install a connector -* [ListAllConnectors](docs/payments/README.md#listallconnectors) - List all installed connectors -* [ListConfigsAvailableConnectors](docs/payments/README.md#listconfigsavailableconnectors) - List the configs of each available connector -* [ListConnectorTasks](docs/payments/README.md#listconnectortasks) - List tasks from a connector -* [ListConnectorsTransfers](docs/payments/README.md#listconnectorstransfers) - List transfers and their statuses -* [ListPayments](docs/payments/README.md#listpayments) - List payments -* [PaymentsgetServerInfo](docs/payments/README.md#paymentsgetserverinfo) - Get server info -* [PaymentslistAccounts](docs/payments/README.md#paymentslistaccounts) - List accounts -* [ReadConnectorConfig](docs/payments/README.md#readconnectorconfig) - Read the config of a connector -* [ResetConnector](docs/payments/README.md#resetconnector) - Reset a connector -* [UninstallConnector](docs/payments/README.md#uninstallconnector) - Uninstall a connector -* [UpdateMetadata](docs/payments/README.md#updatemetadata) - Update metadata - -### [Search](docs/search/README.md) - -* [Search](docs/search/README.md#search) - Search -* [SearchgetServerInfo](docs/search/README.md#searchgetserverinfo) - Get server info - -### [Wallets](docs/wallets/README.md) - -* [ConfirmHold](docs/wallets/README.md#confirmhold) - Confirm a hold -* [CreateBalance](docs/wallets/README.md#createbalance) - Create a balance -* [CreateWallet](docs/wallets/README.md#createwallet) - Create a new wallet -* [CreditWallet](docs/wallets/README.md#creditwallet) - Credit a wallet -* [DebitWallet](docs/wallets/README.md#debitwallet) - Debit a wallet -* [GetBalance](docs/wallets/README.md#getbalance) - Get detailed balance -* [GetHold](docs/wallets/README.md#gethold) - Get a hold -* [GetHolds](docs/wallets/README.md#getholds) - Get all holds for a wallet -* [GetTransactions](docs/wallets/README.md#gettransactions) -* [GetWallet](docs/wallets/README.md#getwallet) - Get a wallet -* [GetWalletSummary](docs/wallets/README.md#getwalletsummary) - Get wallet summary -* [ListBalances](docs/wallets/README.md#listbalances) - List balances of a wallet -* [ListWallets](docs/wallets/README.md#listwallets) - List all wallets -* [UpdateWallet](docs/wallets/README.md#updatewallet) - Update a wallet -* [VoidHold](docs/wallets/README.md#voidhold) - Cancel a hold -* [WalletsgetServerInfo](docs/wallets/README.md#walletsgetserverinfo) - Get server info - -### [Webhooks](docs/webhooks/README.md) - -* [ActivateConfig](docs/webhooks/README.md#activateconfig) - Activate one config -* [ChangeConfigSecret](docs/webhooks/README.md#changeconfigsecret) - Change the signing secret of a config -* [DeactivateConfig](docs/webhooks/README.md#deactivateconfig) - Deactivate one config -* [DeleteConfig](docs/webhooks/README.md#deleteconfig) - Delete one config -* [GetManyConfigs](docs/webhooks/README.md#getmanyconfigs) - Get many configs -* [InsertConfig](docs/webhooks/README.md#insertconfig) - Insert a new config -* [TestConfig](docs/webhooks/README.md#testconfig) - Test one config +### [Formance SDK](docs/sdks/formance/README.md) + +* [GetVersions](docs/sdks/formance/README.md#getversions) - Show stack version information +* [GetAPIAuthWellKnownOpenidConfiguration](docs/sdks/formance/README.md#getapiauthwellknownopenidconfiguration) + +### [Auth](docs/sdks/auth/README.md) + +* [CreateClient](docs/sdks/auth/README.md#createclient) - Create client +* [CreateSecret](docs/sdks/auth/README.md#createsecret) - Add a secret to a client +* [DeleteClient](docs/sdks/auth/README.md#deleteclient) - Delete client +* [DeleteSecret](docs/sdks/auth/README.md#deletesecret) - Delete a secret from a client +* [GetServerInfo](docs/sdks/auth/README.md#getserverinfo) - Get server info +* [ListClients](docs/sdks/auth/README.md#listclients) - List clients +* [ListUsers](docs/sdks/auth/README.md#listusers) - List users +* [ReadClient](docs/sdks/auth/README.md#readclient) - Read client +* [ReadUser](docs/sdks/auth/README.md#readuser) - Read user +* [UpdateClient](docs/sdks/auth/README.md#updateclient) - Update client + +### [Ledger](docs/sdks/ledger/README.md) + +* [CreateTransactions](docs/sdks/ledger/README.md#createtransactions) - Create a new batch of transactions to a ledger +* [AddMetadataOnTransaction](docs/sdks/ledger/README.md#addmetadataontransaction) - Set the metadata of a transaction by its ID +* [AddMetadataToAccount](docs/sdks/ledger/README.md#addmetadatatoaccount) - Add metadata to an account +* [CountAccounts](docs/sdks/ledger/README.md#countaccounts) - Count the accounts from a ledger +* [CountTransactions](docs/sdks/ledger/README.md#counttransactions) - Count the transactions from a ledger +* [CreateTransaction](docs/sdks/ledger/README.md#createtransaction) - Create a new transaction to a ledger +* [GetAccount](docs/sdks/ledger/README.md#getaccount) - Get account by its address +* [GetBalances](docs/sdks/ledger/README.md#getbalances) - Get the balances from a ledger's account +* [GetBalancesAggregated](docs/sdks/ledger/README.md#getbalancesaggregated) - Get the aggregated balances from selected accounts +* [GetInfo](docs/sdks/ledger/README.md#getinfo) - Show server information +* [GetLedgerInfo](docs/sdks/ledger/README.md#getledgerinfo) - Get information about a ledger +* [GetMapping](docs/sdks/ledger/README.md#getmapping) - Get the mapping of a ledger +* [GetTransaction](docs/sdks/ledger/README.md#gettransaction) - Get transaction from a ledger by its ID +* [ListAccounts](docs/sdks/ledger/README.md#listaccounts) - List accounts from a ledger +* [ListLogs](docs/sdks/ledger/README.md#listlogs) - List the logs from a ledger +* [ListTransactions](docs/sdks/ledger/README.md#listtransactions) - List transactions from a ledger +* [ReadStats](docs/sdks/ledger/README.md#readstats) - Get statistics from a ledger +* [RevertTransaction](docs/sdks/ledger/README.md#reverttransaction) - Revert a ledger transaction by its ID +* [~~RunScript~~](docs/sdks/ledger/README.md#runscript) - Execute a Numscript :warning: **Deprecated** +* [UpdateMapping](docs/sdks/ledger/README.md#updatemapping) - Update the mapping of a ledger +* [V2AddMetadataOnTransaction](docs/sdks/ledger/README.md#v2addmetadataontransaction) - Set the metadata of a transaction by its ID +* [V2AddMetadataToAccount](docs/sdks/ledger/README.md#v2addmetadatatoaccount) - Add metadata to an account +* [V2CountAccounts](docs/sdks/ledger/README.md#v2countaccounts) - Count the accounts from a ledger +* [V2CountTransactions](docs/sdks/ledger/README.md#v2counttransactions) - Count the transactions from a ledger +* [V2CreateBulk](docs/sdks/ledger/README.md#v2createbulk) - Bulk request +* [V2CreateLedger](docs/sdks/ledger/README.md#v2createledger) - Create a ledger +* [V2CreateTransaction](docs/sdks/ledger/README.md#v2createtransaction) - Create a new transaction to a ledger +* [V2DeleteAccountMetadata](docs/sdks/ledger/README.md#v2deleteaccountmetadata) - Delete metadata by key +* [V2DeleteTransactionMetadata](docs/sdks/ledger/README.md#v2deletetransactionmetadata) - Delete metadata by key +* [V2GetAccount](docs/sdks/ledger/README.md#v2getaccount) - Get account by its address +* [V2GetBalancesAggregated](docs/sdks/ledger/README.md#v2getbalancesaggregated) - Get the aggregated balances from selected accounts +* [V2GetInfo](docs/sdks/ledger/README.md#v2getinfo) - Show server information +* [V2GetLedger](docs/sdks/ledger/README.md#v2getledger) - Get a ledger +* [V2GetLedgerInfo](docs/sdks/ledger/README.md#v2getledgerinfo) - Get information about a ledger +* [V2GetTransaction](docs/sdks/ledger/README.md#v2gettransaction) - Get transaction from a ledger by its ID +* [V2ListAccounts](docs/sdks/ledger/README.md#v2listaccounts) - List accounts from a ledger +* [V2ListLedgers](docs/sdks/ledger/README.md#v2listledgers) - List ledgers +* [V2ListLogs](docs/sdks/ledger/README.md#v2listlogs) - List the logs from a ledger +* [V2ListTransactions](docs/sdks/ledger/README.md#v2listtransactions) - List transactions from a ledger +* [V2ReadStats](docs/sdks/ledger/README.md#v2readstats) - Get statistics from a ledger +* [V2RevertTransaction](docs/sdks/ledger/README.md#v2reverttransaction) - Revert a ledger transaction by its ID + +### [Orchestration](docs/sdks/orchestration/README.md) + +* [CancelEvent](docs/sdks/orchestration/README.md#cancelevent) - Cancel a running workflow +* [CreateTrigger](docs/sdks/orchestration/README.md#createtrigger) - Create trigger +* [CreateWorkflow](docs/sdks/orchestration/README.md#createworkflow) - Create workflow +* [DeleteTrigger](docs/sdks/orchestration/README.md#deletetrigger) - Delete trigger +* [DeleteWorkflow](docs/sdks/orchestration/README.md#deleteworkflow) - Delete a flow by id +* [GetInstance](docs/sdks/orchestration/README.md#getinstance) - Get a workflow instance by id +* [GetInstanceHistory](docs/sdks/orchestration/README.md#getinstancehistory) - Get a workflow instance history by id +* [GetInstanceStageHistory](docs/sdks/orchestration/README.md#getinstancestagehistory) - Get a workflow instance stage history +* [GetWorkflow](docs/sdks/orchestration/README.md#getworkflow) - Get a flow by id +* [ListInstances](docs/sdks/orchestration/README.md#listinstances) - List instances of a workflow +* [ListTriggers](docs/sdks/orchestration/README.md#listtriggers) - List triggers +* [ListTriggersOccurrences](docs/sdks/orchestration/README.md#listtriggersoccurrences) - List triggers occurrences +* [ListWorkflows](docs/sdks/orchestration/README.md#listworkflows) - List registered workflows +* [OrchestrationgetServerInfo](docs/sdks/orchestration/README.md#orchestrationgetserverinfo) - Get server info +* [ReadTrigger](docs/sdks/orchestration/README.md#readtrigger) - Read trigger +* [RunWorkflow](docs/sdks/orchestration/README.md#runworkflow) - Run workflow +* [SendEvent](docs/sdks/orchestration/README.md#sendevent) - Send an event to a running workflow +* [V2CancelEvent](docs/sdks/orchestration/README.md#v2cancelevent) - Cancel a running workflow +* [V2CreateTrigger](docs/sdks/orchestration/README.md#v2createtrigger) - Create trigger +* [V2CreateWorkflow](docs/sdks/orchestration/README.md#v2createworkflow) - Create workflow +* [V2DeleteTrigger](docs/sdks/orchestration/README.md#v2deletetrigger) - Delete trigger +* [V2DeleteWorkflow](docs/sdks/orchestration/README.md#v2deleteworkflow) - Delete a flow by id +* [V2GetInstance](docs/sdks/orchestration/README.md#v2getinstance) - Get a workflow instance by id +* [V2GetInstanceHistory](docs/sdks/orchestration/README.md#v2getinstancehistory) - Get a workflow instance history by id +* [V2GetInstanceStageHistory](docs/sdks/orchestration/README.md#v2getinstancestagehistory) - Get a workflow instance stage history +* [V2GetServerInfo](docs/sdks/orchestration/README.md#v2getserverinfo) - Get server info +* [V2GetWorkflow](docs/sdks/orchestration/README.md#v2getworkflow) - Get a flow by id +* [V2ListInstances](docs/sdks/orchestration/README.md#v2listinstances) - List instances of a workflow +* [V2ListTriggers](docs/sdks/orchestration/README.md#v2listtriggers) - List triggers +* [V2ListTriggersOccurrences](docs/sdks/orchestration/README.md#v2listtriggersoccurrences) - List triggers occurrences +* [V2ListWorkflows](docs/sdks/orchestration/README.md#v2listworkflows) - List registered workflows +* [V2ReadTrigger](docs/sdks/orchestration/README.md#v2readtrigger) - Read trigger +* [V2RunWorkflow](docs/sdks/orchestration/README.md#v2runworkflow) - Run workflow +* [V2SendEvent](docs/sdks/orchestration/README.md#v2sendevent) - Send an event to a running workflow + +### [Reconciliation](docs/sdks/reconciliation/README.md) + +* [CreatePolicy](docs/sdks/reconciliation/README.md#createpolicy) - Create a policy +* [DeletePolicy](docs/sdks/reconciliation/README.md#deletepolicy) - Delete a policy +* [GetPolicy](docs/sdks/reconciliation/README.md#getpolicy) - Get a policy +* [GetReconciliation](docs/sdks/reconciliation/README.md#getreconciliation) - Get a reconciliation +* [ListPolicies](docs/sdks/reconciliation/README.md#listpolicies) - List policies +* [ListReconciliations](docs/sdks/reconciliation/README.md#listreconciliations) - List reconciliations +* [Reconcile](docs/sdks/reconciliation/README.md#reconcile) - Reconcile using a policy +* [ReconciliationgetServerInfo](docs/sdks/reconciliation/README.md#reconciliationgetserverinfo) - Get server info + +### [Search](docs/sdks/search/README.md) + +* [Search](docs/sdks/search/README.md#search) - Search +* [SearchgetServerInfo](docs/sdks/search/README.md#searchgetserverinfo) - Get server info + +### [Wallets](docs/sdks/wallets/README.md) + +* [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 +* [GetWalletSummary](docs/sdks/wallets/README.md#getwalletsummary) - Get wallet summary +* [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](docs/sdks/webhooks/README.md) + +* [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 + + + + + + + + + + + +# 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 | + +For example: + + +```go +package main + +import ( + "context" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "log" +) + +func main() { + s := formancesdkgo.New( + formancesdkgo.WithServerIndex(0), + ) + + ctx := context.Background() + res, err := s.Formance.GetVersions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.GetVersionsResponse != 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "log" +) + +func main() { + s := formancesdkgo.New( + formancesdkgo.WithServerURL("http://localhost"), + ) + + ctx := context.Background() + res, err := s.Formance.GetVersions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.GetVersionsResponse != 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. + + + + + + + + + + + + ### Maturity This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage diff --git a/USAGE.md b/USAGE.md index acf179ea..5b533a5b 100755 --- a/USAGE.md +++ b/USAGE.md @@ -1,29 +1,28 @@ + + ```go package main -import( +import ( "context" + formancesdkgo "github.com/formancehq/formance-sdk-go" "log" - "github.com/formancehq/formance-sdk-go" ) func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) + s := formancesdkgo.New() - ctx := context.Background() - res, err := s.GetVersions(ctx) - if err != nil { - log.Fatal(err) - } + ctx := context.Background() + res, err := s.Formance.GetVersions(ctx) + if err != nil { + log.Fatal(err) + } - if res.GetVersionsResponse != nil { - // handle response - } + if res.GetVersionsResponse != nil { + // handle response + } } + ``` \ No newline at end of file diff --git a/auth.go b/auth.go index 84acc9fd..4dfb5ffb 100755 --- a/auth.go +++ b/auth.go @@ -1,124 +1,36 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" ) type auth struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string + sdkConfiguration sdkConfiguration } -func newAuth(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *auth { +func newAuth(sdkConfig sdkConfiguration) *auth { return &auth{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, + sdkConfiguration: sdkConfig, } } -// AddScopeToClient - Add scope to client -func (s *auth) AddScopeToClient(ctx context.Context, request operations.AddScopeToClientRequest) (*operations.AddScopeToClientResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.AddScopeToClientResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - -// AddTransientScope - Add a transient scope to a scope -// Add a transient scope to a scope -func (s *auth) AddTransientScope(ctx context.Context, request operations.AddTransientScopeRequest) (*operations.AddTransientScopeResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.AddTransientScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - // CreateClient - Create client -func (s *auth) CreateClient(ctx context.Context, request shared.CreateClientRequest) (*operations.CreateClientResponse, error) { - baseURL := s.serverURL +func (s *auth) 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) } @@ -128,11 +40,11 @@ func (s *auth) CreateClient(ctx context.Context, request shared.CreateClientRequ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -141,7 +53,6 @@ func (s *auth) CreateClient(ctx context.Context, request shared.CreateClientRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -150,70 +61,25 @@ func (s *auth) CreateClient(ctx context.Context, request shared.CreateClientRequ ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - res.CreateClientResponse = out - } - } - - return res, nil -} - -// CreateScope - Create scope -// Create scope -func (s *auth) CreateScope(ctx context.Context, request shared.CreateScopeRequest) (*operations.CreateScopeResponse, error) { - baseURL := s.serverURL - url := strings.TrimSuffix(baseURL, "/") + "/api/auth/scopes" - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + rawBody, err := io.ReadAll(httpRes.Body) if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.CreateScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateScopeResponse - 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.CreateScopeResponse = out + res.CreateClientResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -222,13 +88,13 @@ func (s *auth) CreateScope(ctx context.Context, request shared.CreateScopeReques // CreateSecret - Add a secret to a client func (s *auth) CreateSecret(ctx context.Context, request operations.CreateSecretRequest) (*operations.CreateSecretResponse, error) { - baseURL := s.serverURL + 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) } @@ -238,11 +104,11 @@ func (s *auth) CreateSecret(ctx context.Context, request operations.CreateSecret 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -251,7 +117,6 @@ func (s *auth) CreateSecret(ctx context.Context, request operations.CreateSecret if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -260,16 +125,25 @@ func (s *auth) CreateSecret(ctx context.Context, request operations.CreateSecret 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 { 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) } } @@ -278,7 +152,7 @@ func (s *auth) CreateSecret(ctx context.Context, request operations.CreateSecret // DeleteClient - Delete client func (s *auth) DeleteClient(ctx context.Context, request operations.DeleteClientRequest) (*operations.DeleteClientResponse, error) { - baseURL := s.serverURL + 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) @@ -289,9 +163,9 @@ func (s *auth) DeleteClient(ctx context.Context, request operations.DeleteClient 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -300,7 +174,6 @@ func (s *auth) DeleteClient(ctx context.Context, request operations.DeleteClient if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -309,87 +182,13 @@ func (s *auth) DeleteClient(ctx context.Context, request operations.DeleteClient ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 204: - } - return res, nil -} - -// DeleteScope - Delete scope -// Delete scope -func (s *auth) DeleteScope(ctx context.Context, request operations.DeleteScopeRequest) (*operations.DeleteScopeResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + rawBody, err := io.ReadAll(httpRes.Body) 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.DeleteScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - -// DeleteScopeFromClient - Delete scope from client -func (s *auth) DeleteScopeFromClient(ctx context.Context, request operations.DeleteScopeFromClientRequest) (*operations.DeleteScopeFromClientResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.DeleteScopeFromClientResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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: } @@ -399,7 +198,7 @@ func (s *auth) DeleteScopeFromClient(ctx context.Context, request operations.Del // DeleteSecret - Delete a secret from a client func (s *auth) DeleteSecret(ctx context.Context, request operations.DeleteSecretRequest) (*operations.DeleteSecretResponse, error) { - baseURL := s.serverURL + 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) @@ -410,9 +209,9 @@ func (s *auth) DeleteSecret(ctx context.Context, request operations.DeleteSecret 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -421,7 +220,6 @@ func (s *auth) DeleteSecret(ctx context.Context, request operations.DeleteSecret if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -430,47 +228,13 @@ func (s *auth) DeleteSecret(ctx context.Context, request operations.DeleteSecret ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} -// DeleteTransientScope - Delete a transient scope from a scope -// Delete a transient scope from a scope -func (s *auth) DeleteTransientScope(ctx context.Context, request operations.DeleteTransientScopeRequest) (*operations.DeleteTransientScopeResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}/transient/{transientScopeId}", request, nil) + rawBody, err := io.ReadAll(httpRes.Body) 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.DeleteTransientScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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: } @@ -480,7 +244,7 @@ func (s *auth) DeleteTransientScope(ctx context.Context, request operations.Dele // GetServerInfo - Get server info func (s *auth) 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) @@ -488,9 +252,9 @@ func (s *auth) GetServerInfo(ctx context.Context) (*operations.GetServerInfoResp 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -499,7 +263,6 @@ func (s *auth) GetServerInfo(ctx context.Context) (*operations.GetServerInfoResp if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -508,16 +271,25 @@ func (s *auth) GetServerInfo(ctx context.Context) (*operations.GetServerInfoResp 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 { 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) } } @@ -526,7 +298,7 @@ func (s *auth) GetServerInfo(ctx context.Context) (*operations.GetServerInfoResp // ListClients - List clients func (s *auth) 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) @@ -534,9 +306,9 @@ func (s *auth) ListClients(ctx context.Context) (*operations.ListClientsResponse 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -545,7 +317,6 @@ func (s *auth) ListClients(ctx context.Context) (*operations.ListClientsResponse if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -554,63 +325,25 @@ func (s *auth) ListClients(ctx context.Context) (*operations.ListClientsResponse ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListClientsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ListClientsResponse = out - } - } - - return res, nil -} - -// ListScopes - List scopes -// List Scopes -func (s *auth) ListScopes(ctx context.Context) (*operations.ListScopesResponse, error) { - baseURL := s.serverURL - url := strings.TrimSuffix(baseURL, "/") + "/api/auth/scopes" - req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + rawBody, err := io.ReadAll(httpRes.Body) 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListScopesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListScopesResponse - 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.ListScopesResponse = out + res.ListClientsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -620,7 +353,7 @@ func (s *auth) ListScopes(ctx context.Context) (*operations.ListScopesResponse, // ListUsers - List users // List users func (s *auth) 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) @@ -628,9 +361,9 @@ func (s *auth) ListUsers(ctx context.Context) (*operations.ListUsersResponse, er 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -639,7 +372,6 @@ func (s *auth) ListUsers(ctx context.Context) (*operations.ListUsersResponse, er if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -648,16 +380,25 @@ func (s *auth) ListUsers(ctx context.Context) (*operations.ListUsersResponse, er 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 { 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) } } @@ -666,7 +407,7 @@ func (s *auth) ListUsers(ctx context.Context) (*operations.ListUsersResponse, er // ReadClient - Read client func (s *auth) ReadClient(ctx context.Context, request operations.ReadClientRequest) (*operations.ReadClientResponse, error) { - baseURL := s.serverURL + 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) @@ -677,9 +418,9 @@ func (s *auth) ReadClient(ctx context.Context, request operations.ReadClientRequ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -688,7 +429,6 @@ func (s *auth) ReadClient(ctx context.Context, request operations.ReadClientRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -697,66 +437,25 @@ func (s *auth) ReadClient(ctx context.Context, request operations.ReadClientRequ ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ReadClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ReadClientResponse = out - } - } - - return res, nil -} -// ReadScope - Read scope -// Read scope -func (s *auth) ReadScope(ctx context.Context, request operations.ReadScopeRequest) (*operations.ReadScopeResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/auth/scopes/{scopeId}", request, nil) + rawBody, err := io.ReadAll(httpRes.Body) 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ReadScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ReadScopeResponse - 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.ReadScopeResponse = out + res.ReadClientResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -766,7 +465,7 @@ func (s *auth) ReadScope(ctx context.Context, request operations.ReadScopeReques // ReadUser - Read user // Read user func (s *auth) ReadUser(ctx context.Context, request operations.ReadUserRequest) (*operations.ReadUserResponse, error) { - baseURL := s.serverURL + 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) @@ -777,9 +476,9 @@ func (s *auth) 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -788,7 +487,6 @@ func (s *auth) ReadUser(ctx context.Context, request operations.ReadUserRequest) if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -797,16 +495,25 @@ func (s *auth) 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 { 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) } } @@ -815,13 +522,13 @@ func (s *auth) ReadUser(ctx context.Context, request operations.ReadUserRequest) // UpdateClient - Update client func (s *auth) UpdateClient(ctx context.Context, request operations.UpdateClientRequest) (*operations.UpdateClientResponse, error) { - baseURL := s.serverURL + 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) } @@ -831,11 +538,11 @@ func (s *auth) UpdateClient(ctx context.Context, request operations.UpdateClient 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -844,7 +551,6 @@ func (s *auth) UpdateClient(ctx context.Context, request operations.UpdateClient if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -853,73 +559,25 @@ func (s *auth) UpdateClient(ctx context.Context, request operations.UpdateClient ContentType: contentType, RawResponse: httpRes, } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.UpdateClientResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.UpdateClientResponse = out - } - } - - return res, nil -} - -// UpdateScope - Update scope -// Update scope -func (s *auth) UpdateScope(ctx context.Context, request operations.UpdateScopeRequest) (*operations.UpdateScopeResponse, error) { - baseURL := s.serverURL - 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") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - httpRes, err := client.Do(req) + rawBody, err := io.ReadAll(httpRes.Body) if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.UpdateScopeResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, + 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.UpdateScopeResponse - 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.UpdateScopeResponse = 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/auth/README.md b/docs/auth/README.md deleted file mode 100755 index 16c94a6a..00000000 --- a/docs/auth/README.md +++ /dev/null @@ -1,783 +0,0 @@ -# Auth - -### Available Operations - -* [AddScopeToClient](#addscopetoclient) - Add scope to client -* [AddTransientScope](#addtransientscope) - Add a transient scope to a scope -* [CreateClient](#createclient) - Create client -* [CreateScope](#createscope) - Create scope -* [CreateSecret](#createsecret) - Add a secret to a client -* [DeleteClient](#deleteclient) - Delete client -* [DeleteScope](#deletescope) - Delete scope -* [DeleteScopeFromClient](#deletescopefromclient) - Delete scope from client -* [DeleteSecret](#deletesecret) - Delete a secret from a client -* [DeleteTransientScope](#deletetransientscope) - Delete a transient scope from a scope -* [GetServerInfo](#getserverinfo) - Get server info -* [ListClients](#listclients) - List clients -* [ListScopes](#listscopes) - List scopes -* [ListUsers](#listusers) - List users -* [ReadClient](#readclient) - Read client -* [ReadScope](#readscope) - Read scope -* [ReadUser](#readuser) - Read user -* [UpdateClient](#updateclient) - Update client -* [UpdateScope](#updatescope) - Update scope - -## AddScopeToClient - -Add scope to client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.AddScopeToClient(ctx, operations.AddScopeToClientRequest{ - ClientID: "corrupti", - ScopeID: "provident", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## AddTransientScope - -Add a transient scope to a scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.AddTransientScope(ctx, operations.AddTransientScopeRequest{ - ScopeID: "distinctio", - TransientScopeID: "quibusdam", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CreateClient - -Create client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.CreateClient(ctx, shared.CreateClientRequest{ - Description: formance.String("unde"), - Metadata: map[string]interface{}{ - "corrupti": "illum", - "vel": "error", - "deserunt": "suscipit", - "iure": "magnam", - }, - Name: "Larry Windler", - PostLogoutRedirectUris: []string{ - "minus", - "placeat", - }, - Public: formance.Bool(false), - RedirectUris: []string{ - "iusto", - "excepturi", - "nisi", - }, - Trusted: formance.Bool(false), - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateClientResponse != nil { - // handle response - } -} -``` - -## CreateScope - -Create scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.CreateScope(ctx, shared.CreateScopeRequest{ - Label: "recusandae", - Metadata: map[string]interface{}{ - "ab": "quis", - "veritatis": "deserunt", - "perferendis": "ipsam", - "repellendus": "sapiente", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateScopeResponse != nil { - // handle response - } -} -``` - -## CreateSecret - -Add a secret to a client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.CreateSecret(ctx, operations.CreateSecretRequest{ - CreateSecretRequest: &shared.CreateSecretRequest{ - Metadata: map[string]interface{}{ - "odit": "at", - "at": "maiores", - "molestiae": "quod", - "quod": "esse", - }, - Name: "Miss Lowell Parisian", - }, - ClientID: "occaecati", - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateSecretResponse != nil { - // handle response - } -} -``` - -## DeleteClient - -Delete client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.DeleteClient(ctx, operations.DeleteClientRequest{ - ClientID: "fugit", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## DeleteScope - -Delete scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.DeleteScope(ctx, operations.DeleteScopeRequest{ - ScopeID: "deleniti", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## DeleteScopeFromClient - -Delete scope from client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.DeleteScopeFromClient(ctx, operations.DeleteScopeFromClientRequest{ - ClientID: "hic", - ScopeID: "optio", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## DeleteSecret - -Delete a secret from a client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.DeleteSecret(ctx, operations.DeleteSecretRequest{ - ClientID: "totam", - SecretID: "beatae", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## DeleteTransientScope - -Delete a transient scope from a scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.DeleteTransientScope(ctx, operations.DeleteTransientScopeRequest{ - ScopeID: "commodi", - TransientScopeID: "molestiae", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## GetServerInfo - -Get server info - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.GetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } -} -``` - -## ListClients - -List clients - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ListClients(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ListClientsResponse != nil { - // handle response - } -} -``` - -## ListScopes - -List Scopes - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ListScopes(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ListScopesResponse != nil { - // handle response - } -} -``` - -## ListUsers - -List users - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ListUsers(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ListUsersResponse != nil { - // handle response - } -} -``` - -## ReadClient - -Read client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ReadClient(ctx, operations.ReadClientRequest{ - ClientID: "modi", - }) - if err != nil { - log.Fatal(err) - } - - if res.ReadClientResponse != nil { - // handle response - } -} -``` - -## ReadScope - -Read scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ReadScope(ctx, operations.ReadScopeRequest{ - ScopeID: "qui", - }) - if err != nil { - log.Fatal(err) - } - - if res.ReadScopeResponse != nil { - // handle response - } -} -``` - -## ReadUser - -Read user - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.ReadUser(ctx, operations.ReadUserRequest{ - UserID: "impedit", - }) - if err != nil { - log.Fatal(err) - } - - if res.ReadUserResponse != nil { - // handle response - } -} -``` - -## UpdateClient - -Update client - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.UpdateClient(ctx, operations.UpdateClientRequest{ - UpdateClientRequest: &shared.UpdateClientRequest{ - Description: formance.String("cum"), - Metadata: map[string]interface{}{ - "ipsum": "excepturi", - "aspernatur": "perferendis", - }, - Name: "Faye Cormier", - PostLogoutRedirectUris: []string{ - "laboriosam", - "hic", - "saepe", - }, - Public: formance.Bool(false), - RedirectUris: []string{ - "in", - "corporis", - "iste", - }, - Trusted: formance.Bool(false), - }, - ClientID: "iure", - }) - if err != nil { - log.Fatal(err) - } - - if res.UpdateClientResponse != nil { - // handle response - } -} -``` - -## UpdateScope - -Update scope - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Auth.UpdateScope(ctx, operations.UpdateScopeRequest{ - UpdateScopeRequest: &shared.UpdateScopeRequest{ - Label: "saepe", - Metadata: map[string]interface{}{ - "architecto": "ipsa", - "reiciendis": "est", - "mollitia": "laborum", - }, - }, - ScopeID: "dolores", - }) - if err != nil { - log.Fatal(err) - } - - if res.UpdateScopeResponse != nil { - // handle response - } -} -``` diff --git a/docs/flows/README.md b/docs/flows/README.md deleted file mode 100755 index cd4a039a..00000000 --- a/docs/flows/README.md +++ /dev/null @@ -1,475 +0,0 @@ -# Flows - -### Available Operations - -* [CancelEvent](#cancelevent) - Cancel a running workflow -* [CreateWorkflow](#createworkflow) - Create workflow -* [DeleteWorkflow](#deleteworkflow) - Delete a flow by id -* [GetInstance](#getinstance) - Get a workflow instance by id -* [GetInstanceHistory](#getinstancehistory) - Get a workflow instance history by id -* [GetInstanceStageHistory](#getinstancestagehistory) - Get a workflow instance stage history -* [GetWorkflow](#getworkflow) - Get a flow by id -* [ListInstances](#listinstances) - List instances of a workflow -* [ListWorkflows](#listworkflows) - List registered workflows -* [OrchestrationgetServerInfo](#orchestrationgetserverinfo) - Get server info -* [RunWorkflow](#runworkflow) - Run workflow -* [SendEvent](#sendevent) - Send an event to a running workflow - -## CancelEvent - -Cancel a running workflow - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.CancelEvent(ctx, operations.CancelEventRequest{ - InstanceID: "dolorem", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CreateWorkflow - -Create a workflow - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.CreateWorkflow(ctx, shared.CreateWorkflowRequest{ - Name: formance.String("Rose Rolfson"), - Stages: []map[string]interface{}{ - map[string]interface{}{ - "excepturi": "accusantium", - "iure": "culpa", - }, - map[string]interface{}{ - "sapiente": "architecto", - "mollitia": "dolorem", - "culpa": "consequuntur", - "repellat": "mollitia", - }, - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateWorkflowResponse != nil { - // handle response - } -} -``` - -## DeleteWorkflow - -Delete a flow by id - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.DeleteWorkflow(ctx, operations.DeleteWorkflowRequest{ - FlowID: "occaecati", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## GetInstance - -Get a workflow instance by id - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.GetInstance(ctx, operations.GetInstanceRequest{ - InstanceID: "numquam", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWorkflowInstanceResponse != nil { - // handle response - } -} -``` - -## GetInstanceHistory - -Get a workflow instance history by id - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.GetInstanceHistory(ctx, operations.GetInstanceHistoryRequest{ - InstanceID: "commodi", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWorkflowInstanceHistoryResponse != nil { - // handle response - } -} -``` - -## GetInstanceStageHistory - -Get a workflow instance stage history - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.GetInstanceStageHistory(ctx, operations.GetInstanceStageHistoryRequest{ - InstanceID: "quam", - Number: 474697, - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWorkflowInstanceHistoryStageResponse != nil { - // handle response - } -} -``` - -## GetWorkflow - -Get a flow by id - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.GetWorkflow(ctx, operations.GetWorkflowRequest{ - FlowID: "velit", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWorkflowResponse != nil { - // handle response - } -} -``` - -## ListInstances - -List instances of a workflow - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.ListInstances(ctx, operations.ListInstancesRequest{ - Running: formance.Bool(false), - WorkflowID: formance.String("error"), - }) - if err != nil { - log.Fatal(err) - } - - if res.ListRunsResponse != nil { - // handle response - } -} -``` - -## ListWorkflows - -List registered workflows - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.ListWorkflows(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ListWorkflowsResponse != nil { - // handle response - } -} -``` - -## OrchestrationgetServerInfo - -Get server info - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.OrchestrationgetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } -} -``` - -## RunWorkflow - -Run workflow - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.RunWorkflow(ctx, operations.RunWorkflowRequest{ - RequestBody: map[string]string{ - "quis": "vitae", - }, - Wait: formance.Bool(false), - WorkflowID: "laborum", - }) - if err != nil { - log.Fatal(err) - } - - if res.RunWorkflowResponse != nil { - // handle response - } -} -``` - -## SendEvent - -Send an event to a running workflow - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Flows.SendEvent(ctx, operations.SendEventRequest{ - RequestBody: &operations.SendEventRequestBody{ - Name: "Bill Conn", - }, - InstanceID: "tenetur", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` diff --git a/docs/formance/README.md b/docs/formance/README.md deleted file mode 100755 index dbb874f3..00000000 --- a/docs/formance/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Formance SDK - -## Overview - -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 - -* [GetVersions](#getversions) - Show stack version information - -## GetVersions - -Show stack version information - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Formance.GetVersions(ctx) - if err != nil { - log.Fatal(err) - } - - if res.GetVersionsResponse != nil { - // handle response - } -} -``` diff --git a/docs/ledger/README.md b/docs/ledger/README.md deleted file mode 100755 index 2cbc3cbc..00000000 --- a/docs/ledger/README.md +++ /dev/null @@ -1,984 +0,0 @@ -# Ledger - -### Available Operations - -* [CreateTransactions](#createtransactions) - Create a new batch of transactions to a ledger -* [AddMetadataOnTransaction](#addmetadataontransaction) - Set the metadata of a transaction by its ID -* [AddMetadataToAccount](#addmetadatatoaccount) - Add metadata to an account -* [CountAccounts](#countaccounts) - Count the accounts from a ledger -* [CountTransactions](#counttransactions) - Count the transactions from a ledger -* [CreateTransaction](#createtransaction) - Create a new transaction to a ledger -* [GetAccount](#getaccount) - Get account by its address -* [GetBalances](#getbalances) - Get the balances from a ledger's account -* [GetBalancesAggregated](#getbalancesaggregated) - Get the aggregated balances from selected accounts -* [GetInfo](#getinfo) - Show server information -* [GetLedgerInfo](#getledgerinfo) - Get information about a ledger -* [GetMapping](#getmapping) - Get the mapping of a ledger -* [GetTransaction](#gettransaction) - Get transaction from a ledger by its ID -* [ListAccounts](#listaccounts) - List accounts from a ledger -* [ListLogs](#listlogs) - List the logs from a ledger -* [ListTransactions](#listtransactions) - List transactions from a ledger -* [ReadStats](#readstats) - Get statistics from a ledger -* [RevertTransaction](#reverttransaction) - Revert a ledger transaction by its ID -* [~~RunScript~~](#runscript) - Execute a Numscript :warning: **Deprecated** -* [UpdateMapping](#updatemapping) - Update the mapping of a ledger - -## CreateTransactions - -Create a new batch of transactions to a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" - "github.com/formancehq/formance-sdk-go/pkg/types" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.CreateTransactions(ctx, operations.CreateTransactionsRequest{ - Transactions: shared.Transactions{ - Transactions: []shared.TransactionData{ - shared.TransactionData{ - Metadata: map[string]interface{}{ - "possimus": "aut", - "quasi": "error", - "temporibus": "laborum", - }, - Postings: []shared.Posting{ - shared.Posting{ - Amount: big.NewInt(100), - Asset: "COIN", - Destination: "users:002", - Source: "users:001", - }, - }, - Reference: formance.String("ref:001"), - Timestamp: types.MustTimeFromString("2020-01-27T18:38:42.890Z"), - }, - shared.TransactionData{ - Metadata: map[string]interface{}{ - "nihil": "praesentium", - "voluptatibus": "ipsa", - "omnis": "voluptate", - "cum": "perferendis", - }, - Postings: []shared.Posting{ - shared.Posting{ - Amount: big.NewInt(100), - Asset: "COIN", - Destination: "users:002", - Source: "users:001", - }, - }, - Reference: formance.String("ref:001"), - Timestamp: types.MustTimeFromString("2022-09-19T18:36:39.009Z"), - }, - }, - }, - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.TransactionsResponse != nil { - // handle response - } -} -``` - -## AddMetadataOnTransaction - -Set the metadata of a transaction by its ID - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ - RequestBody: map[string]interface{}{ - "dicta": "corporis", - "dolore": "iusto", - "dicta": "harum", - "enim": "accusamus", - }, - Ledger: "ledger001", - Txid: 1234, - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## AddMetadataToAccount - -Add metadata to an account - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ - RequestBody: map[string]interface{}{ - "repudiandae": "quae", - "ipsum": "quidem", - }, - Address: "users:001", - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CountAccounts - -Count the accounts from a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.CountAccounts(ctx, operations.CountAccountsRequest{ - Address: formance.String("users:.+"), - Ledger: "ledger001", - Metadata: map[string]interface{}{ - "excepturi": "pariatur", - "modi": "praesentium", - "rem": "voluptates", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CountTransactions - -Count the transactions from a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/types" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.CountTransactions(ctx, operations.CountTransactionsRequest{ - Account: formance.String("users:001"), - Destination: formance.String("users:001"), - EndTime: types.MustTimeFromString("2022-01-29T18:39:33.469Z"), - Ledger: "ledger001", - Metadata: map[string]interface{}{ - "veritatis": "itaque", - "incidunt": "enim", - "consequatur": "est", - }, - Reference: formance.String("ref:001"), - Source: formance.String("users:001"), - StartTime: types.MustTimeFromString("2022-08-09T16:21:07.003Z"), - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CreateTransaction - -Create a new transaction to a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" - "github.com/formancehq/formance-sdk-go/pkg/types" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.CreateTransaction(ctx, operations.CreateTransactionRequest{ - PostTransaction: shared.PostTransaction{ - Metadata: map[string]interface{}{ - "distinctio": "quibusdam", - "labore": "modi", - "qui": "aliquid", - }, - Postings: []shared.Posting{ - shared.Posting{ - Amount: big.NewInt(100), - Asset: "COIN", - Destination: "users:002", - Source: "users:001", - }, - shared.Posting{ - Amount: big.NewInt(100), - Asset: "COIN", - Destination: "users:002", - Source: "users:001", - }, - shared.Posting{ - Amount: big.NewInt(100), - Asset: "COIN", - Destination: "users:002", - Source: "users:001", - }, - }, - Reference: formance.String("ref:001"), - Script: &shared.PostTransactionScript{ - Plain: "vars { - account $user - } - send [COIN 10] ( - source = @world - destination = $user - ) - ", - Vars: map[string]interface{}{ - "perferendis": "magni", - "assumenda": "ipsam", - "alias": "fugit", - }, - }, - Timestamp: types.MustTimeFromString("2021-11-11T04:17:07.569Z"), - }, - Ledger: "ledger001", - Preview: formance.Bool(true), - }) - if err != nil { - log.Fatal(err) - } - - if res.TransactionsResponse != nil { - // handle response - } -} -``` - -## GetAccount - -Get account by its address - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetAccount(ctx, operations.GetAccountRequest{ - Address: "users:001", - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.AccountResponse != nil { - // handle response - } -} -``` - -## GetBalances - -Get the balances from a ledger's account - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetBalances(ctx, operations.GetBalancesRequest{ - Address: formance.String("users:001"), - After: formance.String("users:003"), - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Ledger: "ledger001", - PaginationToken: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - }) - if err != nil { - log.Fatal(err) - } - - if res.BalancesCursorResponse != nil { - // handle response - } -} -``` - -## GetBalancesAggregated - -Get the aggregated balances from selected accounts - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetBalancesAggregated(ctx, operations.GetBalancesAggregatedRequest{ - Address: formance.String("users:001"), - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.AggregateBalancesResponse != nil { - // handle response - } -} -``` - -## GetInfo - -Show server information - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ConfigInfoResponse != nil { - // handle response - } -} -``` - -## GetLedgerInfo - -Get information about a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - 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 - } -} -``` - -## GetMapping - -Get the mapping of a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetMapping(ctx, operations.GetMappingRequest{ - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.MappingResponse != nil { - // handle response - } -} -``` - -## GetTransaction - -Get transaction from a ledger by its ID - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.GetTransaction(ctx, operations.GetTransactionRequest{ - Ledger: "ledger001", - Txid: 1234, - }) - if err != nil { - log.Fatal(err) - } - - if res.TransactionResponse != nil { - // handle response - } -} -``` - -## ListAccounts - -List accounts from a ledger, sorted by address in descending order. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "math/big" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.ListAccounts(ctx, operations.ListAccountsRequest{ - Address: formance.String("users:.+"), - After: formance.String("users:003"), - Balance: big.NewInt(2400), - BalanceOperator: operations.ListAccountsBalanceOperatorGte.ToPointer(), - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Ledger: "ledger001", - Metadata: map[string]interface{}{ - "facilis": "tempore", - "labore": "delectus", - }, - PageSize: formance.Int64(433288), - PaginationToken: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - }) - if err != nil { - log.Fatal(err) - } - - if res.AccountsCursorResponse != nil { - // handle response - } -} -``` - -## ListLogs - -List the logs from a ledger, sorted by ID in descending order. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/types" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.ListLogs(ctx, operations.ListLogsRequest{ - After: formance.String("1234"), - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - EndTime: types.MustTimeFromString("2022-03-31T00:30:19.135Z"), - Ledger: "ledger001", - PageSize: formance.Int64(576157), - PaginationToken: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - StartTime: types.MustTimeFromString("2022-05-29T21:42:45.399Z"), - }) - if err != nil { - log.Fatal(err) - } - - if res.LogsCursorResponse != nil { - // handle response - } -} -``` - -## ListTransactions - -List transactions from a ledger, sorted by txid in descending order. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/types" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.ListTransactions(ctx, operations.ListTransactionsRequest{ - Account: formance.String("users:001"), - After: formance.String("1234"), - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Destination: formance.String("users:001"), - EndTime: types.MustTimeFromString("2021-04-14T09:13:11.675Z"), - Ledger: "ledger001", - Metadata: map[string]interface{}{ - "dolor": "debitis", - "a": "dolorum", - "in": "in", - }, - PageSize: formance.Int64(846409), - PaginationToken: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Reference: formance.String("ref:001"), - Source: formance.String("users:001"), - StartTime: types.MustTimeFromString("2020-11-26T01:41:04.216Z"), - }) - if err != nil { - log.Fatal(err) - } - - if res.TransactionsCursorResponse != nil { - // handle response - } -} -``` - -## ReadStats - -Get statistics from a ledger. (aggregate metrics on accounts and transactions) - - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.ReadStats(ctx, operations.ReadStatsRequest{ - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatsResponse != nil { - // handle response - } -} -``` - -## RevertTransaction - -Revert a ledger transaction by its ID - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.RevertTransaction(ctx, operations.RevertTransactionRequest{ - DisableChecks: formance.Bool(false), - Ledger: "ledger001", - Txid: 1234, - }) - if err != nil { - log.Fatal(err) - } - - if res.TransactionResponse != nil { - // handle response - } -} -``` - -## ~~RunScript~~ - -This route is deprecated, and has been merged into `POST /{ledger}/transactions`. - - -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.RunScript(ctx, operations.RunScriptRequest{ - Script: shared.Script{ - Metadata: map[string]interface{}{ - "magnam": "cumque", - }, - Plain: "vars { - account $user - } - send [COIN 10] ( - source = @world - destination = $user - ) - ", - Reference: formance.String("order_1234"), - Vars: map[string]interface{}{ - "ea": "aliquid", - "laborum": "accusamus", - "non": "occaecati", - "enim": "accusamus", - }, - }, - Ledger: "ledger001", - Preview: formance.Bool(true), - }) - if err != nil { - log.Fatal(err) - } - - if res.ScriptResponse != nil { - // handle response - } -} -``` - -## UpdateMapping - -Update the mapping of a ledger - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Ledger.UpdateMapping(ctx, operations.UpdateMappingRequest{ - Mapping: shared.Mapping{ - Contracts: []shared.Contract{ - shared.Contract{ - Account: formance.String("users:001"), - Expr: map[string]interface{}{ - "provident": "nam", - "id": "blanditiis", - "deleniti": "sapiente", - }, - }, - shared.Contract{ - Account: formance.String("users:001"), - Expr: map[string]interface{}{ - "deserunt": "nisi", - }, - }, - shared.Contract{ - Account: formance.String("users:001"), - Expr: map[string]interface{}{ - "natus": "omnis", - "molestiae": "perferendis", - }, - }, - shared.Contract{ - Account: formance.String("users:001"), - Expr: map[string]interface{}{ - "magnam": "distinctio", - "id": "labore", - }, - }, - }, - }, - Ledger: "ledger001", - }) - if err != nil { - log.Fatal(err) - } - - if res.MappingResponse != nil { - // handle response - } -} -``` diff --git a/docs/models/operations/activateconfigrequest.md b/docs/models/operations/activateconfigrequest.md new file mode 100755 index 00000000..42799328 --- /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 00000000..8a9db7b0 --- /dev/null +++ b/docs/models/operations/activateconfigresponse.md @@ -0,0 +1,12 @@ +# ActivateConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully activated. | +| `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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..388dfa8a --- /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` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..37afeaac --- /dev/null +++ b/docs/models/operations/addmetadataontransactionresponse.md @@ -0,0 +1,11 @@ +# AddMetadataOnTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `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: | 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/addmetadatatoaccountrequest.md b/docs/models/operations/addmetadatatoaccountrequest.md new file mode 100755 index 00000000..ebbf36dc --- /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 00000000..2a990683 --- /dev/null +++ b/docs/models/operations/addmetadatatoaccountresponse.md @@ -0,0 +1,11 @@ +# AddMetadataToAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `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: | 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/canceleventrequest.md b/docs/models/operations/canceleventrequest.md new file mode 100755 index 00000000..7c991ef4 --- /dev/null +++ b/docs/models/operations/canceleventrequest.md @@ -0,0 +1,8 @@ +# CancelEventRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/canceleventresponse.md b/docs/models/operations/canceleventresponse.md new file mode 100755 index 00000000..f3d5c806 --- /dev/null +++ b/docs/models/operations/canceleventresponse.md @@ -0,0 +1,11 @@ +# CancelEventResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `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/changeconfigsecretrequest.md b/docs/models/operations/changeconfigsecretrequest.md new file mode 100755 index 00000000..a71d6bd1 --- /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 00000000..8257c52d --- /dev/null +++ b/docs/models/operations/changeconfigsecretresponse.md @@ -0,0 +1,12 @@ +# ChangeConfigSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Secret successfully changed. | +| `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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..92532227 --- /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 00000000..f0058455 --- /dev/null +++ b/docs/models/operations/confirmholdresponse.md @@ -0,0 +1,11 @@ +# ConfirmHoldResponse + + +## Fields + +| 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 | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..2a411cfe --- /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` | map[string]*interface{}* | :heavy_minus_sign: | Filter accounts by metadata key value pairs. The filter can be used like this metadata[key]=value1&metadata[a.nested.key]=value2 | | \ 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 00000000..54f910b7 --- /dev/null +++ b/docs/models/operations/countaccountsresponse.md @@ -0,0 +1,12 @@ +# CountAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `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: | 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/counttransactionsmetadata.md b/docs/models/operations/counttransactionsmetadata.md new file mode 100755 index 00000000..bd9fe8c3 --- /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 00000000..304b45f6 --- /dev/null +++ b/docs/models/operations/counttransactionsrequest.md @@ -0,0 +1,15 @@ +# 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).
| | +| `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).
| | \ 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 00000000..12cf5134 --- /dev/null +++ b/docs/models/operations/counttransactionsresponse.md @@ -0,0 +1,12 @@ +# CountTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `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: | 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/createbalancerequest.md b/docs/models/operations/createbalancerequest.md new file mode 100755 index 00000000..efa17818 --- /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 00000000..32885523 --- /dev/null +++ b/docs/models/operations/createbalanceresponse.md @@ -0,0 +1,12 @@ +# CreateBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..0ae3736c --- /dev/null +++ b/docs/models/operations/createclientresponse.md @@ -0,0 +1,11 @@ +# CreateClientResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/createpolicyresponse.md b/docs/models/operations/createpolicyresponse.md new file mode 100755 index 00000000..4328d395 --- /dev/null +++ b/docs/models/operations/createpolicyresponse.md @@ -0,0 +1,12 @@ +# CreatePolicyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `PolicyResponse` | [*shared.PolicyResponse](../../models/shared/policyresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ 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 00000000..489a03ad --- /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 00000000..f2ebbae8 --- /dev/null +++ b/docs/models/operations/createsecretresponse.md @@ -0,0 +1,11 @@ +# CreateSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/createtransactionrequest.md b/docs/models/operations/createtransactionrequest.md new file mode 100755 index 00000000..2603d412 --- /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 00000000..ed876676 --- /dev/null +++ b/docs/models/operations/createtransactionresponse.md @@ -0,0 +1,12 @@ +# CreateTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/createtransactionsrequest.md b/docs/models/operations/createtransactionsrequest.md new file mode 100755 index 00000000..87a865c8 --- /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 00000000..ce2d90d0 --- /dev/null +++ b/docs/models/operations/createtransactionsresponse.md @@ -0,0 +1,12 @@ +# CreateTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/createtriggerresponse.md b/docs/models/operations/createtriggerresponse.md new file mode 100755 index 00000000..0443e56d --- /dev/null +++ b/docs/models/operations/createtriggerresponse.md @@ -0,0 +1,12 @@ +# CreateTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `CreateTriggerResponse` | [*shared.CreateTriggerResponse](../../models/shared/createtriggerresponse.md) | :heavy_minus_sign: | Created trigger | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `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/createwalletresponse.md b/docs/models/operations/createwalletresponse.md new file mode 100755 index 00000000..d0592f15 --- /dev/null +++ b/docs/models/operations/createwalletresponse.md @@ -0,0 +1,12 @@ +# CreateWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..1b1d6aaa --- /dev/null +++ b/docs/models/operations/createworkflowresponse.md @@ -0,0 +1,12 @@ +# CreateWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `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: | 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/creditwalletrequest.md b/docs/models/operations/creditwalletrequest.md new file mode 100755 index 00000000..00360380 --- /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 00000000..4f1ec99b --- /dev/null +++ b/docs/models/operations/creditwalletresponse.md @@ -0,0 +1,11 @@ +# CreditWalletResponse + + +## Fields + +| 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 | +| `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 00000000..2604bd4b --- /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 00000000..d8abe50a --- /dev/null +++ b/docs/models/operations/deactivateconfigresponse.md @@ -0,0 +1,12 @@ +# DeactivateConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ConfigResponse` | [*shared.ConfigResponse](../../models/shared/configresponse.md) | :heavy_minus_sign: | Config successfully deactivated. | +| `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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..afcfd7ff --- /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 00000000..a8b527bd --- /dev/null +++ b/docs/models/operations/debitwalletresponse.md @@ -0,0 +1,12 @@ +# DebitWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/deleteclientrequest.md b/docs/models/operations/deleteclientrequest.md new file mode 100755 index 00000000..44fe54ff --- /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 00000000..ac17a0a6 --- /dev/null +++ b/docs/models/operations/deleteclientresponse.md @@ -0,0 +1,10 @@ +# DeleteClientResponse + + +## Fields + +| 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/deleteconfigrequest.md b/docs/models/operations/deleteconfigrequest.md new file mode 100755 index 00000000..e143e30b --- /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 00000000..59c26838 --- /dev/null +++ b/docs/models/operations/deleteconfigresponse.md @@ -0,0 +1,11 @@ +# DeleteConfigResponse + + +## Fields + +| 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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deletepolicyrequest.md b/docs/models/operations/deletepolicyrequest.md new file mode 100755 index 00000000..08ca962a --- /dev/null +++ b/docs/models/operations/deletepolicyrequest.md @@ -0,0 +1,8 @@ +# DeletePolicyRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `PolicyID` | *string* | :heavy_check_mark: | The policy ID. | \ No newline at end of file diff --git a/docs/models/operations/deletepolicyresponse.md b/docs/models/operations/deletepolicyresponse.md new file mode 100755 index 00000000..441575c7 --- /dev/null +++ b/docs/models/operations/deletepolicyresponse.md @@ -0,0 +1,11 @@ +# DeletePolicyResponse + + +## Fields + +| 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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ 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 00000000..0091443f --- /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 00000000..d59ea6bb --- /dev/null +++ b/docs/models/operations/deletesecretresponse.md @@ -0,0 +1,10 @@ +# DeleteSecretResponse + + +## Fields + +| 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/deletetriggerrequest.md b/docs/models/operations/deletetriggerrequest.md new file mode 100755 index 00000000..feb6d395 --- /dev/null +++ b/docs/models/operations/deletetriggerrequest.md @@ -0,0 +1,8 @@ +# DeleteTriggerRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/deletetriggerresponse.md b/docs/models/operations/deletetriggerresponse.md new file mode 100755 index 00000000..517297e1 --- /dev/null +++ b/docs/models/operations/deletetriggerresponse.md @@ -0,0 +1,11 @@ +# DeleteTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `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/deleteworkflowrequest.md b/docs/models/operations/deleteworkflowrequest.md new file mode 100755 index 00000000..9bddccd8 --- /dev/null +++ b/docs/models/operations/deleteworkflowrequest.md @@ -0,0 +1,8 @@ +# DeleteWorkflowRequest + + +## 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/deleteworkflowresponse.md b/docs/models/operations/deleteworkflowresponse.md new file mode 100755 index 00000000..471eef4f --- /dev/null +++ b/docs/models/operations/deleteworkflowresponse.md @@ -0,0 +1,11 @@ +# DeleteWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `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/getaccountrequest.md b/docs/models/operations/getaccountrequest.md new file mode 100755 index 00000000..e7c7fcf3 --- /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 00000000..4f69b0ee --- /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: | HTTP response content type for this operation | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `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/getapiauthwellknownopenidconfigurationresponse.md b/docs/models/operations/getapiauthwellknownopenidconfigurationresponse.md new file mode 100755 index 00000000..4090e8a0 --- /dev/null +++ b/docs/models/operations/getapiauthwellknownopenidconfigurationresponse.md @@ -0,0 +1,10 @@ +# GetAPIAuthWellKnownOpenidConfigurationResponse + + +## Fields + +| 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/getbalancerequest.md b/docs/models/operations/getbalancerequest.md new file mode 100755 index 00000000..27f8cfb5 --- /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 00000000..6bdd936f --- /dev/null +++ b/docs/models/operations/getbalanceresponse.md @@ -0,0 +1,12 @@ +# GetBalanceResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/getbalancesaggregatedrequest.md b/docs/models/operations/getbalancesaggregatedrequest.md new file mode 100755 index 00000000..99a64f8d --- /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 00000000..8729b46b --- /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: | HTTP response content type for this operation | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `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/getbalancesrequest.md b/docs/models/operations/getbalancesrequest.md new file mode 100755 index 00000000..bdcceea9 --- /dev/null +++ b/docs/models/operations/getbalancesrequest.md @@ -0,0 +1,11 @@ +# 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 | \ 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 00000000..fcad2566 --- /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: | HTTP response content type for this operation | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `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/getholdrequest.md b/docs/models/operations/getholdrequest.md new file mode 100755 index 00000000..2dfc2a87 --- /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 00000000..16764056 --- /dev/null +++ b/docs/models/operations/getholdresponse.md @@ -0,0 +1,12 @@ +# GetHoldResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/getholdsrequest.md b/docs/models/operations/getholdsrequest.md new file mode 100755 index 00000000..f654cf6d --- /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` | map[string]*string* | :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 00000000..eda9419c --- /dev/null +++ b/docs/models/operations/getholdsresponse.md @@ -0,0 +1,12 @@ +# GetHoldsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..835462c0 --- /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: | HTTP response content type for this operation | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `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/getinstancehistoryrequest.md b/docs/models/operations/getinstancehistoryrequest.md new file mode 100755 index 00000000..4e0e28b7 --- /dev/null +++ b/docs/models/operations/getinstancehistoryrequest.md @@ -0,0 +1,8 @@ +# GetInstanceHistoryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/getinstancehistoryresponse.md b/docs/models/operations/getinstancehistoryresponse.md new file mode 100755 index 00000000..e49bfe32 --- /dev/null +++ b/docs/models/operations/getinstancehistoryresponse.md @@ -0,0 +1,12 @@ +# GetInstanceHistoryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `GetWorkflowInstanceHistoryResponse` | [*shared.GetWorkflowInstanceHistoryResponse](../../models/shared/getworkflowinstancehistoryresponse.md) | :heavy_minus_sign: | The workflow instance history | +| `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/getinstancerequest.md b/docs/models/operations/getinstancerequest.md new file mode 100755 index 00000000..3be7c8df --- /dev/null +++ b/docs/models/operations/getinstancerequest.md @@ -0,0 +1,8 @@ +# GetInstanceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/getinstanceresponse.md b/docs/models/operations/getinstanceresponse.md new file mode 100755 index 00000000..c4455e87 --- /dev/null +++ b/docs/models/operations/getinstanceresponse.md @@ -0,0 +1,12 @@ +# GetInstanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `GetWorkflowInstanceResponse` | [*shared.GetWorkflowInstanceResponse](../../models/shared/getworkflowinstanceresponse.md) | :heavy_minus_sign: | The workflow instance | +| `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/getinstancestagehistoryrequest.md b/docs/models/operations/getinstancestagehistoryrequest.md new file mode 100755 index 00000000..afce5437 --- /dev/null +++ b/docs/models/operations/getinstancestagehistoryrequest.md @@ -0,0 +1,9 @@ +# GetInstanceStageHistoryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | +| `Number` | *int64* | :heavy_check_mark: | The stage number | \ No newline at end of file diff --git a/docs/models/operations/getinstancestagehistoryresponse.md b/docs/models/operations/getinstancestagehistoryresponse.md new file mode 100755 index 00000000..cc4ffc20 --- /dev/null +++ b/docs/models/operations/getinstancestagehistoryresponse.md @@ -0,0 +1,12 @@ +# GetInstanceStageHistoryResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `GetWorkflowInstanceHistoryStageResponse` | [*shared.GetWorkflowInstanceHistoryStageResponse](../../models/shared/getworkflowinstancehistorystageresponse.md) | :heavy_minus_sign: | The workflow instance stage history | +| `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/getledgerinforequest.md b/docs/models/operations/getledgerinforequest.md new file mode 100755 index 00000000..f45b795d --- /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 00000000..44227bfc --- /dev/null +++ b/docs/models/operations/getledgerinforesponse.md @@ -0,0 +1,12 @@ +# GetLedgerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `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: | 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/getmanyconfigsrequest.md b/docs/models/operations/getmanyconfigsrequest.md new file mode 100755 index 00000000..4d2f18e1 --- /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 00000000..ef0a5cfa --- /dev/null +++ b/docs/models/operations/getmanyconfigsresponse.md @@ -0,0 +1,12 @@ +# GetManyConfigsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `ConfigsResponse` | [*shared.ConfigsResponse](../../models/shared/configsresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..1399e12e --- /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 00000000..f2627ffe --- /dev/null +++ b/docs/models/operations/getmappingresponse.md @@ -0,0 +1,12 @@ +# GetMappingResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `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: | 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/getpolicyrequest.md b/docs/models/operations/getpolicyrequest.md new file mode 100755 index 00000000..495cdc6e --- /dev/null +++ b/docs/models/operations/getpolicyrequest.md @@ -0,0 +1,8 @@ +# GetPolicyRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `PolicyID` | *string* | :heavy_check_mark: | The policy ID. | \ No newline at end of file diff --git a/docs/models/operations/getpolicyresponse.md b/docs/models/operations/getpolicyresponse.md new file mode 100755 index 00000000..b4953a21 --- /dev/null +++ b/docs/models/operations/getpolicyresponse.md @@ -0,0 +1,12 @@ +# GetPolicyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `PolicyResponse` | [*shared.PolicyResponse](../../models/shared/policyresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ No newline at end of file diff --git a/docs/models/operations/getreconciliationrequest.md b/docs/models/operations/getreconciliationrequest.md new file mode 100755 index 00000000..d5dba742 --- /dev/null +++ b/docs/models/operations/getreconciliationrequest.md @@ -0,0 +1,8 @@ +# GetReconciliationRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `ReconciliationID` | *string* | :heavy_check_mark: | The reconciliation ID. | \ No newline at end of file diff --git a/docs/models/operations/getreconciliationresponse.md b/docs/models/operations/getreconciliationresponse.md new file mode 100755 index 00000000..0ace47b6 --- /dev/null +++ b/docs/models/operations/getreconciliationresponse.md @@ -0,0 +1,12 @@ +# GetReconciliationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `ReconciliationResponse` | [*shared.ReconciliationResponse](../../models/shared/reconciliationresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ 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 00000000..172e4c76 --- /dev/null +++ b/docs/models/operations/getserverinforesponse.md @@ -0,0 +1,11 @@ +# GetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `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: | 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/gettransactionrequest.md b/docs/models/operations/gettransactionrequest.md new file mode 100755 index 00000000..9b7bcbcb --- /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` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..6479ff08 --- /dev/null +++ b/docs/models/operations/gettransactionresponse.md @@ -0,0 +1,12 @@ +# GetTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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: | 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/gettransactionsrequest.md b/docs/models/operations/gettransactionsrequest.md new file mode 100755 index 00000000..76f8dc49 --- /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 00000000..c99b5fa2 --- /dev/null +++ b/docs/models/operations/gettransactionsresponse.md @@ -0,0 +1,12 @@ +# GetTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `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: | 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/getversionsresponse.md b/docs/models/operations/getversionsresponse.md new file mode 100755 index 00000000..e9b42492 --- /dev/null +++ b/docs/models/operations/getversionsresponse.md @@ -0,0 +1,11 @@ +# GetVersionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `GetVersionsResponse` | [*shared.GetVersionsResponse](../../models/shared/getversionsresponse.md) | :heavy_minus_sign: | OK | +| `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/getwalletrequest.md b/docs/models/operations/getwalletrequest.md new file mode 100755 index 00000000..7a7f0a07 --- /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 00000000..50cd33d4 --- /dev/null +++ b/docs/models/operations/getwalletresponse.md @@ -0,0 +1,12 @@ +# GetWalletResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/getwalletsummaryrequest.md b/docs/models/operations/getwalletsummaryrequest.md new file mode 100755 index 00000000..2b3e5377 --- /dev/null +++ b/docs/models/operations/getwalletsummaryrequest.md @@ -0,0 +1,8 @@ +# GetWalletSummaryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getwalletsummaryresponse.md b/docs/models/operations/getwalletsummaryresponse.md new file mode 100755 index 00000000..3b3158d7 --- /dev/null +++ b/docs/models/operations/getwalletsummaryresponse.md @@ -0,0 +1,12 @@ +# GetWalletSummaryResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `GetWalletSummaryResponse` | [*shared.GetWalletSummaryResponse](../../models/shared/getwalletsummaryresponse.md) | :heavy_minus_sign: | Wallet summary | +| `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/getworkflowrequest.md b/docs/models/operations/getworkflowrequest.md new file mode 100755 index 00000000..bb2563d4 --- /dev/null +++ b/docs/models/operations/getworkflowrequest.md @@ -0,0 +1,8 @@ +# GetWorkflowRequest + + +## 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/getworkflowresponse.md b/docs/models/operations/getworkflowresponse.md new file mode 100755 index 00000000..0c2965d6 --- /dev/null +++ b/docs/models/operations/getworkflowresponse.md @@ -0,0 +1,12 @@ +# GetWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..ab1b2fd8 --- /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: | 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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..cf29a7ec --- /dev/null +++ b/docs/models/operations/listaccountsrequest.md @@ -0,0 +1,15 @@ +# 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 | +| `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` | map[string]*interface{}* | :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.
| | +| ~~`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 00000000..eb8c9218 --- /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: | HTTP response content type for this operation | +| `ErrorResponse` | [*shared.ErrorResponse](../../models/shared/errorresponse.md) | :heavy_minus_sign: | Error | +| `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/listbalancesrequest.md b/docs/models/operations/listbalancesrequest.md new file mode 100755 index 00000000..eb35a012 --- /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 00000000..0c803e79 --- /dev/null +++ b/docs/models/operations/listbalancesresponse.md @@ -0,0 +1,11 @@ +# ListBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..4a2207eb --- /dev/null +++ b/docs/models/operations/listclientsresponse.md @@ -0,0 +1,11 @@ +# ListClientsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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: | 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/listinstancesrequest.md b/docs/models/operations/listinstancesrequest.md new file mode 100755 index 00000000..2701ad10 --- /dev/null +++ b/docs/models/operations/listinstancesrequest.md @@ -0,0 +1,9 @@ +# ListInstancesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Running` | **bool* | :heavy_minus_sign: | Filter running instances | +| `WorkflowID` | **string* | :heavy_minus_sign: | A workflow id | \ No newline at end of file diff --git a/docs/models/operations/listinstancesresponse.md b/docs/models/operations/listinstancesresponse.md new file mode 100755 index 00000000..0a5fd29f --- /dev/null +++ b/docs/models/operations/listinstancesresponse.md @@ -0,0 +1,12 @@ +# ListInstancesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `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 instances | +| `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/listlogsrequest.md b/docs/models/operations/listlogsrequest.md new file mode 100755 index 00000000..12b83061 --- /dev/null +++ b/docs/models/operations/listlogsrequest.md @@ -0,0 +1,13 @@ +# 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).
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `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).
| | \ 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 00000000..18518b5c --- /dev/null +++ b/docs/models/operations/listlogsresponse.md @@ -0,0 +1,12 @@ +# ListLogsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `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: | 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/listpoliciesrequest.md b/docs/models/operations/listpoliciesrequest.md new file mode 100755 index 00000000..29f5a922 --- /dev/null +++ b/docs/models/operations/listpoliciesrequest.md @@ -0,0 +1,9 @@ +# ListPoliciesRequest + + +## 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.
| | \ No newline at end of file diff --git a/docs/models/operations/listpoliciesresponse.md b/docs/models/operations/listpoliciesresponse.md new file mode 100755 index 00000000..be6fdccc --- /dev/null +++ b/docs/models/operations/listpoliciesresponse.md @@ -0,0 +1,12 @@ +# ListPoliciesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `PoliciesCursorResponse` | [*shared.PoliciesCursorResponse](../../models/shared/policiescursorresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ No newline at end of file diff --git a/docs/models/operations/listreconciliationsrequest.md b/docs/models/operations/listreconciliationsrequest.md new file mode 100755 index 00000000..f8338615 --- /dev/null +++ b/docs/models/operations/listreconciliationsrequest.md @@ -0,0 +1,9 @@ +# ListReconciliationsRequest + + +## 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.
| | \ No newline at end of file diff --git a/docs/models/operations/listreconciliationsresponse.md b/docs/models/operations/listreconciliationsresponse.md new file mode 100755 index 00000000..73a811bb --- /dev/null +++ b/docs/models/operations/listreconciliationsresponse.md @@ -0,0 +1,12 @@ +# ListReconciliationsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `ReconciliationsCursorResponse` | [*shared.ReconciliationsCursorResponse](../../models/shared/reconciliationscursorresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ 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 00000000..b2dd0916 --- /dev/null +++ b/docs/models/operations/listtransactionsrequest.md @@ -0,0 +1,18 @@ +# 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).
| | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Metadata` | map[string]*interface{}* | :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.
| | +| `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).
| | \ 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 00000000..dbcde85f --- /dev/null +++ b/docs/models/operations/listtransactionsresponse.md @@ -0,0 +1,12 @@ +# ListTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `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: | 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/listtriggersoccurrencesrequest.md b/docs/models/operations/listtriggersoccurrencesrequest.md new file mode 100755 index 00000000..ee2406b2 --- /dev/null +++ b/docs/models/operations/listtriggersoccurrencesrequest.md @@ -0,0 +1,8 @@ +# ListTriggersOccurrencesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/listtriggersoccurrencesresponse.md b/docs/models/operations/listtriggersoccurrencesresponse.md new file mode 100755 index 00000000..6885cd32 --- /dev/null +++ b/docs/models/operations/listtriggersoccurrencesresponse.md @@ -0,0 +1,12 @@ +# ListTriggersOccurrencesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ListTriggersOccurrencesResponse` | [*shared.ListTriggersOccurrencesResponse](../../models/shared/listtriggersoccurrencesresponse.md) | :heavy_minus_sign: | List of triggers occurrences | +| `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/listtriggersresponse.md b/docs/models/operations/listtriggersresponse.md new file mode 100755 index 00000000..b695eb54 --- /dev/null +++ b/docs/models/operations/listtriggersresponse.md @@ -0,0 +1,12 @@ +# ListTriggersResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ListTriggersResponse` | [*shared.ListTriggersResponse](../../models/shared/listtriggersresponse.md) | :heavy_minus_sign: | List of triggers | +| `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/listusersresponse.md b/docs/models/operations/listusersresponse.md new file mode 100755 index 00000000..601e737a --- /dev/null +++ b/docs/models/operations/listusersresponse.md @@ -0,0 +1,11 @@ +# ListUsersResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `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: | 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/listwalletsrequest.md b/docs/models/operations/listwalletsrequest.md new file mode 100755 index 00000000..f752d00e --- /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` | map[string]*string* | :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 00000000..5055d316 --- /dev/null +++ b/docs/models/operations/listwalletsresponse.md @@ -0,0 +1,11 @@ +# ListWalletsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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: | 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/listworkflowsresponse.md b/docs/models/operations/listworkflowsresponse.md new file mode 100755 index 00000000..6beb4d34 --- /dev/null +++ b/docs/models/operations/listworkflowsresponse.md @@ -0,0 +1,12 @@ +# ListWorkflowsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..46cb39ff --- /dev/null +++ b/docs/models/operations/orchestrationgetserverinforesponse.md @@ -0,0 +1,12 @@ +# OrchestrationgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `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: | 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/readclientrequest.md b/docs/models/operations/readclientrequest.md new file mode 100755 index 00000000..b9707572 --- /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 00000000..95da3333 --- /dev/null +++ b/docs/models/operations/readclientresponse.md @@ -0,0 +1,11 @@ +# ReadClientResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `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: | 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/readstatsrequest.md b/docs/models/operations/readstatsrequest.md new file mode 100755 index 00000000..1be5ec74 --- /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 00000000..0bec2959 --- /dev/null +++ b/docs/models/operations/readstatsresponse.md @@ -0,0 +1,12 @@ +# ReadStatsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `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: | 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/readtriggerrequest.md b/docs/models/operations/readtriggerrequest.md new file mode 100755 index 00000000..2ddf0c17 --- /dev/null +++ b/docs/models/operations/readtriggerrequest.md @@ -0,0 +1,8 @@ +# ReadTriggerRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/readtriggerresponse.md b/docs/models/operations/readtriggerresponse.md new file mode 100755 index 00000000..3213fd6f --- /dev/null +++ b/docs/models/operations/readtriggerresponse.md @@ -0,0 +1,12 @@ +# ReadTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `ReadTriggerResponse` | [*shared.ReadTriggerResponse](../../models/shared/readtriggerresponse.md) | :heavy_minus_sign: | A specific trigger | +| `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/readuserrequest.md b/docs/models/operations/readuserrequest.md new file mode 100755 index 00000000..69fb9f89 --- /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 00000000..fb2cb57b --- /dev/null +++ b/docs/models/operations/readuserresponse.md @@ -0,0 +1,11 @@ +# ReadUserResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `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: | 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/reconcilerequest.md b/docs/models/operations/reconcilerequest.md new file mode 100755 index 00000000..52394f39 --- /dev/null +++ b/docs/models/operations/reconcilerequest.md @@ -0,0 +1,9 @@ +# ReconcileRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ReconciliationRequest` | [shared.ReconciliationRequest](../../models/shared/reconciliationrequest.md) | :heavy_check_mark: | N/A | +| `PolicyID` | *string* | :heavy_check_mark: | The policy ID. | \ No newline at end of file diff --git a/docs/models/operations/reconcileresponse.md b/docs/models/operations/reconcileresponse.md new file mode 100755 index 00000000..10c6d7ae --- /dev/null +++ b/docs/models/operations/reconcileresponse.md @@ -0,0 +1,12 @@ +# ReconcileResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `ReconciliationResponse` | [*shared.ReconciliationResponse](../../models/shared/reconciliationresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ No newline at end of file diff --git a/docs/models/operations/reconciliationgetserverinforesponse.md b/docs/models/operations/reconciliationgetserverinforesponse.md new file mode 100755 index 00000000..aeaa4c37 --- /dev/null +++ b/docs/models/operations/reconciliationgetserverinforesponse.md @@ -0,0 +1,12 @@ +# ReconciliationgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `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: | 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 | +| `ReconciliationErrorResponse` | [*shared.ReconciliationErrorResponse](../../models/shared/reconciliationerrorresponse.md) | :heavy_minus_sign: | Error response | \ 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 00000000..e6c859c1 --- /dev/null +++ b/docs/models/operations/reverttransactionrequest.md @@ -0,0 +1,10 @@ +# RevertTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `DisableChecks` | **bool* | :heavy_minus_sign: | Allow to disable balances checks | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Txid` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..3bd704d6 --- /dev/null +++ b/docs/models/operations/reverttransactionresponse.md @@ -0,0 +1,12 @@ +# RevertTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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: | 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/runscriptrequest.md b/docs/models/operations/runscriptrequest.md new file mode 100755 index 00000000..2a03d60f --- /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 00000000..72151310 --- /dev/null +++ b/docs/models/operations/runscriptresponse.md @@ -0,0 +1,11 @@ +# RunScriptResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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: | 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/runworkflowrequest.md b/docs/models/operations/runworkflowrequest.md new file mode 100755 index 00000000..21bfdd3d --- /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 | +| `Wait` | **bool* | :heavy_minus_sign: | Wait end of the workflow before return | +| `WorkflowID` | *string* | :heavy_check_mark: | The flow id | \ 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 00000000..f1fe7750 --- /dev/null +++ b/docs/models/operations/runworkflowresponse.md @@ -0,0 +1,12 @@ +# RunWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `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 instance | +| `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 new file mode 100755 index 00000000..e728aa76 --- /dev/null +++ b/docs/models/operations/searchgetserverinforesponse.md @@ -0,0 +1,11 @@ +# SearchgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `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: | 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 new file mode 100755 index 00000000..74816dd0 --- /dev/null +++ b/docs/models/operations/searchresponse.md @@ -0,0 +1,11 @@ +# SearchResponse + + +## Fields + +| 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/sendeventrequest.md b/docs/models/operations/sendeventrequest.md new file mode 100755 index 00000000..42b1dce1 --- /dev/null +++ b/docs/models/operations/sendeventrequest.md @@ -0,0 +1,9 @@ +# SendEventRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `RequestBody` | [*SendEventRequestBody](../../models/operations/sendeventrequestbody.md) | :heavy_minus_sign: | N/A | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/sendeventrequestbody.md b/docs/models/operations/sendeventrequestbody.md new file mode 100755 index 00000000..902bd412 --- /dev/null +++ b/docs/models/operations/sendeventrequestbody.md @@ -0,0 +1,8 @@ +# SendEventRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/sendeventresponse.md b/docs/models/operations/sendeventresponse.md new file mode 100755 index 00000000..f59e93f5 --- /dev/null +++ b/docs/models/operations/sendeventresponse.md @@ -0,0 +1,11 @@ +# SendEventResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | General error | +| `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/testconfigrequest.md b/docs/models/operations/testconfigrequest.md new file mode 100755 index 00000000..1f371122 --- /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 00000000..a5b2f376 --- /dev/null +++ b/docs/models/operations/testconfigresponse.md @@ -0,0 +1,12 @@ +# TestConfigResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `AttemptResponse` | [*shared.AttemptResponse](../../models/shared/attemptresponse.md) | :heavy_minus_sign: | OK | +| `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 | +| `WebhooksErrorResponse` | [*shared.WebhooksErrorResponse](../../models/shared/webhookserrorresponse.md) | :heavy_minus_sign: | Error | \ 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 00000000..4941654b --- /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 00000000..1b47de51 --- /dev/null +++ b/docs/models/operations/updateclientresponse.md @@ -0,0 +1,11 @@ +# UpdateClientResponse + + +## Fields + +| 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 | +| `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 00000000..aeaf81f3 --- /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 00000000..a0ae95c2 --- /dev/null +++ b/docs/models/operations/updatemappingresponse.md @@ -0,0 +1,12 @@ +# UpdateMappingResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `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: | 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/updatewalletrequest.md b/docs/models/operations/updatewalletrequest.md new file mode 100755 index 00000000..e57bde5a --- /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 00000000..d93cb0df --- /dev/null +++ b/docs/models/operations/updatewalletrequestbody.md @@ -0,0 +1,8 @@ +# UpdateWalletRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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 00000000..2ed290f8 --- /dev/null +++ b/docs/models/operations/updatewalletresponse.md @@ -0,0 +1,11 @@ +# UpdateWalletResponse + + +## Fields + +| 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 | +| `WalletsErrorResponse` | [*shared.WalletsErrorResponse](../../models/shared/walletserrorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2addmetadataontransactionrequest.md b/docs/models/operations/v2addmetadataontransactionrequest.md new file mode 100755 index 00000000..f3b1ef1f --- /dev/null +++ b/docs/models/operations/v2addmetadataontransactionrequest.md @@ -0,0 +1,12 @@ +# V2AddMetadataOnTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `IdempotencyKey` | **string* | :heavy_minus_sign: | Use an idempotency key | | +| `RequestBody` | map[string]*string* | :heavy_minus_sign: | metadata | [object Object] | +| `DryRun` | **bool* | :heavy_minus_sign: | Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. | true | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | Transaction ID. | 1234 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2addmetadataontransactionresponse.md b/docs/models/operations/v2addmetadataontransactionresponse.md new file mode 100755 index 00000000..2b575583 --- /dev/null +++ b/docs/models/operations/v2addmetadataontransactionresponse.md @@ -0,0 +1,11 @@ +# V2AddMetadataOnTransactionResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2addmetadatatoaccountrequest.md b/docs/models/operations/v2addmetadatatoaccountrequest.md new file mode 100755 index 00000000..70f3b619 --- /dev/null +++ b/docs/models/operations/v2addmetadatatoaccountrequest.md @@ -0,0 +1,12 @@ +# V2AddMetadataToAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `IdempotencyKey` | **string* | :heavy_minus_sign: | Use an idempotency key | | +| `RequestBody` | map[string]*string* | :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 | +| `DryRun` | **bool* | :heavy_minus_sign: | Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. | true | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2addmetadatatoaccountresponse.md b/docs/models/operations/v2addmetadatatoaccountresponse.md new file mode 100755 index 00000000..d1d84a01 --- /dev/null +++ b/docs/models/operations/v2addmetadatatoaccountresponse.md @@ -0,0 +1,11 @@ +# V2AddMetadataToAccountResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2canceleventrequest.md b/docs/models/operations/v2canceleventrequest.md new file mode 100755 index 00000000..bb63750c --- /dev/null +++ b/docs/models/operations/v2canceleventrequest.md @@ -0,0 +1,8 @@ +# V2CancelEventRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/v2canceleventresponse.md b/docs/models/operations/v2canceleventresponse.md new file mode 100755 index 00000000..892d5057 --- /dev/null +++ b/docs/models/operations/v2canceleventresponse.md @@ -0,0 +1,11 @@ +# V2CancelEventResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | \ No newline at end of file diff --git a/docs/models/operations/v2countaccountsrequest.md b/docs/models/operations/v2countaccountsrequest.md new file mode 100755 index 00000000..fae1935c --- /dev/null +++ b/docs/models/operations/v2countaccountsrequest.md @@ -0,0 +1,10 @@ +# V2CountAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2countaccountsresponse.md b/docs/models/operations/v2countaccountsresponse.md new file mode 100755 index 00000000..f48344aa --- /dev/null +++ b/docs/models/operations/v2countaccountsresponse.md @@ -0,0 +1,12 @@ +# V2CountAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Headers` | map[string][]*string* | :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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2counttransactionsrequest.md b/docs/models/operations/v2counttransactionsrequest.md new file mode 100755 index 00000000..274547b9 --- /dev/null +++ b/docs/models/operations/v2counttransactionsrequest.md @@ -0,0 +1,10 @@ +# V2CountTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2counttransactionsresponse.md b/docs/models/operations/v2counttransactionsresponse.md new file mode 100755 index 00000000..97a119a2 --- /dev/null +++ b/docs/models/operations/v2counttransactionsresponse.md @@ -0,0 +1,12 @@ +# V2CountTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `Headers` | map[string][]*string* | :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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2createbulkrequest.md b/docs/models/operations/v2createbulkrequest.md new file mode 100755 index 00000000..33f477f1 --- /dev/null +++ b/docs/models/operations/v2createbulkrequest.md @@ -0,0 +1,9 @@ +# V2CreateBulkRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `RequestBody` | [][shared.V2BulkElement](../../models/shared/v2bulkelement.md) | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2createbulkresponse.md b/docs/models/operations/v2createbulkresponse.md new file mode 100755 index 00000000..eeff3a92 --- /dev/null +++ b/docs/models/operations/v2createbulkresponse.md @@ -0,0 +1,12 @@ +# V2CreateBulkResponse + + +## Fields + +| 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 | +| `V2BulkResponse` | [*shared.V2BulkResponse](../../models/shared/v2bulkresponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2createledgerrequest.md b/docs/models/operations/v2createledgerrequest.md new file mode 100755 index 00000000..e034ba7d --- /dev/null +++ b/docs/models/operations/v2createledgerrequest.md @@ -0,0 +1,9 @@ +# V2CreateLedgerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `V2CreateLedgerRequest` | [*shared.V2CreateLedgerRequest](../../models/shared/v2createledgerrequest.md) | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2createledgerresponse.md b/docs/models/operations/v2createledgerresponse.md new file mode 100755 index 00000000..be1fe601 --- /dev/null +++ b/docs/models/operations/v2createledgerresponse.md @@ -0,0 +1,11 @@ +# V2CreateLedgerResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2createtransactionrequest.md b/docs/models/operations/v2createtransactionrequest.md new file mode 100755 index 00000000..56dacad3 --- /dev/null +++ b/docs/models/operations/v2createtransactionrequest.md @@ -0,0 +1,11 @@ +# V2CreateTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `IdempotencyKey` | **string* | :heavy_minus_sign: | Use an idempotency key | | +| `V2PostTransaction` | [shared.V2PostTransaction](../../models/shared/v2posttransaction.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
| | +| `DryRun` | **bool* | :heavy_minus_sign: | Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker. | true | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2createtransactionresponse.md b/docs/models/operations/v2createtransactionresponse.md new file mode 100755 index 00000000..20cdaa87 --- /dev/null +++ b/docs/models/operations/v2createtransactionresponse.md @@ -0,0 +1,12 @@ +# V2CreateTransactionResponse + + +## Fields + +| 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 | +| `V2CreateTransactionResponse` | [*shared.V2CreateTransactionResponse](../../models/shared/v2createtransactionresponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2createtriggerresponse.md b/docs/models/operations/v2createtriggerresponse.md new file mode 100755 index 00000000..3501a82e --- /dev/null +++ b/docs/models/operations/v2createtriggerresponse.md @@ -0,0 +1,12 @@ +# V2CreateTriggerResponse + + +## Fields + +| 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 | +| `V2CreateTriggerResponse` | [*shared.V2CreateTriggerResponse](../../models/shared/v2createtriggerresponse.md) | :heavy_minus_sign: | Created trigger | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | \ No newline at end of file diff --git a/docs/models/operations/v2createworkflowresponse.md b/docs/models/operations/v2createworkflowresponse.md new file mode 100755 index 00000000..6723cafd --- /dev/null +++ b/docs/models/operations/v2createworkflowresponse.md @@ -0,0 +1,12 @@ +# V2CreateWorkflowResponse + + +## Fields + +| 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 | +| `V2CreateWorkflowResponse` | [*shared.V2CreateWorkflowResponse](../../models/shared/v2createworkflowresponse.md) | :heavy_minus_sign: | Created workflow | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | \ No newline at end of file diff --git a/docs/models/operations/v2deleteaccountmetadatarequest.md b/docs/models/operations/v2deleteaccountmetadatarequest.md new file mode 100755 index 00000000..20852531 --- /dev/null +++ b/docs/models/operations/v2deleteaccountmetadatarequest.md @@ -0,0 +1,10 @@ +# V2DeleteAccountMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `Address` | *string* | :heavy_check_mark: | Account address | | +| `Key` | *string* | :heavy_check_mark: | The key to remove. | foo | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2deleteaccountmetadataresponse.md b/docs/models/operations/v2deleteaccountmetadataresponse.md new file mode 100755 index 00000000..09ea3dce --- /dev/null +++ b/docs/models/operations/v2deleteaccountmetadataresponse.md @@ -0,0 +1,10 @@ +# V2DeleteAccountMetadataResponse + + +## Fields + +| 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/v2deletetransactionmetadatarequest.md b/docs/models/operations/v2deletetransactionmetadatarequest.md new file mode 100755 index 00000000..5a0a4434 --- /dev/null +++ b/docs/models/operations/v2deletetransactionmetadatarequest.md @@ -0,0 +1,10 @@ +# V2DeleteTransactionMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | Transaction ID. | 1234 | +| `Key` | *string* | :heavy_check_mark: | The key to remove. | foo | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2deletetransactionmetadataresponse.md b/docs/models/operations/v2deletetransactionmetadataresponse.md new file mode 100755 index 00000000..837757ec --- /dev/null +++ b/docs/models/operations/v2deletetransactionmetadataresponse.md @@ -0,0 +1,11 @@ +# V2DeleteTransactionMetadataResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2deletetriggerrequest.md b/docs/models/operations/v2deletetriggerrequest.md new file mode 100755 index 00000000..2cf4817a --- /dev/null +++ b/docs/models/operations/v2deletetriggerrequest.md @@ -0,0 +1,8 @@ +# V2DeleteTriggerRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/v2deletetriggerresponse.md b/docs/models/operations/v2deletetriggerresponse.md new file mode 100755 index 00000000..243f1511 --- /dev/null +++ b/docs/models/operations/v2deletetriggerresponse.md @@ -0,0 +1,11 @@ +# V2DeleteTriggerResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | \ No newline at end of file diff --git a/docs/models/operations/v2deleteworkflowrequest.md b/docs/models/operations/v2deleteworkflowrequest.md new file mode 100755 index 00000000..cc61cceb --- /dev/null +++ b/docs/models/operations/v2deleteworkflowrequest.md @@ -0,0 +1,8 @@ +# V2DeleteWorkflowRequest + + +## 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/v2deleteworkflowresponse.md b/docs/models/operations/v2deleteworkflowresponse.md new file mode 100755 index 00000000..be17f3ee --- /dev/null +++ b/docs/models/operations/v2deleteworkflowresponse.md @@ -0,0 +1,11 @@ +# V2DeleteWorkflowResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | \ No newline at end of file diff --git a/docs/models/operations/v2getaccountrequest.md b/docs/models/operations/v2getaccountrequest.md new file mode 100755 index 00000000..1dff749f --- /dev/null +++ b/docs/models/operations/v2getaccountrequest.md @@ -0,0 +1,11 @@ +# V2GetAccountRequest + + +## 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 | +| `Expand` | **string* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2getaccountresponse.md b/docs/models/operations/v2getaccountresponse.md new file mode 100755 index 00000000..52812f08 --- /dev/null +++ b/docs/models/operations/v2getaccountresponse.md @@ -0,0 +1,12 @@ +# V2GetAccountResponse + + +## Fields + +| 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 | +| `V2AccountResponse` | [*shared.V2AccountResponse](../../models/shared/v2accountresponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2getbalancesaggregatedrequest.md b/docs/models/operations/v2getbalancesaggregatedrequest.md new file mode 100755 index 00000000..9287acdd --- /dev/null +++ b/docs/models/operations/v2getbalancesaggregatedrequest.md @@ -0,0 +1,10 @@ +# V2GetBalancesAggregatedRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2getbalancesaggregatedresponse.md b/docs/models/operations/v2getbalancesaggregatedresponse.md new file mode 100755 index 00000000..370a4ff0 --- /dev/null +++ b/docs/models/operations/v2getbalancesaggregatedresponse.md @@ -0,0 +1,12 @@ +# V2GetBalancesAggregatedResponse + + +## Fields + +| 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 | +| `V2AggregateBalancesResponse` | [*shared.V2AggregateBalancesResponse](../../models/shared/v2aggregatebalancesresponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2getinforesponse.md b/docs/models/operations/v2getinforesponse.md new file mode 100755 index 00000000..ca481eef --- /dev/null +++ b/docs/models/operations/v2getinforesponse.md @@ -0,0 +1,12 @@ +# V2GetInfoResponse + + +## Fields + +| 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 | +| `V2ConfigInfoResponse` | [*shared.V2ConfigInfoResponse](../../models/shared/v2configinforesponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2getinstancehistoryrequest.md b/docs/models/operations/v2getinstancehistoryrequest.md new file mode 100755 index 00000000..3c0c1868 --- /dev/null +++ b/docs/models/operations/v2getinstancehistoryrequest.md @@ -0,0 +1,8 @@ +# V2GetInstanceHistoryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/v2getinstancehistoryresponse.md b/docs/models/operations/v2getinstancehistoryresponse.md new file mode 100755 index 00000000..8dff3820 --- /dev/null +++ b/docs/models/operations/v2getinstancehistoryresponse.md @@ -0,0 +1,12 @@ +# V2GetInstanceHistoryResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2GetWorkflowInstanceHistoryResponse` | [*shared.V2GetWorkflowInstanceHistoryResponse](../../models/shared/v2getworkflowinstancehistoryresponse.md) | :heavy_minus_sign: | The workflow instance history | \ No newline at end of file diff --git a/docs/models/operations/v2getinstancerequest.md b/docs/models/operations/v2getinstancerequest.md new file mode 100755 index 00000000..22191d5d --- /dev/null +++ b/docs/models/operations/v2getinstancerequest.md @@ -0,0 +1,8 @@ +# V2GetInstanceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/v2getinstanceresponse.md b/docs/models/operations/v2getinstanceresponse.md new file mode 100755 index 00000000..5a07473c --- /dev/null +++ b/docs/models/operations/v2getinstanceresponse.md @@ -0,0 +1,12 @@ +# V2GetInstanceResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2GetWorkflowInstanceResponse` | [*shared.V2GetWorkflowInstanceResponse](../../models/shared/v2getworkflowinstanceresponse.md) | :heavy_minus_sign: | The workflow instance | \ No newline at end of file diff --git a/docs/models/operations/v2getinstancestagehistoryrequest.md b/docs/models/operations/v2getinstancestagehistoryrequest.md new file mode 100755 index 00000000..ef874921 --- /dev/null +++ b/docs/models/operations/v2getinstancestagehistoryrequest.md @@ -0,0 +1,9 @@ +# V2GetInstanceStageHistoryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | +| `Number` | *int64* | :heavy_check_mark: | The stage number | \ No newline at end of file diff --git a/docs/models/operations/v2getinstancestagehistoryresponse.md b/docs/models/operations/v2getinstancestagehistoryresponse.md new file mode 100755 index 00000000..f735401c --- /dev/null +++ b/docs/models/operations/v2getinstancestagehistoryresponse.md @@ -0,0 +1,12 @@ +# V2GetInstanceStageHistoryResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2GetWorkflowInstanceHistoryStageResponse` | [*shared.V2GetWorkflowInstanceHistoryStageResponse](../../models/shared/v2getworkflowinstancehistorystageresponse.md) | :heavy_minus_sign: | The workflow instance stage history | \ No newline at end of file diff --git a/docs/models/operations/v2getledgerinforequest.md b/docs/models/operations/v2getledgerinforequest.md new file mode 100755 index 00000000..8d240702 --- /dev/null +++ b/docs/models/operations/v2getledgerinforequest.md @@ -0,0 +1,8 @@ +# V2GetLedgerInfoRequest + + +## 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/v2getledgerinforesponse.md b/docs/models/operations/v2getledgerinforesponse.md new file mode 100755 index 00000000..ccb5837c --- /dev/null +++ b/docs/models/operations/v2getledgerinforesponse.md @@ -0,0 +1,12 @@ +# V2GetLedgerInfoResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2LedgerInfoResponse` | [*shared.V2LedgerInfoResponse](../../models/shared/v2ledgerinforesponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2getledgerrequest.md b/docs/models/operations/v2getledgerrequest.md new file mode 100755 index 00000000..4114f439 --- /dev/null +++ b/docs/models/operations/v2getledgerrequest.md @@ -0,0 +1,8 @@ +# V2GetLedgerRequest + + +## 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/v2getledgerresponse.md b/docs/models/operations/v2getledgerresponse.md new file mode 100755 index 00000000..df659b49 --- /dev/null +++ b/docs/models/operations/v2getledgerresponse.md @@ -0,0 +1,12 @@ +# V2GetLedgerResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2Ledger` | [*shared.V2Ledger](../../models/shared/v2ledger.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2getserverinforesponse.md b/docs/models/operations/v2getserverinforesponse.md new file mode 100755 index 00000000..521bf3b8 --- /dev/null +++ b/docs/models/operations/v2getserverinforesponse.md @@ -0,0 +1,12 @@ +# V2GetServerInfoResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ServerInfo` | [*shared.V2ServerInfo](../../models/shared/v2serverinfo.md) | :heavy_minus_sign: | Server information | \ No newline at end of file diff --git a/docs/models/operations/v2gettransactionrequest.md b/docs/models/operations/v2gettransactionrequest.md new file mode 100755 index 00000000..8aa387b5 --- /dev/null +++ b/docs/models/operations/v2gettransactionrequest.md @@ -0,0 +1,11 @@ +# V2GetTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Expand` | **string* | :heavy_minus_sign: | N/A | | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | Transaction ID. | 1234 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2gettransactionresponse.md b/docs/models/operations/v2gettransactionresponse.md new file mode 100755 index 00000000..99c6b170 --- /dev/null +++ b/docs/models/operations/v2gettransactionresponse.md @@ -0,0 +1,12 @@ +# V2GetTransactionResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2GetTransactionResponse` | [*shared.V2GetTransactionResponse](../../models/shared/v2gettransactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2getworkflowrequest.md b/docs/models/operations/v2getworkflowrequest.md new file mode 100755 index 00000000..ad400338 --- /dev/null +++ b/docs/models/operations/v2getworkflowrequest.md @@ -0,0 +1,8 @@ +# V2GetWorkflowRequest + + +## 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/v2getworkflowresponse.md b/docs/models/operations/v2getworkflowresponse.md new file mode 100755 index 00000000..f32b8dcf --- /dev/null +++ b/docs/models/operations/v2getworkflowresponse.md @@ -0,0 +1,12 @@ +# V2GetWorkflowResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2GetWorkflowResponse` | [*shared.V2GetWorkflowResponse](../../models/shared/v2getworkflowresponse.md) | :heavy_minus_sign: | The workflow | \ No newline at end of file diff --git a/docs/models/operations/v2listaccountsrequest.md b/docs/models/operations/v2listaccountsrequest.md new file mode 100755 index 00000000..1c8d4bcd --- /dev/null +++ b/docs/models/operations/v2listaccountsrequest.md @@ -0,0 +1,13 @@ +# V2ListAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `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== | +| `Expand` | **string* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2listaccountsresponse.md b/docs/models/operations/v2listaccountsresponse.md new file mode 100755 index 00000000..2357e582 --- /dev/null +++ b/docs/models/operations/v2listaccountsresponse.md @@ -0,0 +1,12 @@ +# V2ListAccountsResponse + + +## Fields + +| 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 | +| `V2AccountsCursorResponse` | [*shared.V2AccountsCursorResponse](../../models/shared/v2accountscursorresponse.md) | :heavy_minus_sign: | OK | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/v2listinstancesrequest.md b/docs/models/operations/v2listinstancesrequest.md new file mode 100755 index 00000000..55210abe --- /dev/null +++ b/docs/models/operations/v2listinstancesrequest.md @@ -0,0 +1,9 @@ +# V2ListInstancesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Running` | **bool* | :heavy_minus_sign: | Filter running instances | +| `WorkflowID` | **string* | :heavy_minus_sign: | A workflow id | \ No newline at end of file diff --git a/docs/models/operations/v2listinstancesresponse.md b/docs/models/operations/v2listinstancesresponse.md new file mode 100755 index 00000000..3a9f1855 --- /dev/null +++ b/docs/models/operations/v2listinstancesresponse.md @@ -0,0 +1,12 @@ +# V2ListInstancesResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ListRunsResponse` | [*shared.V2ListRunsResponse](../../models/shared/v2listrunsresponse.md) | :heavy_minus_sign: | List of workflow instances | \ No newline at end of file diff --git a/docs/models/operations/v2listledgersrequest.md b/docs/models/operations/v2listledgersrequest.md new file mode 100755 index 00000000..c28947a3 --- /dev/null +++ b/docs/models/operations/v2listledgersrequest.md @@ -0,0 +1,9 @@ +# V2ListLedgersRequest + + +## 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.
| | \ No newline at end of file diff --git a/docs/models/operations/v2listledgersresponse.md b/docs/models/operations/v2listledgersresponse.md new file mode 100755 index 00000000..24a1565b --- /dev/null +++ b/docs/models/operations/v2listledgersresponse.md @@ -0,0 +1,12 @@ +# V2ListLedgersResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2LedgerListResponse` | [*shared.V2LedgerListResponse](../../models/shared/v2ledgerlistresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2listlogsrequest.md b/docs/models/operations/v2listlogsrequest.md new file mode 100755 index 00000000..31314775 --- /dev/null +++ b/docs/models/operations/v2listlogsrequest.md @@ -0,0 +1,12 @@ +# V2ListLogsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `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 | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2listlogsresponse.md b/docs/models/operations/v2listlogsresponse.md new file mode 100755 index 00000000..a17d5997 --- /dev/null +++ b/docs/models/operations/v2listlogsresponse.md @@ -0,0 +1,12 @@ +# V2ListLogsResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2LogsCursorResponse` | [*shared.V2LogsCursorResponse](../../models/shared/v2logscursorresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2listtransactionsrequest.md b/docs/models/operations/v2listtransactionsrequest.md new file mode 100755 index 00000000..4ab6391e --- /dev/null +++ b/docs/models/operations/v2listtransactionsrequest.md @@ -0,0 +1,13 @@ +# V2ListTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `RequestBody` | map[string]*interface{}* | :heavy_minus_sign: | N/A | | +| `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== | +| `Expand` | **string* | :heavy_minus_sign: | N/A | | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | +| `PageSize` | **int64* | :heavy_minus_sign: | The maximum number of results to return per page.
| | +| `Pit` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/v2listtransactionsresponse.md b/docs/models/operations/v2listtransactionsresponse.md new file mode 100755 index 00000000..49de6383 --- /dev/null +++ b/docs/models/operations/v2listtransactionsresponse.md @@ -0,0 +1,12 @@ +# V2ListTransactionsResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2TransactionsCursorResponse` | [*shared.V2TransactionsCursorResponse](../../models/shared/v2transactionscursorresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2listtriggersoccurrencesrequest.md b/docs/models/operations/v2listtriggersoccurrencesrequest.md new file mode 100755 index 00000000..6fd793b3 --- /dev/null +++ b/docs/models/operations/v2listtriggersoccurrencesrequest.md @@ -0,0 +1,8 @@ +# V2ListTriggersOccurrencesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/v2listtriggersoccurrencesresponse.md b/docs/models/operations/v2listtriggersoccurrencesresponse.md new file mode 100755 index 00000000..4423d2b2 --- /dev/null +++ b/docs/models/operations/v2listtriggersoccurrencesresponse.md @@ -0,0 +1,12 @@ +# V2ListTriggersOccurrencesResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ListTriggersOccurrencesResponse` | [*shared.V2ListTriggersOccurrencesResponse](../../models/shared/v2listtriggersoccurrencesresponse.md) | :heavy_minus_sign: | List of triggers occurrences | \ No newline at end of file diff --git a/docs/models/operations/v2listtriggersresponse.md b/docs/models/operations/v2listtriggersresponse.md new file mode 100755 index 00000000..81b11b74 --- /dev/null +++ b/docs/models/operations/v2listtriggersresponse.md @@ -0,0 +1,12 @@ +# V2ListTriggersResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ListTriggersResponse` | [*shared.V2ListTriggersResponse](../../models/shared/v2listtriggersresponse.md) | :heavy_minus_sign: | List of triggers | \ No newline at end of file diff --git a/docs/models/operations/v2listworkflowsresponse.md b/docs/models/operations/v2listworkflowsresponse.md new file mode 100755 index 00000000..6c131398 --- /dev/null +++ b/docs/models/operations/v2listworkflowsresponse.md @@ -0,0 +1,12 @@ +# V2ListWorkflowsResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ListWorkflowsResponse` | [*shared.V2ListWorkflowsResponse](../../models/shared/v2listworkflowsresponse.md) | :heavy_minus_sign: | List of workflows | \ No newline at end of file diff --git a/docs/models/operations/v2readstatsrequest.md b/docs/models/operations/v2readstatsrequest.md new file mode 100755 index 00000000..890f0883 --- /dev/null +++ b/docs/models/operations/v2readstatsrequest.md @@ -0,0 +1,8 @@ +# V2ReadStatsRequest + + +## 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/v2readstatsresponse.md b/docs/models/operations/v2readstatsresponse.md new file mode 100755 index 00000000..2f9c8537 --- /dev/null +++ b/docs/models/operations/v2readstatsresponse.md @@ -0,0 +1,12 @@ +# V2ReadStatsResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2StatsResponse` | [*shared.V2StatsResponse](../../models/shared/v2statsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2readtriggerrequest.md b/docs/models/operations/v2readtriggerrequest.md new file mode 100755 index 00000000..a95a449b --- /dev/null +++ b/docs/models/operations/v2readtriggerrequest.md @@ -0,0 +1,8 @@ +# V2ReadTriggerRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `TriggerID` | *string* | :heavy_check_mark: | The trigger id | \ No newline at end of file diff --git a/docs/models/operations/v2readtriggerresponse.md b/docs/models/operations/v2readtriggerresponse.md new file mode 100755 index 00000000..748483e4 --- /dev/null +++ b/docs/models/operations/v2readtriggerresponse.md @@ -0,0 +1,12 @@ +# V2ReadTriggerResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2ReadTriggerResponse` | [*shared.V2ReadTriggerResponse](../../models/shared/v2readtriggerresponse.md) | :heavy_minus_sign: | A specific trigger | \ No newline at end of file diff --git a/docs/models/operations/v2reverttransactionrequest.md b/docs/models/operations/v2reverttransactionrequest.md new file mode 100755 index 00000000..39d03c46 --- /dev/null +++ b/docs/models/operations/v2reverttransactionrequest.md @@ -0,0 +1,10 @@ +# V2RevertTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Force` | **bool* | :heavy_minus_sign: | Force revert | | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | Transaction ID. | 1234 | +| `Ledger` | *string* | :heavy_check_mark: | Name of the ledger. | ledger001 | \ No newline at end of file diff --git a/docs/models/operations/v2reverttransactionresponse.md b/docs/models/operations/v2reverttransactionresponse.md new file mode 100755 index 00000000..4d94ea63 --- /dev/null +++ b/docs/models/operations/v2reverttransactionresponse.md @@ -0,0 +1,12 @@ +# V2RevertTransactionResponse + + +## Fields + +| 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 | +| `V2ErrorResponse` | [*shared.V2ErrorResponse](../../models/shared/v2errorresponse.md) | :heavy_minus_sign: | Error | +| `V2RevertTransactionResponse` | [*shared.V2RevertTransactionResponse](../../models/shared/v2reverttransactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/v2runworkflowrequest.md b/docs/models/operations/v2runworkflowrequest.md new file mode 100755 index 00000000..1d80bb01 --- /dev/null +++ b/docs/models/operations/v2runworkflowrequest.md @@ -0,0 +1,10 @@ +# V2RunWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `RequestBody` | map[string]*string* | :heavy_minus_sign: | N/A | +| `Wait` | **bool* | :heavy_minus_sign: | Wait end of the workflow before return | +| `WorkflowID` | *string* | :heavy_check_mark: | The flow id | \ No newline at end of file diff --git a/docs/models/operations/v2runworkflowresponse.md b/docs/models/operations/v2runworkflowresponse.md new file mode 100755 index 00000000..278aa89c --- /dev/null +++ b/docs/models/operations/v2runworkflowresponse.md @@ -0,0 +1,12 @@ +# V2RunWorkflowResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General error | +| `V2RunWorkflowResponse` | [*shared.V2RunWorkflowResponse](../../models/shared/v2runworkflowresponse.md) | :heavy_minus_sign: | The workflow instance | \ No newline at end of file diff --git a/docs/models/operations/v2sendeventrequest.md b/docs/models/operations/v2sendeventrequest.md new file mode 100755 index 00000000..16d5cdab --- /dev/null +++ b/docs/models/operations/v2sendeventrequest.md @@ -0,0 +1,9 @@ +# V2SendEventRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `RequestBody` | [*V2SendEventRequestBody](../../models/operations/v2sendeventrequestbody.md) | :heavy_minus_sign: | N/A | +| `InstanceID` | *string* | :heavy_check_mark: | The instance id | \ No newline at end of file diff --git a/docs/models/operations/v2sendeventrequestbody.md b/docs/models/operations/v2sendeventrequestbody.md new file mode 100755 index 00000000..04919dfd --- /dev/null +++ b/docs/models/operations/v2sendeventrequestbody.md @@ -0,0 +1,8 @@ +# V2SendEventRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/v2sendeventresponse.md b/docs/models/operations/v2sendeventresponse.md new file mode 100755 index 00000000..2502dbe6 --- /dev/null +++ b/docs/models/operations/v2sendeventresponse.md @@ -0,0 +1,11 @@ +# V2SendEventResponse + + +## Fields + +| 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 | +| `V2Error` | [*shared.V2Error](../../models/shared/v2error.md) | :heavy_minus_sign: | General 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 00000000..48a62532 --- /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 00000000..fd3d2c06 --- /dev/null +++ b/docs/models/operations/voidholdresponse.md @@ -0,0 +1,11 @@ +# VoidHoldResponse + + +## Fields + +| 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 | +| `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 00000000..ae9ca761 --- /dev/null +++ b/docs/models/operations/walletsgetserverinforesponse.md @@ -0,0 +1,12 @@ +# WalletsgetServerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `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: | 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/shared/account.md b/docs/models/shared/account.md new file mode 100755 index 00000000..118f3fd0 --- /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` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | +| `Type` | **string* | :heavy_minus_sign: | N/A | virtual | \ 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 00000000..b4f1f6ec --- /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/accountscursorresponse.md b/docs/models/shared/accountscursorresponse.md new file mode 100755 index 00000000..9aca72fa --- /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 00000000..0e026a12 --- /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 00000000..68b44d70 --- /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][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | [object Object] | +| `Metadata` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | +| `Type` | **string* | :heavy_minus_sign: | N/A | virtual | +| `Volumes` | map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/activityconfirmhold.md b/docs/models/shared/activityconfirmhold.md new file mode 100755 index 00000000..f7cd1379 --- /dev/null +++ b/docs/models/shared/activityconfirmhold.md @@ -0,0 +1,8 @@ +# ActivityConfirmHold + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitycreatetransaction.md b/docs/models/shared/activitycreatetransaction.md new file mode 100755 index 00000000..e519d577 --- /dev/null +++ b/docs/models/shared/activitycreatetransaction.md @@ -0,0 +1,9 @@ +# ActivityCreateTransaction + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Data` | [*OrchestrationPostTransaction](../../models/shared/orchestrationposttransaction.md) | :heavy_minus_sign: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitycreatetransactionoutput.md b/docs/models/shared/activitycreatetransactionoutput.md new file mode 100755 index 00000000..aa4ec001 --- /dev/null +++ b/docs/models/shared/activitycreatetransactionoutput.md @@ -0,0 +1,8 @@ +# ActivityCreateTransactionOutput + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Data` | [OrchestrationTransaction](../../models/shared/orchestrationtransaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitycreditwallet.md b/docs/models/shared/activitycreditwallet.md new file mode 100755 index 00000000..71343d79 --- /dev/null +++ b/docs/models/shared/activitycreditwallet.md @@ -0,0 +1,9 @@ +# ActivityCreditWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Data` | [*CreditWalletRequest](../../models/shared/creditwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitydebitwallet.md b/docs/models/shared/activitydebitwallet.md new file mode 100755 index 00000000..955e532f --- /dev/null +++ b/docs/models/shared/activitydebitwallet.md @@ -0,0 +1,9 @@ +# ActivityDebitWallet + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Data` | [*DebitWalletRequest](../../models/shared/debitwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitydebitwalletoutput.md b/docs/models/shared/activitydebitwalletoutput.md new file mode 100755 index 00000000..b1667af9 --- /dev/null +++ b/docs/models/shared/activitydebitwalletoutput.md @@ -0,0 +1,8 @@ +# ActivityDebitWalletOutput + + +## 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/activitygetaccount.md b/docs/models/shared/activitygetaccount.md new file mode 100755 index 00000000..733d5a87 --- /dev/null +++ b/docs/models/shared/activitygetaccount.md @@ -0,0 +1,9 @@ +# ActivityGetAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitygetaccountoutput.md b/docs/models/shared/activitygetaccountoutput.md new file mode 100755 index 00000000..c63d5ed9 --- /dev/null +++ b/docs/models/shared/activitygetaccountoutput.md @@ -0,0 +1,8 @@ +# ActivityGetAccountOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Data` | [OrchestrationAccount](../../models/shared/orchestrationaccount.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitygetpayment.md b/docs/models/shared/activitygetpayment.md new file mode 100755 index 00000000..7030418b --- /dev/null +++ b/docs/models/shared/activitygetpayment.md @@ -0,0 +1,8 @@ +# ActivityGetPayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitygetpaymentoutput.md b/docs/models/shared/activitygetpaymentoutput.md new file mode 100755 index 00000000..3cafad1b --- /dev/null +++ b/docs/models/shared/activitygetpaymentoutput.md @@ -0,0 +1,8 @@ +# ActivityGetPaymentOutput + + +## 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/activitygetwallet.md b/docs/models/shared/activitygetwallet.md new file mode 100755 index 00000000..482ede87 --- /dev/null +++ b/docs/models/shared/activitygetwallet.md @@ -0,0 +1,8 @@ +# ActivityGetWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/activitygetwalletoutput.md b/docs/models/shared/activitygetwalletoutput.md new file mode 100755 index 00000000..792a658a --- /dev/null +++ b/docs/models/shared/activitygetwalletoutput.md @@ -0,0 +1,8 @@ +# ActivityGetWalletOutput + + +## 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/activitystripetransfer.md b/docs/models/shared/activitystripetransfer.md new file mode 100755 index 00000000..b03e841d --- /dev/null +++ b/docs/models/shared/activitystripetransfer.md @@ -0,0 +1,13 @@ +# ActivityStripeTransfer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | 100 | +| `Asset` | **string* | :heavy_minus_sign: | N/A | USD | +| `ConnectorID` | **string* | :heavy_minus_sign: | N/A | | +| `Destination` | **string* | :heavy_minus_sign: | N/A | acct_1Gqj58KZcSIg2N2q | +| `Metadata` | [*ActivityStripeTransferMetadata](../../models/shared/activitystripetransfermetadata.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.
| | +| `WaitingValidation` | **bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file diff --git a/docs/models/shared/activitystripetransfermetadata.md b/docs/models/shared/activitystripetransfermetadata.md new file mode 100755 index 00000000..055e707c --- /dev/null +++ b/docs/models/shared/activitystripetransfermetadata.md @@ -0,0 +1,11 @@ +# ActivityStripeTransferMetadata + +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/activityvoidhold.md b/docs/models/shared/activityvoidhold.md new file mode 100755 index 00000000..72eb0ab9 --- /dev/null +++ b/docs/models/shared/activityvoidhold.md @@ -0,0 +1,8 @@ +# ActivityVoidHold + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ 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 00000000..82b9b94b --- /dev/null +++ b/docs/models/shared/aggregatebalancesresponse.md @@ -0,0 +1,8 @@ +# AggregateBalancesResponse + + +## Fields + +| 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/assetholder.md b/docs/models/shared/assetholder.md new file mode 100755 index 00000000..fc37e084 --- /dev/null +++ b/docs/models/shared/assetholder.md @@ -0,0 +1,8 @@ +# AssetHolder + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Assets` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..5a8ad86c --- /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_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 | | +| `NextRetryAfter` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | | +| `Payload` | *string* | :heavy_check_mark: | N/A | {"data":"test"} | +| `RetryAttempt` | *int64* | :heavy_check_mark: | N/A | 1 | +| `Status` | *string* | :heavy_check_mark: | N/A | success | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | 200 | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `WebhookID` | *string* | :heavy_check_mark: | 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 00000000..6d45062d --- /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 00000000..7182263b --- /dev/null +++ b/docs/models/shared/balance.md @@ -0,0 +1,10 @@ +# Balance + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `ExpiresAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `Priority` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | 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 00000000..ca5a06c7 --- /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 00000000..2940a354 --- /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 00000000..3ca251c0 --- /dev/null +++ b/docs/models/shared/balancewithassets.md @@ -0,0 +1,11 @@ +# BalanceWithAssets + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Assets` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `ExpiresAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `Priority` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | \ 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 00000000..56a6972c --- /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 00000000..2ae9d20a --- /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 00000000..12bb551e --- /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 00000000..95cba305 --- /dev/null +++ b/docs/models/shared/configchangesecret.md @@ -0,0 +1,8 @@ +# ConfigChangeSecret + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `Secret` | *string* | :heavy_check_mark: | 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 00000000..a62aa540 --- /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 00000000..9a707e9a --- /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 00000000..b5922c97 --- /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 00000000..1c7f68e0 --- /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 00000000..c7f07641 --- /dev/null +++ b/docs/models/shared/configsresponsecursor.md @@ -0,0 +1,9 @@ +# ConfigsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `Data` | [][WebhooksConfig](../../models/shared/webhooksconfig.md) | :heavy_check_mark: | N/A | | +| `HasMore` | *bool* | :heavy_check_mark: | N/A | false | \ 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 00000000..1bdef6f5 --- /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 | TYPE1,TYPE2 | +| `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 00000000..349f475f --- /dev/null +++ b/docs/models/shared/confirmholdrequest.md @@ -0,0 +1,9 @@ +# ConfirmHoldRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..4dafb1ad --- /dev/null +++ b/docs/models/shared/connector.md @@ -0,0 +1,15 @@ +# Connector + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `ConnectorStripe` | STRIPE | +| `ConnectorDummyPay` | DUMMY-PAY | +| `ConnectorWise` | WISE | +| `ConnectorModulr` | MODULR | +| `ConnectorCurrencyCloud` | CURRENCY-CLOUD | +| `ConnectorBankingCircle` | BANKING-CIRCLE | +| `ConnectorMangopay` | MANGOPAY | +| `ConnectorMoneycorp` | MONEYCORP | \ 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 00000000..1eb000c7 --- /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 00000000..09a5a30a --- /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 00000000..b728788e --- /dev/null +++ b/docs/models/shared/createbalancerequest.md @@ -0,0 +1,10 @@ +# CreateBalanceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `ExpiresAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `Priority` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | 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 00000000..b85aa5a9 --- /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 00000000..18d97d89 --- /dev/null +++ b/docs/models/shared/createclientrequest.md @@ -0,0 +1,15 @@ +# 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 | +| `Scopes` | []*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 00000000..10c2816b --- /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/createsecretrequest.md b/docs/models/shared/createsecretrequest.md new file mode 100755 index 00000000..0764cebe --- /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 00000000..51482f92 --- /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/createtriggerresponse.md b/docs/models/shared/createtriggerresponse.md new file mode 100755 index 00000000..2d5fbd3e --- /dev/null +++ b/docs/models/shared/createtriggerresponse.md @@ -0,0 +1,8 @@ +# CreateTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [Trigger](../../models/shared/trigger.md) | :heavy_check_mark: | 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 00000000..65790867 --- /dev/null +++ b/docs/models/shared/createwalletrequest.md @@ -0,0 +1,9 @@ +# CreateWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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 00000000..5eb60a4e --- /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 00000000..b8380049 --- /dev/null +++ b/docs/models/shared/createworkflowrequest.md @@ -0,0 +1,9 @@ +# CreateWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `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 00000000..65db51a5 --- /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 00000000..456162b6 --- /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]*string* | :heavy_check_mark: | 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/debitwalletrequest.md b/docs/models/shared/debitwalletrequest.md new file mode 100755 index 00000000..df93e03a --- /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]*string* | :heavy_check_mark: | 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 00000000..4b4073f8 --- /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/error.md b/docs/models/shared/error.md new file mode 100755 index 00000000..c152dacc --- /dev/null +++ b/docs/models/shared/error.md @@ -0,0 +1,9 @@ +# Error + + +## Fields + +| 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 00000000..cc79cf5e --- /dev/null +++ b/docs/models/shared/errorerrorcode.md @@ -0,0 +1,9 @@ +# ErrorErrorCode + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `ErrorErrorCodeValidation` | VALIDATION | +| `ErrorErrorCodeNotFound` | NOT_FOUND | \ 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 00000000..29931e75 --- /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_check_mark: | N/A | INSUFFICIENT_FUND | +| `ErrorMessage` | *string* | :heavy_check_mark: | 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 00000000..9bd7978b --- /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 00000000..f4a078bd --- /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]*string* | :heavy_check_mark: | Metadata associated with the hold. | | +| `OriginalAmount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | Original amount on hold | 100 | +| `Remaining` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..48e4695c --- /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 00000000..d559f570 --- /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 00000000..89886941 --- /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 00000000..b1729f39 --- /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 00000000..d2976080 --- /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 00000000..4c195421 --- /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/getversionsresponse.md b/docs/models/shared/getversionsresponse.md new file mode 100755 index 00000000..bf490d28 --- /dev/null +++ b/docs/models/shared/getversionsresponse.md @@ -0,0 +1,10 @@ +# GetVersionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Env` | *string* | :heavy_check_mark: | N/A | +| `Region` | *string* | :heavy_check_mark: | N/A | +| `Versions` | [][Version](../../models/shared/version.md) | :heavy_check_mark: | N/A | \ 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 00000000..b00a1d26 --- /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/getwalletsummaryresponse.md b/docs/models/shared/getwalletsummaryresponse.md new file mode 100755 index 00000000..5c1ca823 --- /dev/null +++ b/docs/models/shared/getwalletsummaryresponse.md @@ -0,0 +1,12 @@ +# GetWalletSummaryResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `AvailableFunds` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `Balances` | [][BalanceWithAssets](../../models/shared/balancewithassets.md) | :heavy_check_mark: | N/A | +| `ExpirableFunds` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `ExpiredFunds` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `HoldFunds` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getworkflowinstancehistoryresponse.md b/docs/models/shared/getworkflowinstancehistoryresponse.md new file mode 100755 index 00000000..e8bcb000 --- /dev/null +++ b/docs/models/shared/getworkflowinstancehistoryresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowInstanceHistoryResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Data` | [][WorkflowInstanceHistory](../../models/shared/workflowinstancehistory.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getworkflowinstancehistorystageresponse.md b/docs/models/shared/getworkflowinstancehistorystageresponse.md new file mode 100755 index 00000000..7941f27d --- /dev/null +++ b/docs/models/shared/getworkflowinstancehistorystageresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowInstanceHistoryStageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Data` | [][WorkflowInstanceHistoryStage](../../models/shared/workflowinstancehistorystage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/getworkflowinstanceresponse.md b/docs/models/shared/getworkflowinstanceresponse.md new file mode 100755 index 00000000..ad33c509 --- /dev/null +++ b/docs/models/shared/getworkflowinstanceresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowInstanceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Data` | [WorkflowInstance](../../models/shared/workflowinstance.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 00000000..11396773 --- /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 00000000..5d3d7527 --- /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]*string* | :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 00000000..c6eec721 --- /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 00000000..137b63aa --- /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 00000000..b2c42626 --- /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 00000000..2d93d7e7 --- /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 00000000..159532bd --- /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 00000000..6238accf --- /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 00000000..6b71dd2f --- /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 00000000..ada6d7ee --- /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 00000000..1b08dcf9 --- /dev/null +++ b/docs/models/shared/listrunsresponse.md @@ -0,0 +1,8 @@ +# ListRunsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `Data` | [][WorkflowInstance](../../models/shared/workflowinstance.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listtriggersoccurrencesresponse.md b/docs/models/shared/listtriggersoccurrencesresponse.md new file mode 100755 index 00000000..9aaafd54 --- /dev/null +++ b/docs/models/shared/listtriggersoccurrencesresponse.md @@ -0,0 +1,8 @@ +# ListTriggersOccurrencesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [][TriggerOccurrence](../../models/shared/triggeroccurrence.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/listtriggersresponse.md b/docs/models/shared/listtriggersresponse.md new file mode 100755 index 00000000..7b6e3972 --- /dev/null +++ b/docs/models/shared/listtriggersresponse.md @@ -0,0 +1,8 @@ +# ListTriggersResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Data` | [][Trigger](../../models/shared/trigger.md) | :heavy_check_mark: | 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 00000000..e4586af1 --- /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 00000000..c28c056d --- /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 00000000..63f09726 --- /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 00000000..7986d2b6 --- /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 00000000..58aedd80 --- /dev/null +++ b/docs/models/shared/log.md @@ -0,0 +1,12 @@ +# Log + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Data` | map[string]*interface{}* | :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/logscursorresponse.md b/docs/models/shared/logscursorresponse.md new file mode 100755 index 00000000..322cd96b --- /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 00000000..03fc795d --- /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 00000000..400bcd37 --- /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 00000000..64bfeb78 --- /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 00000000..fc23a2c3 --- /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 00000000..25f25516 --- /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 00000000..5193be71 --- /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/monetary.md b/docs/models/shared/monetary.md new file mode 100755 index 00000000..9597de31 --- /dev/null +++ b/docs/models/shared/monetary.md @@ -0,0 +1,9 @@ +# Monetary + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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/orchestrationaccount.md b/docs/models/shared/orchestrationaccount.md new file mode 100755 index 00000000..1fdae5ff --- /dev/null +++ b/docs/models/shared/orchestrationaccount.md @@ -0,0 +1,11 @@ +# OrchestrationAccount + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `Address` | *string* | :heavy_check_mark: | N/A | users:001 | +| `EffectiveVolumes` | map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | [object Object] | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `Volumes` | map[string][Volume](../../models/shared/volume.md) | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/orchestrationposttransaction.md b/docs/models/shared/orchestrationposttransaction.md new file mode 100755 index 00000000..c6ca8201 --- /dev/null +++ b/docs/models/shared/orchestrationposttransaction.md @@ -0,0 +1,12 @@ +# OrchestrationPostTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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` | [*OrchestrationPostTransactionScript](../../models/shared/orchestrationposttransactionscript.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/orchestrationposttransactionscript.md b/docs/models/shared/orchestrationposttransactionscript.md new file mode 100755 index 00000000..0f7807b9 --- /dev/null +++ b/docs/models/shared/orchestrationposttransactionscript.md @@ -0,0 +1,9 @@ +# OrchestrationPostTransactionScript + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Plain` | *string* | :heavy_check_mark: | N/A | vars {
account $user
}
send [COIN 10] (
source = @world
destination = $user
)
| +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/orchestrationtransaction.md b/docs/models/shared/orchestrationtransaction.md new file mode 100755 index 00000000..8676788a --- /dev/null +++ b/docs/models/shared/orchestrationtransaction.md @@ -0,0 +1,12 @@ +# OrchestrationTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/orchestrationv2transaction.md b/docs/models/shared/orchestrationv2transaction.md new file mode 100755 index 00000000..8c6691ad --- /dev/null +++ b/docs/models/shared/orchestrationv2transaction.md @@ -0,0 +1,12 @@ +# OrchestrationV2Transaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `Postings` | [][V2Posting](../../models/shared/v2posting.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_check_mark: | N/A | | \ 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 00000000..0b74bb59 --- /dev/null +++ b/docs/models/shared/payment.md @@ -0,0 +1,22 @@ +# Payment + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Adjustments` | [][PaymentAdjustment](../../models/shared/paymentadjustment.md) | :heavy_check_mark: | N/A | | +| `Asset` | *string* | :heavy_check_mark: | N/A | USD | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `DestinationAccountID` | *string* | :heavy_check_mark: | N/A | | +| `ID` | *string* | :heavy_check_mark: | N/A | XXX | +| `InitialAmount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | 100 | +| `Metadata` | [PaymentMetadata](../../models/shared/paymentmetadata.md) | :heavy_check_mark: | N/A | | +| `Provider` | [*Connector](../../models/shared/connector.md) | :heavy_minus_sign: | 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 | | +| `SourceAccountID` | *string* | :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 00000000..16e560fe --- /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` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..78f88aee --- /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 00000000..a1ac8d12 --- /dev/null +++ b/docs/models/shared/paymentmetadata.md @@ -0,0 +1,8 @@ +# PaymentMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | 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 00000000..e884afe3 --- /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/paymentscheme.md b/docs/models/shared/paymentscheme.md new file mode 100755 index 00000000..e88c62fd --- /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/paymentstatus.md b/docs/models/shared/paymentstatus.md new file mode 100755 index 00000000..2a930974 --- /dev/null +++ b/docs/models/shared/paymentstatus.md @@ -0,0 +1,13 @@ +# PaymentStatus + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `PaymentStatusPending` | PENDING | +| `PaymentStatusActive` | ACTIVE | +| `PaymentStatusTerminated` | TERMINATED | +| `PaymentStatusFailed` | FAILED | +| `PaymentStatusSucceeded` | SUCCEEDED | +| `PaymentStatusCancelled` | CANCELLED | \ 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 00000000..dfc9842b --- /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/policiescursorresponse.md b/docs/models/shared/policiescursorresponse.md new file mode 100755 index 00000000..20501b4d --- /dev/null +++ b/docs/models/shared/policiescursorresponse.md @@ -0,0 +1,8 @@ +# PoliciesCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Cursor` | [PoliciesCursorResponseCursor](../../models/shared/policiescursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/policiescursorresponsecursor.md b/docs/models/shared/policiescursorresponsecursor.md new file mode 100755 index 00000000..c9fb6307 --- /dev/null +++ b/docs/models/shared/policiescursorresponsecursor.md @@ -0,0 +1,12 @@ +# PoliciesCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][Policy](../../models/shared/policy.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/policy.md b/docs/models/shared/policy.md new file mode 100755 index 00000000..fad571b9 --- /dev/null +++ b/docs/models/shared/policy.md @@ -0,0 +1,13 @@ +# Policy + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ID` | *string* | :heavy_check_mark: | N/A | XXX | +| `LedgerName` | *string* | :heavy_check_mark: | N/A | default | +| `LedgerQuery` | *string* | :heavy_check_mark: | N/A | {"$match": {"metadata[reconciliation]": "pool:main"}} | +| `Name` | *string* | :heavy_check_mark: | N/A | XXX | +| `PaymentsPoolID` | *string* | :heavy_check_mark: | N/A | XXX | \ No newline at end of file diff --git a/docs/models/shared/policyrequest.md b/docs/models/shared/policyrequest.md new file mode 100755 index 00000000..07f66355 --- /dev/null +++ b/docs/models/shared/policyrequest.md @@ -0,0 +1,11 @@ +# PolicyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `LedgerName` | *string* | :heavy_check_mark: | N/A | default | +| `LedgerQuery` | *string* | :heavy_check_mark: | N/A | {"$match": {"metadata[reconciliation]": "pool:main"}} | +| `Name` | *string* | :heavy_check_mark: | N/A | XXX | +| `PaymentsPoolID` | *string* | :heavy_check_mark: | N/A | XXX | \ No newline at end of file diff --git a/docs/models/shared/policyresponse.md b/docs/models/shared/policyresponse.md new file mode 100755 index 00000000..6f4d9ab6 --- /dev/null +++ b/docs/models/shared/policyresponse.md @@ -0,0 +1,8 @@ +# PolicyResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Policy` | [*Policy](../../models/shared/policy.md) | :heavy_minus_sign: | N/A | \ 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 00000000..dc8a9ec9 --- /dev/null +++ b/docs/models/shared/posting.md @@ -0,0 +1,11 @@ +# Posting + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..87ad2d9a --- /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 00000000..73a35f5e --- /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` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | \ 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 00000000..ae1ed438 --- /dev/null +++ b/docs/models/shared/query.md @@ -0,0 +1,16 @@ +# Query + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `After` | []*string* | :heavy_minus_sign: | N/A | users:002 | +| `Cursor` | **string* | :heavy_minus_sign: | N/A | YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol= | +| `Ledgers` | []*string* | :heavy_minus_sign: | N/A | quickstart | +| `PageSize` | **int64* | :heavy_minus_sign: | N/A | | +| `Policy` | **string* | :heavy_minus_sign: | N/A | OR | +| `Raw` | [*QueryRaw](../../models/shared/queryraw.md) | :heavy_minus_sign: | N/A | | +| `Sort` | **string* | :heavy_minus_sign: | N/A | id:asc | +| `Target` | **string* | :heavy_minus_sign: | N/A | | +| `Terms` | []*string* | :heavy_minus_sign: | N/A | destination=central_bank1 | \ No newline at end of file diff --git a/docs/models/shared/queryraw.md b/docs/models/shared/queryraw.md new file mode 100755 index 00000000..997785b4 --- /dev/null +++ b/docs/models/shared/queryraw.md @@ -0,0 +1,7 @@ +# QueryRaw + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ 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 00000000..fb6d823f --- /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/readtriggerresponse.md b/docs/models/shared/readtriggerresponse.md new file mode 100755 index 00000000..31006624 --- /dev/null +++ b/docs/models/shared/readtriggerresponse.md @@ -0,0 +1,8 @@ +# ReadTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [Trigger](../../models/shared/trigger.md) | :heavy_check_mark: | 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 00000000..2aef17f0 --- /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/reconciliation.md b/docs/models/shared/reconciliation.md new file mode 100755 index 00000000..a4fe2535 --- /dev/null +++ b/docs/models/shared/reconciliation.md @@ -0,0 +1,17 @@ +# Reconciliation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `DriftBalances` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `Error` | **string* | :heavy_minus_sign: | N/A | | +| `ID` | *string* | :heavy_check_mark: | N/A | XXX | +| `LedgerBalances` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `PaymentsBalances` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `PolicyID` | *string* | :heavy_check_mark: | N/A | XXX | +| `ReconciledAtLedger` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ReconciledAtPayments` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `Status` | *string* | :heavy_check_mark: | N/A | COMPLETED | \ No newline at end of file diff --git a/docs/models/shared/reconciliationerrorresponse.md b/docs/models/shared/reconciliationerrorresponse.md new file mode 100755 index 00000000..44295930 --- /dev/null +++ b/docs/models/shared/reconciliationerrorresponse.md @@ -0,0 +1,10 @@ +# ReconciliationErrorResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Details` | **string* | :heavy_minus_sign: | N/A | | +| `ErrorCode` | *string* | :heavy_check_mark: | N/A | VALIDATION | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/reconciliationrequest.md b/docs/models/shared/reconciliationrequest.md new file mode 100755 index 00000000..551150f1 --- /dev/null +++ b/docs/models/shared/reconciliationrequest.md @@ -0,0 +1,9 @@ +# ReconciliationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `ReconciledAtLedger` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | +| `ReconciledAtPayments` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | 2021-01-01T00:00:00.000Z | \ No newline at end of file diff --git a/docs/models/shared/reconciliationresponse.md b/docs/models/shared/reconciliationresponse.md new file mode 100755 index 00000000..10c2f49f --- /dev/null +++ b/docs/models/shared/reconciliationresponse.md @@ -0,0 +1,8 @@ +# ReconciliationResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Reconciliation` | [*Reconciliation](../../models/shared/reconciliation.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/reconciliationscursorresponse.md b/docs/models/shared/reconciliationscursorresponse.md new file mode 100755 index 00000000..8aa50fe1 --- /dev/null +++ b/docs/models/shared/reconciliationscursorresponse.md @@ -0,0 +1,8 @@ +# ReconciliationsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Cursor` | [ReconciliationsCursorResponseCursor](../../models/shared/reconciliationscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/reconciliationscursorresponsecursor.md b/docs/models/shared/reconciliationscursorresponsecursor.md new file mode 100755 index 00000000..bf77dd06 --- /dev/null +++ b/docs/models/shared/reconciliationscursorresponsecursor.md @@ -0,0 +1,12 @@ +# ReconciliationsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `Data` | [][Reconciliation](../../models/shared/reconciliation.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/response.md b/docs/models/shared/response.md new file mode 100755 index 00000000..5ec3245a --- /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` | map[string]*interface{}* | :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 00000000..7654e0b6 --- /dev/null +++ b/docs/models/shared/responsecursor.md @@ -0,0 +1,13 @@ +# ResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Data` | []map[string]*interface{}* | :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/responsecursortotal.md b/docs/models/shared/responsecursortotal.md new file mode 100755 index 00000000..dfa57692 --- /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/runworkflowresponse.md b/docs/models/shared/runworkflowresponse.md new file mode 100755 index 00000000..d53ee216 --- /dev/null +++ b/docs/models/shared/runworkflowresponse.md @@ -0,0 +1,8 @@ +# RunWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Data` | [WorkflowInstance](../../models/shared/workflowinstance.md) | :heavy_check_mark: | 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 00000000..65391c53 --- /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` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | \ 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 00000000..8f249964 --- /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/secret.md b/docs/models/shared/secret.md new file mode 100755 index 00000000..851b9921 --- /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/serverinfo.md b/docs/models/shared/serverinfo.md new file mode 100755 index 00000000..bf626a0f --- /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/stage.md b/docs/models/shared/stage.md new file mode 100755 index 00000000..f4f9c404 --- /dev/null +++ b/docs/models/shared/stage.md @@ -0,0 +1,23 @@ +# Stage + + +## Supported Types + +### StageSend + +```go +stage := shared.CreateStageStageSend(shared.StageSend{/* values here */}) +``` + +### StageDelay + +```go +stage := shared.CreateStageStageDelay(shared.StageDelay{/* values here */}) +``` + +### StageWaitEvent + +```go +stage := shared.CreateStageStageWaitEvent(shared.StageWaitEvent{/* values here */}) +``` + diff --git a/docs/models/shared/stagedelay.md b/docs/models/shared/stagedelay.md new file mode 100755 index 00000000..3a2744ea --- /dev/null +++ b/docs/models/shared/stagedelay.md @@ -0,0 +1,9 @@ +# StageDelay + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Duration` | **string* | :heavy_minus_sign: | N/A | +| `Until` | [*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/stagesend.md b/docs/models/shared/stagesend.md new file mode 100755 index 00000000..925233a9 --- /dev/null +++ b/docs/models/shared/stagesend.md @@ -0,0 +1,10 @@ +# StageSend + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Amount` | [*Monetary](../../models/shared/monetary.md) | :heavy_minus_sign: | N/A | +| `Destination` | [*StageSendDestination](../../models/shared/stagesenddestination.md) | :heavy_minus_sign: | N/A | +| `Source` | [*StageSendSource](../../models/shared/stagesendsource.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesenddestination.md b/docs/models/shared/stagesenddestination.md new file mode 100755 index 00000000..865a08d4 --- /dev/null +++ b/docs/models/shared/stagesenddestination.md @@ -0,0 +1,10 @@ +# StageSendDestination + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Account` | [*StageSendDestinationAccount](../../models/shared/stagesenddestinationaccount.md) | :heavy_minus_sign: | N/A | +| `Payment` | [*StageSendDestinationPayment](../../models/shared/stagesenddestinationpayment.md) | :heavy_minus_sign: | N/A | +| `Wallet` | [*StageSendDestinationWallet](../../models/shared/stagesenddestinationwallet.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesenddestinationaccount.md b/docs/models/shared/stagesenddestinationaccount.md new file mode 100755 index 00000000..de0e8316 --- /dev/null +++ b/docs/models/shared/stagesenddestinationaccount.md @@ -0,0 +1,9 @@ +# StageSendDestinationAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesenddestinationpayment.md b/docs/models/shared/stagesenddestinationpayment.md new file mode 100755 index 00000000..44bfc23a --- /dev/null +++ b/docs/models/shared/stagesenddestinationpayment.md @@ -0,0 +1,8 @@ +# StageSendDestinationPayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Psp` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesenddestinationwallet.md b/docs/models/shared/stagesenddestinationwallet.md new file mode 100755 index 00000000..a517d624 --- /dev/null +++ b/docs/models/shared/stagesenddestinationwallet.md @@ -0,0 +1,9 @@ +# StageSendDestinationWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesendsource.md b/docs/models/shared/stagesendsource.md new file mode 100755 index 00000000..8c6dae3c --- /dev/null +++ b/docs/models/shared/stagesendsource.md @@ -0,0 +1,10 @@ +# StageSendSource + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Account` | [*StageSendSourceAccount](../../models/shared/stagesendsourceaccount.md) | :heavy_minus_sign: | N/A | +| `Payment` | [*StageSendSourcePayment](../../models/shared/stagesendsourcepayment.md) | :heavy_minus_sign: | N/A | +| `Wallet` | [*StageSendSourceWallet](../../models/shared/stagesendsourcewallet.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesendsourceaccount.md b/docs/models/shared/stagesendsourceaccount.md new file mode 100755 index 00000000..2330e55a --- /dev/null +++ b/docs/models/shared/stagesendsourceaccount.md @@ -0,0 +1,9 @@ +# StageSendSourceAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesendsourcepayment.md b/docs/models/shared/stagesendsourcepayment.md new file mode 100755 index 00000000..e8849941 --- /dev/null +++ b/docs/models/shared/stagesendsourcepayment.md @@ -0,0 +1,8 @@ +# StageSendSourcePayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/stagesendsourcewallet.md b/docs/models/shared/stagesendsourcewallet.md new file mode 100755 index 00000000..df3aed9e --- /dev/null +++ b/docs/models/shared/stagesendsourcewallet.md @@ -0,0 +1,9 @@ +# StageSendSourceWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *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 00000000..33c9ec0a --- /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 | +| `InstanceID` | *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/stagewaitevent.md b/docs/models/shared/stagewaitevent.md new file mode 100755 index 00000000..7eaf776a --- /dev/null +++ b/docs/models/shared/stagewaitevent.md @@ -0,0 +1,8 @@ +# StageWaitEvent + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Event` | *string* | :heavy_check_mark: | 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 00000000..c87615bc --- /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 00000000..fdc38111 --- /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/subject.md b/docs/models/shared/subject.md new file mode 100755 index 00000000..8d398e24 --- /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/transaction.md b/docs/models/shared/transaction.md new file mode 100755 index 00000000..11442ab3 --- /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 | [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 | [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` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..b3fc32b9 --- /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 00000000..9200d43e --- /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 00000000..c6c4b997 --- /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 00000000..1cb12dc2 --- /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 00000000..0a29700a --- /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 00000000..3d9db87d --- /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/trigger.md b/docs/models/shared/trigger.md new file mode 100755 index 00000000..a1a69dc7 --- /dev/null +++ b/docs/models/shared/trigger.md @@ -0,0 +1,13 @@ +# Trigger + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Event` | *string* | :heavy_check_mark: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `WorkflowID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/triggerdata.md b/docs/models/shared/triggerdata.md new file mode 100755 index 00000000..ed9f722e --- /dev/null +++ b/docs/models/shared/triggerdata.md @@ -0,0 +1,11 @@ +# TriggerData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Event` | *string* | :heavy_check_mark: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `WorkflowID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/triggeroccurrence.md b/docs/models/shared/triggeroccurrence.md new file mode 100755 index 00000000..3370ace2 --- /dev/null +++ b/docs/models/shared/triggeroccurrence.md @@ -0,0 +1,11 @@ +# TriggerOccurrence + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Date` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Event` | map[string]*interface{}* | :heavy_check_mark: | N/A | +| `TriggerID` | *string* | :heavy_check_mark: | N/A | +| `WorkflowInstanceID` | *string* | :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 00000000..6b960950 --- /dev/null +++ b/docs/models/shared/updateclientrequest.md @@ -0,0 +1,15 @@ +# 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 | +| `Scopes` | []*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 00000000..d76a9476 --- /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/user.md b/docs/models/shared/user.md new file mode 100755 index 00000000..b0353735 --- /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/v2account.md b/docs/models/shared/v2account.md new file mode 100755 index 00000000..60a0dd67 --- /dev/null +++ b/docs/models/shared/v2account.md @@ -0,0 +1,11 @@ +# V2Account + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Address` | *string* | :heavy_check_mark: | N/A | users:001 | +| `EffectiveVolumes` | map[string][V2Volume](../../models/shared/v2volume.md) | :heavy_minus_sign: | N/A | [object Object] | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `Volumes` | map[string][V2Volume](../../models/shared/v2volume.md) | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/v2accountresponse.md b/docs/models/shared/v2accountresponse.md new file mode 100755 index 00000000..7f393cf6 --- /dev/null +++ b/docs/models/shared/v2accountresponse.md @@ -0,0 +1,8 @@ +# V2AccountResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [V2Account](../../models/shared/v2account.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2accountscursorresponse.md b/docs/models/shared/v2accountscursorresponse.md new file mode 100755 index 00000000..0194b147 --- /dev/null +++ b/docs/models/shared/v2accountscursorresponse.md @@ -0,0 +1,8 @@ +# V2AccountsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `Cursor` | [V2AccountsCursorResponseCursor](../../models/shared/v2accountscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2accountscursorresponsecursor.md b/docs/models/shared/v2accountscursorresponsecursor.md new file mode 100755 index 00000000..3b7d7310 --- /dev/null +++ b/docs/models/shared/v2accountscursorresponsecursor.md @@ -0,0 +1,12 @@ +# V2AccountsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Data` | [][V2Account](../../models/shared/v2account.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/v2activityconfirmhold.md b/docs/models/shared/v2activityconfirmhold.md new file mode 100755 index 00000000..27bb078b --- /dev/null +++ b/docs/models/shared/v2activityconfirmhold.md @@ -0,0 +1,8 @@ +# V2ActivityConfirmHold + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitycreatetransaction.md b/docs/models/shared/v2activitycreatetransaction.md new file mode 100755 index 00000000..073ff777 --- /dev/null +++ b/docs/models/shared/v2activitycreatetransaction.md @@ -0,0 +1,9 @@ +# V2ActivityCreateTransaction + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Data` | [*V2PostTransaction](../../models/shared/v2posttransaction.md) | :heavy_minus_sign: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitycreatetransactionoutput.md b/docs/models/shared/v2activitycreatetransactionoutput.md new file mode 100755 index 00000000..b0625476 --- /dev/null +++ b/docs/models/shared/v2activitycreatetransactionoutput.md @@ -0,0 +1,8 @@ +# V2ActivityCreateTransactionOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Data` | [OrchestrationV2Transaction](../../models/shared/orchestrationv2transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitycreditwallet.md b/docs/models/shared/v2activitycreditwallet.md new file mode 100755 index 00000000..0a267e2b --- /dev/null +++ b/docs/models/shared/v2activitycreditwallet.md @@ -0,0 +1,9 @@ +# V2ActivityCreditWallet + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Data` | [*V2CreditWalletRequest](../../models/shared/v2creditwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitydebitwallet.md b/docs/models/shared/v2activitydebitwallet.md new file mode 100755 index 00000000..c9750123 --- /dev/null +++ b/docs/models/shared/v2activitydebitwallet.md @@ -0,0 +1,9 @@ +# V2ActivityDebitWallet + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Data` | [*V2DebitWalletRequest](../../models/shared/v2debitwalletrequest.md) | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitydebitwalletoutput.md b/docs/models/shared/v2activitydebitwalletoutput.md new file mode 100755 index 00000000..bb31ecc6 --- /dev/null +++ b/docs/models/shared/v2activitydebitwalletoutput.md @@ -0,0 +1,8 @@ +# V2ActivityDebitWalletOutput + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `Data` | [V2Hold](../../models/shared/v2hold.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetaccount.md b/docs/models/shared/v2activitygetaccount.md new file mode 100755 index 00000000..2f4a1e93 --- /dev/null +++ b/docs/models/shared/v2activitygetaccount.md @@ -0,0 +1,9 @@ +# V2ActivityGetAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetaccountoutput.md b/docs/models/shared/v2activitygetaccountoutput.md new file mode 100755 index 00000000..62e2967c --- /dev/null +++ b/docs/models/shared/v2activitygetaccountoutput.md @@ -0,0 +1,8 @@ +# V2ActivityGetAccountOutput + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [V2Account](../../models/shared/v2account.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetpayment.md b/docs/models/shared/v2activitygetpayment.md new file mode 100755 index 00000000..3e225cee --- /dev/null +++ b/docs/models/shared/v2activitygetpayment.md @@ -0,0 +1,8 @@ +# V2ActivityGetPayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetpaymentoutput.md b/docs/models/shared/v2activitygetpaymentoutput.md new file mode 100755 index 00000000..e0fd29b6 --- /dev/null +++ b/docs/models/shared/v2activitygetpaymentoutput.md @@ -0,0 +1,8 @@ +# V2ActivityGetPaymentOutput + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [V2Payment](../../models/shared/v2payment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetwallet.md b/docs/models/shared/v2activitygetwallet.md new file mode 100755 index 00000000..39beb122 --- /dev/null +++ b/docs/models/shared/v2activitygetwallet.md @@ -0,0 +1,8 @@ +# V2ActivityGetWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitygetwalletoutput.md b/docs/models/shared/v2activitygetwalletoutput.md new file mode 100755 index 00000000..81ffa0cb --- /dev/null +++ b/docs/models/shared/v2activitygetwalletoutput.md @@ -0,0 +1,8 @@ +# V2ActivityGetWalletOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Data` | [V2WalletWithBalances](../../models/shared/v2walletwithbalances.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2activitystripetransfer.md b/docs/models/shared/v2activitystripetransfer.md new file mode 100755 index 00000000..f9d6bc8f --- /dev/null +++ b/docs/models/shared/v2activitystripetransfer.md @@ -0,0 +1,13 @@ +# V2ActivityStripeTransfer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | 100 | +| `Asset` | **string* | :heavy_minus_sign: | N/A | USD | +| `ConnectorID` | **string* | :heavy_minus_sign: | N/A | | +| `Destination` | **string* | :heavy_minus_sign: | N/A | acct_1Gqj58KZcSIg2N2q | +| `Metadata` | [*V2ActivityStripeTransferMetadata](../../models/shared/v2activitystripetransfermetadata.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.
| | +| `WaitingValidation` | **bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file diff --git a/docs/models/shared/v2activitystripetransfermetadata.md b/docs/models/shared/v2activitystripetransfermetadata.md new file mode 100755 index 00000000..2f03195a --- /dev/null +++ b/docs/models/shared/v2activitystripetransfermetadata.md @@ -0,0 +1,11 @@ +# V2ActivityStripeTransferMetadata + +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/v2activityvoidhold.md b/docs/models/shared/v2activityvoidhold.md new file mode 100755 index 00000000..d772f31f --- /dev/null +++ b/docs/models/shared/v2activityvoidhold.md @@ -0,0 +1,8 @@ +# V2ActivityVoidHold + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2aggregatebalancesresponse.md b/docs/models/shared/v2aggregatebalancesresponse.md new file mode 100755 index 00000000..1d4dac62 --- /dev/null +++ b/docs/models/shared/v2aggregatebalancesresponse.md @@ -0,0 +1,8 @@ +# V2AggregateBalancesResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Data` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/v2assetholder.md b/docs/models/shared/v2assetholder.md new file mode 100755 index 00000000..b689bf5d --- /dev/null +++ b/docs/models/shared/v2assetholder.md @@ -0,0 +1,8 @@ +# V2AssetHolder + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Assets` | map[string][*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelement.md b/docs/models/shared/v2bulkelement.md new file mode 100755 index 00000000..9d294a9d --- /dev/null +++ b/docs/models/shared/v2bulkelement.md @@ -0,0 +1,29 @@ +# V2BulkElement + + +## Supported Types + +### V2BulkElementV2BulkElementAddMetadata + +```go +v2BulkElement := shared.CreateV2BulkElementAddMetadata(shared.V2BulkElementV2BulkElementAddMetadata{/* values here */}) +``` + +### V2BulkElementV2BulkElementCreateTransaction + +```go +v2BulkElement := shared.CreateV2BulkElementCreateTransaction(shared.V2BulkElementV2BulkElementCreateTransaction{/* values here */}) +``` + +### V2BulkElementV2BulkElementDeleteMetadata + +```go +v2BulkElement := shared.CreateV2BulkElementDeleteMetadata(shared.V2BulkElementV2BulkElementDeleteMetadata{/* values here */}) +``` + +### V2BulkElementV2BulkElementRevertTransaction + +```go +v2BulkElement := shared.CreateV2BulkElementRevertTransaction(shared.V2BulkElementV2BulkElementRevertTransaction{/* values here */}) +``` + diff --git a/docs/models/shared/v2bulkelementresult.md b/docs/models/shared/v2bulkelementresult.md new file mode 100755 index 00000000..fe6387d3 --- /dev/null +++ b/docs/models/shared/v2bulkelementresult.md @@ -0,0 +1,35 @@ +# V2BulkElementResult + + +## Supported Types + +### V2BulkElementResultV2BulkElementResultAddMetadata + +```go +v2BulkElementResult := shared.CreateV2BulkElementResultAddMetadata(shared.V2BulkElementResultV2BulkElementResultAddMetadata{/* values here */}) +``` + +### V2BulkElementResultV2BulkElementResultCreateTransaction + +```go +v2BulkElementResult := shared.CreateV2BulkElementResultCreateTransaction(shared.V2BulkElementResultV2BulkElementResultCreateTransaction{/* values here */}) +``` + +### V2BulkElementResultV2BulkElementResultDeleteMetadata + +```go +v2BulkElementResult := shared.CreateV2BulkElementResultDeleteMetadata(shared.V2BulkElementResultV2BulkElementResultDeleteMetadata{/* values here */}) +``` + +### V2BulkElementResultV2BulkElementResultError + +```go +v2BulkElementResult := shared.CreateV2BulkElementResultError(shared.V2BulkElementResultV2BulkElementResultError{/* values here */}) +``` + +### V2BulkElementResultV2BulkElementResultRevertTransaction + +```go +v2BulkElementResult := shared.CreateV2BulkElementResultRevertTransaction(shared.V2BulkElementResultV2BulkElementResultRevertTransaction{/* values here */}) +``` + diff --git a/docs/models/shared/v2bulkelementresultv2bulkelementresultaddmetadata.md b/docs/models/shared/v2bulkelementresultv2bulkelementresultaddmetadata.md new file mode 100755 index 00000000..f904bcc5 --- /dev/null +++ b/docs/models/shared/v2bulkelementresultv2bulkelementresultaddmetadata.md @@ -0,0 +1,8 @@ +# V2BulkElementResultV2BulkElementResultAddMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementresultv2bulkelementresultcreatetransaction.md b/docs/models/shared/v2bulkelementresultv2bulkelementresultcreatetransaction.md new file mode 100755 index 00000000..4715f274 --- /dev/null +++ b/docs/models/shared/v2bulkelementresultv2bulkelementresultcreatetransaction.md @@ -0,0 +1,9 @@ +# V2BulkElementResultV2BulkElementResultCreateTransaction + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Data` | [V2Transaction](../../models/shared/v2transaction.md) | :heavy_check_mark: | N/A | +| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementresultv2bulkelementresultdeletemetadata.md b/docs/models/shared/v2bulkelementresultv2bulkelementresultdeletemetadata.md new file mode 100755 index 00000000..dde68a42 --- /dev/null +++ b/docs/models/shared/v2bulkelementresultv2bulkelementresultdeletemetadata.md @@ -0,0 +1,8 @@ +# V2BulkElementResultV2BulkElementResultDeleteMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementresultv2bulkelementresulterror.md b/docs/models/shared/v2bulkelementresultv2bulkelementresulterror.md new file mode 100755 index 00000000..a024f66a --- /dev/null +++ b/docs/models/shared/v2bulkelementresultv2bulkelementresulterror.md @@ -0,0 +1,11 @@ +# V2BulkElementResultV2BulkElementResultError + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ErrorCode` | *string* | :heavy_check_mark: | N/A | +| `ErrorDescription` | *string* | :heavy_check_mark: | N/A | +| `ErrorDetails` | **string* | :heavy_minus_sign: | N/A | +| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementresultv2bulkelementresultreverttransaction.md b/docs/models/shared/v2bulkelementresultv2bulkelementresultreverttransaction.md new file mode 100755 index 00000000..202f7867 --- /dev/null +++ b/docs/models/shared/v2bulkelementresultv2bulkelementresultreverttransaction.md @@ -0,0 +1,9 @@ +# V2BulkElementResultV2BulkElementResultRevertTransaction + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Data` | [V2Transaction](../../models/shared/v2transaction.md) | :heavy_check_mark: | N/A | +| `ResponseType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementaddmetadata.md b/docs/models/shared/v2bulkelementv2bulkelementaddmetadata.md new file mode 100755 index 00000000..826ffc99 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementaddmetadata.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementAddMetadata + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Action` | *string* | :heavy_check_mark: | N/A | +| `Data` | [*V2BulkElementV2BulkElementAddMetadataData](../../models/shared/v2bulkelementv2bulkelementaddmetadatadata.md) | :heavy_minus_sign: | N/A | +| `Ik` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementaddmetadatadata.md b/docs/models/shared/v2bulkelementv2bulkelementaddmetadatadata.md new file mode 100755 index 00000000..67d9a4c6 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementaddmetadatadata.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementAddMetadataData + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | +| `TargetID` | [V2TargetID](../../models/shared/v2targetid.md) | :heavy_check_mark: | N/A | +| `TargetType` | [V2TargetType](../../models/shared/v2targettype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementcreatetransaction.md b/docs/models/shared/v2bulkelementv2bulkelementcreatetransaction.md new file mode 100755 index 00000000..1e933d21 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementcreatetransaction.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementCreateTransaction + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Action` | *string* | :heavy_check_mark: | N/A | +| `Data` | [*V2PostTransaction](../../models/shared/v2posttransaction.md) | :heavy_minus_sign: | N/A | +| `Ik` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementdeletemetadata.md b/docs/models/shared/v2bulkelementv2bulkelementdeletemetadata.md new file mode 100755 index 00000000..facc3273 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementdeletemetadata.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementDeleteMetadata + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `Action` | *string* | :heavy_check_mark: | N/A | +| `Data` | [*V2BulkElementV2BulkElementDeleteMetadataData](../../models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md) | :heavy_minus_sign: | N/A | +| `Ik` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md b/docs/models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md new file mode 100755 index 00000000..8fcab231 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementDeleteMetadataData + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Key` | *string* | :heavy_check_mark: | N/A | +| `TargetID` | [V2TargetID](../../models/shared/v2targetid.md) | :heavy_check_mark: | N/A | +| `TargetType` | [V2TargetType](../../models/shared/v2targettype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementreverttransaction.md b/docs/models/shared/v2bulkelementv2bulkelementreverttransaction.md new file mode 100755 index 00000000..8c5a09a8 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementreverttransaction.md @@ -0,0 +1,10 @@ +# V2BulkElementV2BulkElementRevertTransaction + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `Action` | *string* | :heavy_check_mark: | N/A | +| `Data` | [*V2BulkElementV2BulkElementRevertTransactionData](../../models/shared/v2bulkelementv2bulkelementreverttransactiondata.md) | :heavy_minus_sign: | N/A | +| `Ik` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkelementv2bulkelementreverttransactiondata.md b/docs/models/shared/v2bulkelementv2bulkelementreverttransactiondata.md new file mode 100755 index 00000000..498c15d0 --- /dev/null +++ b/docs/models/shared/v2bulkelementv2bulkelementreverttransactiondata.md @@ -0,0 +1,9 @@ +# V2BulkElementV2BulkElementRevertTransactionData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Force` | **bool* | :heavy_minus_sign: | N/A | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2bulkresponse.md b/docs/models/shared/v2bulkresponse.md new file mode 100755 index 00000000..b8aa5456 --- /dev/null +++ b/docs/models/shared/v2bulkresponse.md @@ -0,0 +1,8 @@ +# V2BulkResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Data` | [][V2BulkElementResult](../../models/shared/v2bulkelementresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2configinforesponse.md b/docs/models/shared/v2configinforesponse.md new file mode 100755 index 00000000..146140e0 --- /dev/null +++ b/docs/models/shared/v2configinforesponse.md @@ -0,0 +1,9 @@ +# V2ConfigInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `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/v2connector.md b/docs/models/shared/v2connector.md new file mode 100755 index 00000000..9aaa31a5 --- /dev/null +++ b/docs/models/shared/v2connector.md @@ -0,0 +1,15 @@ +# V2Connector + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `V2ConnectorStripe` | STRIPE | +| `V2ConnectorDummyPay` | DUMMY-PAY | +| `V2ConnectorWise` | WISE | +| `V2ConnectorModulr` | MODULR | +| `V2ConnectorCurrencyCloud` | CURRENCY-CLOUD | +| `V2ConnectorBankingCircle` | BANKING-CIRCLE | +| `V2ConnectorMangopay` | MANGOPAY | +| `V2ConnectorMoneycorp` | MONEYCORP | \ No newline at end of file diff --git a/docs/models/shared/v2createledgerrequest.md b/docs/models/shared/v2createledgerrequest.md new file mode 100755 index 00000000..05cceb2d --- /dev/null +++ b/docs/models/shared/v2createledgerrequest.md @@ -0,0 +1,8 @@ +# V2CreateLedgerRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Bucket` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2createtransactionresponse.md b/docs/models/shared/v2createtransactionresponse.md new file mode 100755 index 00000000..4baf28c1 --- /dev/null +++ b/docs/models/shared/v2createtransactionresponse.md @@ -0,0 +1,8 @@ +# V2CreateTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Data` | [V2Transaction](../../models/shared/v2transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2createtriggerresponse.md b/docs/models/shared/v2createtriggerresponse.md new file mode 100755 index 00000000..2ee5c44a --- /dev/null +++ b/docs/models/shared/v2createtriggerresponse.md @@ -0,0 +1,8 @@ +# V2CreateTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [V2Trigger](../../models/shared/v2trigger.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2createworkflowrequest.md b/docs/models/shared/v2createworkflowrequest.md new file mode 100755 index 00000000..ce2817b2 --- /dev/null +++ b/docs/models/shared/v2createworkflowrequest.md @@ -0,0 +1,9 @@ +# V2CreateWorkflowRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `Stages` | []map[string]*interface{}* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2createworkflowresponse.md b/docs/models/shared/v2createworkflowresponse.md new file mode 100755 index 00000000..9bb72f0a --- /dev/null +++ b/docs/models/shared/v2createworkflowresponse.md @@ -0,0 +1,8 @@ +# V2CreateWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Data` | [V2Workflow](../../models/shared/v2workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2creditwalletrequest.md b/docs/models/shared/v2creditwalletrequest.md new file mode 100755 index 00000000..06e53c8e --- /dev/null +++ b/docs/models/shared/v2creditwalletrequest.md @@ -0,0 +1,12 @@ +# V2CreditWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Amount` | [V2Monetary](../../models/shared/v2monetary.md) | :heavy_check_mark: | N/A | +| `Balance` | **string* | :heavy_minus_sign: | The balance to credit | +| `Metadata` | map[string]*string* | :heavy_check_mark: | Metadata associated with the wallet. | +| `Reference` | **string* | :heavy_minus_sign: | N/A | +| `Sources` | [][V2Subject](../../models/shared/v2subject.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2debitwalletrequest.md b/docs/models/shared/v2debitwalletrequest.md new file mode 100755 index 00000000..8692529d --- /dev/null +++ b/docs/models/shared/v2debitwalletrequest.md @@ -0,0 +1,13 @@ +# V2DebitWalletRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `Amount` | [V2Monetary](../../models/shared/v2monetary.md) | :heavy_check_mark: | N/A | +| `Balances` | []*string* | :heavy_minus_sign: | N/A | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `Destination` | [*V2Subject](../../models/shared/v2subject.md) | :heavy_minus_sign: | N/A | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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/v2error.md b/docs/models/shared/v2error.md new file mode 100755 index 00000000..91238f75 --- /dev/null +++ b/docs/models/shared/v2error.md @@ -0,0 +1,9 @@ +# V2Error + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ErrorCode` | [V2ErrorErrorCode](../../models/shared/v2errorerrorcode.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/v2errorerrorcode.md b/docs/models/shared/v2errorerrorcode.md new file mode 100755 index 00000000..95664187 --- /dev/null +++ b/docs/models/shared/v2errorerrorcode.md @@ -0,0 +1,9 @@ +# V2ErrorErrorCode + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `V2ErrorErrorCodeValidation` | VALIDATION | +| `V2ErrorErrorCodeNotFound` | NOT_FOUND | \ No newline at end of file diff --git a/docs/models/shared/v2errorresponse.md b/docs/models/shared/v2errorresponse.md new file mode 100755 index 00000000..2b6b4c05 --- /dev/null +++ b/docs/models/shared/v2errorresponse.md @@ -0,0 +1,10 @@ +# V2ErrorResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Details` | **string* | :heavy_minus_sign: | N/A | https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9 | +| `ErrorCode` | [V2ErrorsEnum](../../models/shared/v2errorsenum.md) | :heavy_check_mark: | N/A | VALIDATION | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | [VALIDATION] invalid 'cursor' query param | \ No newline at end of file diff --git a/docs/models/shared/v2errorsenum.md b/docs/models/shared/v2errorsenum.md new file mode 100755 index 00000000..f670d8d7 --- /dev/null +++ b/docs/models/shared/v2errorsenum.md @@ -0,0 +1,17 @@ +# V2ErrorsEnum + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `V2ErrorsEnumInternal` | INTERNAL | +| `V2ErrorsEnumInsufficientFund` | INSUFFICIENT_FUND | +| `V2ErrorsEnumValidation` | VALIDATION | +| `V2ErrorsEnumConflict` | CONFLICT | +| `V2ErrorsEnumCompilationFailed` | COMPILATION_FAILED | +| `V2ErrorsEnumMetadataOverride` | METADATA_OVERRIDE | +| `V2ErrorsEnumNotFound` | NOT_FOUND | +| `V2ErrorsEnumRevertOccurring` | REVERT_OCCURRING | +| `V2ErrorsEnumAlreadyRevert` | ALREADY_REVERT | +| `V2ErrorsEnumNoPostings` | NO_POSTINGS | \ No newline at end of file diff --git a/docs/models/shared/v2expandedtransaction.md b/docs/models/shared/v2expandedtransaction.md new file mode 100755 index 00000000..64465789 --- /dev/null +++ b/docs/models/shared/v2expandedtransaction.md @@ -0,0 +1,15 @@ +# V2ExpandedTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `PostCommitVolumes` | map[string]map[string][V2Volume](../../models/shared/v2volume.md) | :heavy_minus_sign: | N/A | [object Object] | +| `Postings` | [][V2Posting](../../models/shared/v2posting.md) | :heavy_check_mark: | N/A | | +| `PreCommitVolumes` | map[string]map[string][V2Volume](../../models/shared/v2volume.md) | :heavy_minus_sign: | N/A | [object Object] | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Reverted` | *bool* | :heavy_check_mark: | N/A | | +| `Timestamp` | [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/v2gettransactionresponse.md b/docs/models/shared/v2gettransactionresponse.md new file mode 100755 index 00000000..51324c0d --- /dev/null +++ b/docs/models/shared/v2gettransactionresponse.md @@ -0,0 +1,8 @@ +# V2GetTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `Data` | [V2ExpandedTransaction](../../models/shared/v2expandedtransaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2getworkflowinstancehistoryresponse.md b/docs/models/shared/v2getworkflowinstancehistoryresponse.md new file mode 100755 index 00000000..62ff0c05 --- /dev/null +++ b/docs/models/shared/v2getworkflowinstancehistoryresponse.md @@ -0,0 +1,8 @@ +# V2GetWorkflowInstanceHistoryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Data` | [][V2WorkflowInstanceHistory](../../models/shared/v2workflowinstancehistory.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2getworkflowinstancehistorystageresponse.md b/docs/models/shared/v2getworkflowinstancehistorystageresponse.md new file mode 100755 index 00000000..1ae72c6e --- /dev/null +++ b/docs/models/shared/v2getworkflowinstancehistorystageresponse.md @@ -0,0 +1,8 @@ +# V2GetWorkflowInstanceHistoryStageResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Data` | [][V2WorkflowInstanceHistoryStage](../../models/shared/v2workflowinstancehistorystage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2getworkflowinstanceresponse.md b/docs/models/shared/v2getworkflowinstanceresponse.md new file mode 100755 index 00000000..5c492fa7 --- /dev/null +++ b/docs/models/shared/v2getworkflowinstanceresponse.md @@ -0,0 +1,8 @@ +# V2GetWorkflowInstanceResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [V2WorkflowInstance](../../models/shared/v2workflowinstance.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2getworkflowresponse.md b/docs/models/shared/v2getworkflowresponse.md new file mode 100755 index 00000000..7067a04c --- /dev/null +++ b/docs/models/shared/v2getworkflowresponse.md @@ -0,0 +1,8 @@ +# V2GetWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Data` | [V2Workflow](../../models/shared/v2workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2hold.md b/docs/models/shared/v2hold.md new file mode 100755 index 00000000..cc144fcd --- /dev/null +++ b/docs/models/shared/v2hold.md @@ -0,0 +1,12 @@ +# V2Hold + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Description` | *string* | :heavy_check_mark: | N/A | +| `Destination` | [*V2Subject](../../models/shared/v2subject.md) | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | The unique ID of the hold. | +| `Metadata` | map[string]*string* | :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/v2ledger.md b/docs/models/shared/v2ledger.md new file mode 100755 index 00000000..a092e594 --- /dev/null +++ b/docs/models/shared/v2ledger.md @@ -0,0 +1,10 @@ +# V2Ledger + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `AddedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Bucket` | *string* | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2ledgeraccountsubject.md b/docs/models/shared/v2ledgeraccountsubject.md new file mode 100755 index 00000000..7c865a99 --- /dev/null +++ b/docs/models/shared/v2ledgeraccountsubject.md @@ -0,0 +1,9 @@ +# V2LedgerAccountSubject + + +## 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/v2ledgerinfo.md b/docs/models/shared/v2ledgerinfo.md new file mode 100755 index 00000000..c4945540 --- /dev/null +++ b/docs/models/shared/v2ledgerinfo.md @@ -0,0 +1,9 @@ +# V2LedgerInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Name` | **string* | :heavy_minus_sign: | N/A | ledger001 | +| `Storage` | [*V2LedgerInfoStorage](../../models/shared/v2ledgerinfostorage.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/v2ledgerinforesponse.md b/docs/models/shared/v2ledgerinforesponse.md new file mode 100755 index 00000000..e538c566 --- /dev/null +++ b/docs/models/shared/v2ledgerinforesponse.md @@ -0,0 +1,8 @@ +# V2LedgerInfoResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Data` | [*V2LedgerInfo](../../models/shared/v2ledgerinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2ledgerinfostorage.md b/docs/models/shared/v2ledgerinfostorage.md new file mode 100755 index 00000000..65fc3821 --- /dev/null +++ b/docs/models/shared/v2ledgerinfostorage.md @@ -0,0 +1,8 @@ +# V2LedgerInfoStorage + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Migrations` | [][V2MigrationInfo](../../models/shared/v2migrationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2ledgerlistresponse.md b/docs/models/shared/v2ledgerlistresponse.md new file mode 100755 index 00000000..799ff9f6 --- /dev/null +++ b/docs/models/shared/v2ledgerlistresponse.md @@ -0,0 +1,8 @@ +# V2LedgerListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Cursor` | [V2LedgerListResponseCursor](../../models/shared/v2ledgerlistresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2ledgerlistresponsecursor.md b/docs/models/shared/v2ledgerlistresponsecursor.md new file mode 100755 index 00000000..ab4868c4 --- /dev/null +++ b/docs/models/shared/v2ledgerlistresponsecursor.md @@ -0,0 +1,12 @@ +# V2LedgerListResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [][V2Ledger](../../models/shared/v2ledger.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/v2listrunsresponse.md b/docs/models/shared/v2listrunsresponse.md new file mode 100755 index 00000000..32feb942 --- /dev/null +++ b/docs/models/shared/v2listrunsresponse.md @@ -0,0 +1,8 @@ +# V2ListRunsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Cursor` | [V2ListRunsResponseCursor](../../models/shared/v2listrunsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2listrunsresponsecursor.md b/docs/models/shared/v2listrunsresponsecursor.md new file mode 100755 index 00000000..14583583 --- /dev/null +++ b/docs/models/shared/v2listrunsresponsecursor.md @@ -0,0 +1,12 @@ +# V2ListRunsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `Data` | [][V2WorkflowInstance](../../models/shared/v2workflowinstance.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/v2listtriggersoccurrencesresponse.md b/docs/models/shared/v2listtriggersoccurrencesresponse.md new file mode 100755 index 00000000..14f87ab6 --- /dev/null +++ b/docs/models/shared/v2listtriggersoccurrencesresponse.md @@ -0,0 +1,8 @@ +# V2ListTriggersOccurrencesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `Cursor` | [V2ListTriggersOccurrencesResponseCursor](../../models/shared/v2listtriggersoccurrencesresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2listtriggersoccurrencesresponsecursor.md b/docs/models/shared/v2listtriggersoccurrencesresponsecursor.md new file mode 100755 index 00000000..7c675b07 --- /dev/null +++ b/docs/models/shared/v2listtriggersoccurrencesresponsecursor.md @@ -0,0 +1,12 @@ +# V2ListTriggersOccurrencesResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Data` | [][V2TriggerOccurrence](../../models/shared/v2triggeroccurrence.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/v2listtriggersresponse.md b/docs/models/shared/v2listtriggersresponse.md new file mode 100755 index 00000000..ec7f6ba7 --- /dev/null +++ b/docs/models/shared/v2listtriggersresponse.md @@ -0,0 +1,8 @@ +# V2ListTriggersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Cursor` | [V2ListTriggersResponseCursor](../../models/shared/v2listtriggersresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2listtriggersresponsecursor.md b/docs/models/shared/v2listtriggersresponsecursor.md new file mode 100755 index 00000000..22e2b54d --- /dev/null +++ b/docs/models/shared/v2listtriggersresponsecursor.md @@ -0,0 +1,12 @@ +# V2ListTriggersResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `Data` | [][V2Trigger](../../models/shared/v2trigger.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/v2listworkflowsresponse.md b/docs/models/shared/v2listworkflowsresponse.md new file mode 100755 index 00000000..0643a7d6 --- /dev/null +++ b/docs/models/shared/v2listworkflowsresponse.md @@ -0,0 +1,8 @@ +# V2ListWorkflowsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Cursor` | [V2ListWorkflowsResponseCursor](../../models/shared/v2listworkflowsresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2listworkflowsresponsecursor.md b/docs/models/shared/v2listworkflowsresponsecursor.md new file mode 100755 index 00000000..0e3aacbd --- /dev/null +++ b/docs/models/shared/v2listworkflowsresponsecursor.md @@ -0,0 +1,12 @@ +# V2ListWorkflowsResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `Data` | [][V2Workflow](../../models/shared/v2workflow.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/v2log.md b/docs/models/shared/v2log.md new file mode 100755 index 00000000..83a39352 --- /dev/null +++ b/docs/models/shared/v2log.md @@ -0,0 +1,12 @@ +# V2Log + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Data` | map[string]*interface{}* | :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` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | 1234 | +| `Type` | [V2LogType](../../models/shared/v2logtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/v2logscursorresponse.md b/docs/models/shared/v2logscursorresponse.md new file mode 100755 index 00000000..e5159c54 --- /dev/null +++ b/docs/models/shared/v2logscursorresponse.md @@ -0,0 +1,8 @@ +# V2LogsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Cursor` | [V2LogsCursorResponseCursor](../../models/shared/v2logscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2logscursorresponsecursor.md b/docs/models/shared/v2logscursorresponsecursor.md new file mode 100755 index 00000000..49b8272a --- /dev/null +++ b/docs/models/shared/v2logscursorresponsecursor.md @@ -0,0 +1,12 @@ +# V2LogsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Data` | [][V2Log](../../models/shared/v2log.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/v2logtype.md b/docs/models/shared/v2logtype.md new file mode 100755 index 00000000..28b0b930 --- /dev/null +++ b/docs/models/shared/v2logtype.md @@ -0,0 +1,10 @@ +# V2LogType + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `V2LogTypeNewTransaction` | NEW_TRANSACTION | +| `V2LogTypeSetMetadata` | SET_METADATA | +| `V2LogTypeRevertedTransaction` | REVERTED_TRANSACTION | \ No newline at end of file diff --git a/docs/models/shared/v2migrationinfo.md b/docs/models/shared/v2migrationinfo.md new file mode 100755 index 00000000..32ec88db --- /dev/null +++ b/docs/models/shared/v2migrationinfo.md @@ -0,0 +1,11 @@ +# V2MigrationInfo + + +## 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` | [*V2MigrationInfoState](../../models/shared/v2migrationinfostate.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/v2migrationinfostate.md b/docs/models/shared/v2migrationinfostate.md new file mode 100755 index 00000000..0594466e --- /dev/null +++ b/docs/models/shared/v2migrationinfostate.md @@ -0,0 +1,9 @@ +# V2MigrationInfoState + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `V2MigrationInfoStateToDo` | to do | +| `V2MigrationInfoStateDone` | done | \ No newline at end of file diff --git a/docs/models/shared/v2monetary.md b/docs/models/shared/v2monetary.md new file mode 100755 index 00000000..e59d84d5 --- /dev/null +++ b/docs/models/shared/v2monetary.md @@ -0,0 +1,9 @@ +# V2Monetary + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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/v2payment.md b/docs/models/shared/v2payment.md new file mode 100755 index 00000000..74717183 --- /dev/null +++ b/docs/models/shared/v2payment.md @@ -0,0 +1,22 @@ +# V2Payment + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Adjustments` | [][V2PaymentAdjustment](../../models/shared/v2paymentadjustment.md) | :heavy_check_mark: | N/A | | +| `Asset` | *string* | :heavy_check_mark: | N/A | USD | +| `ConnectorID` | *string* | :heavy_check_mark: | N/A | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `DestinationAccountID` | *string* | :heavy_check_mark: | N/A | | +| `ID` | *string* | :heavy_check_mark: | N/A | XXX | +| `InitialAmount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | 100 | +| `Metadata` | [V2PaymentMetadata](../../models/shared/v2paymentmetadata.md) | :heavy_check_mark: | N/A | | +| `Provider` | [*V2Connector](../../models/shared/v2connector.md) | :heavy_minus_sign: | N/A | | +| `Raw` | [V2PaymentRaw](../../models/shared/v2paymentraw.md) | :heavy_check_mark: | N/A | | +| `Reference` | *string* | :heavy_check_mark: | N/A | | +| `Scheme` | [V2PaymentScheme](../../models/shared/v2paymentscheme.md) | :heavy_check_mark: | N/A | | +| `SourceAccountID` | *string* | :heavy_check_mark: | N/A | | +| `Status` | [V2PaymentStatus](../../models/shared/v2paymentstatus.md) | :heavy_check_mark: | N/A | | +| `Type` | [V2PaymentType](../../models/shared/v2paymenttype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/v2paymentadjustment.md b/docs/models/shared/v2paymentadjustment.md new file mode 100755 index 00000000..76618702 --- /dev/null +++ b/docs/models/shared/v2paymentadjustment.md @@ -0,0 +1,12 @@ +# V2PaymentAdjustment + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Absolute` | *bool* | :heavy_check_mark: | N/A | | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | 100 | +| `Date` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Raw` | [V2PaymentAdjustmentRaw](../../models/shared/v2paymentadjustmentraw.md) | :heavy_check_mark: | N/A | | +| `Status` | [V2PaymentStatus](../../models/shared/v2paymentstatus.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/v2paymentadjustmentraw.md b/docs/models/shared/v2paymentadjustmentraw.md new file mode 100755 index 00000000..0d4efd08 --- /dev/null +++ b/docs/models/shared/v2paymentadjustmentraw.md @@ -0,0 +1,7 @@ +# V2PaymentAdjustmentRaw + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/v2paymentmetadata.md b/docs/models/shared/v2paymentmetadata.md new file mode 100755 index 00000000..af3c416b --- /dev/null +++ b/docs/models/shared/v2paymentmetadata.md @@ -0,0 +1,8 @@ +# V2PaymentMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2paymentraw.md b/docs/models/shared/v2paymentraw.md new file mode 100755 index 00000000..74c2ba7b --- /dev/null +++ b/docs/models/shared/v2paymentraw.md @@ -0,0 +1,7 @@ +# V2PaymentRaw + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/v2paymentscheme.md b/docs/models/shared/v2paymentscheme.md new file mode 100755 index 00000000..9ecb278a --- /dev/null +++ b/docs/models/shared/v2paymentscheme.md @@ -0,0 +1,25 @@ +# V2PaymentScheme + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `V2PaymentSchemeVisa` | visa | +| `V2PaymentSchemeMastercard` | mastercard | +| `V2PaymentSchemeAmex` | amex | +| `V2PaymentSchemeDiners` | diners | +| `V2PaymentSchemeDiscover` | discover | +| `V2PaymentSchemeJcb` | jcb | +| `V2PaymentSchemeUnionpay` | unionpay | +| `V2PaymentSchemeSepaDebit` | sepa debit | +| `V2PaymentSchemeSepaCredit` | sepa credit | +| `V2PaymentSchemeSepa` | sepa | +| `V2PaymentSchemeApplePay` | apple pay | +| `V2PaymentSchemeGooglePay` | google pay | +| `V2PaymentSchemeA2a` | a2a | +| `V2PaymentSchemeAchDebit` | ach debit | +| `V2PaymentSchemeAch` | ach | +| `V2PaymentSchemeRtp` | rtp | +| `V2PaymentSchemeUnknown` | unknown | +| `V2PaymentSchemeOther` | other | \ No newline at end of file diff --git a/docs/models/shared/v2paymentstatus.md b/docs/models/shared/v2paymentstatus.md new file mode 100755 index 00000000..b1de53b8 --- /dev/null +++ b/docs/models/shared/v2paymentstatus.md @@ -0,0 +1,13 @@ +# V2PaymentStatus + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `V2PaymentStatusPending` | PENDING | +| `V2PaymentStatusActive` | ACTIVE | +| `V2PaymentStatusTerminated` | TERMINATED | +| `V2PaymentStatusFailed` | FAILED | +| `V2PaymentStatusSucceeded` | SUCCEEDED | +| `V2PaymentStatusCancelled` | CANCELLED | \ No newline at end of file diff --git a/docs/models/shared/v2paymenttype.md b/docs/models/shared/v2paymenttype.md new file mode 100755 index 00000000..714ae526 --- /dev/null +++ b/docs/models/shared/v2paymenttype.md @@ -0,0 +1,11 @@ +# V2PaymentType + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `V2PaymentTypePayIn` | PAY-IN | +| `V2PaymentTypePayout` | PAYOUT | +| `V2PaymentTypeTransfer` | TRANSFER | +| `V2PaymentTypeOther` | OTHER | \ No newline at end of file diff --git a/docs/models/shared/v2posting.md b/docs/models/shared/v2posting.md new file mode 100755 index 00000000..9fa0277b --- /dev/null +++ b/docs/models/shared/v2posting.md @@ -0,0 +1,11 @@ +# V2Posting + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Amount` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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/v2posttransaction.md b/docs/models/shared/v2posttransaction.md new file mode 100755 index 00000000..34e4f661 --- /dev/null +++ b/docs/models/shared/v2posttransaction.md @@ -0,0 +1,12 @@ +# V2PostTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `Postings` | [][V2Posting](../../models/shared/v2posting.md) | :heavy_minus_sign: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Script` | [*V2PostTransactionScript](../../models/shared/v2posttransactionscript.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/v2posttransactionscript.md b/docs/models/shared/v2posttransactionscript.md new file mode 100755 index 00000000..1c055a5f --- /dev/null +++ b/docs/models/shared/v2posttransactionscript.md @@ -0,0 +1,9 @@ +# V2PostTransactionScript + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Plain` | *string* | :heavy_check_mark: | N/A | vars {
account $user
}
send [COIN 10] (
source = @world
destination = $user
)
| +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | [object Object] | \ No newline at end of file diff --git a/docs/models/shared/v2readtriggerresponse.md b/docs/models/shared/v2readtriggerresponse.md new file mode 100755 index 00000000..66e05ed1 --- /dev/null +++ b/docs/models/shared/v2readtriggerresponse.md @@ -0,0 +1,8 @@ +# V2ReadTriggerResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Data` | [V2Trigger](../../models/shared/v2trigger.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2reverttransactionresponse.md b/docs/models/shared/v2reverttransactionresponse.md new file mode 100755 index 00000000..1eb90ddc --- /dev/null +++ b/docs/models/shared/v2reverttransactionresponse.md @@ -0,0 +1,8 @@ +# V2RevertTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `Data` | [OrchestrationV2Transaction](../../models/shared/orchestrationv2transaction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2runworkflowresponse.md b/docs/models/shared/v2runworkflowresponse.md new file mode 100755 index 00000000..12beeff9 --- /dev/null +++ b/docs/models/shared/v2runworkflowresponse.md @@ -0,0 +1,8 @@ +# V2RunWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Data` | [V2WorkflowInstance](../../models/shared/v2workflowinstance.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2serverinfo.md b/docs/models/shared/v2serverinfo.md new file mode 100755 index 00000000..3c40c1a7 --- /dev/null +++ b/docs/models/shared/v2serverinfo.md @@ -0,0 +1,8 @@ +# V2ServerInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stage.md b/docs/models/shared/v2stage.md new file mode 100755 index 00000000..60639fdf --- /dev/null +++ b/docs/models/shared/v2stage.md @@ -0,0 +1,23 @@ +# V2Stage + + +## Supported Types + +### V2StageSend + +```go +v2Stage := shared.CreateV2StageV2StageSend(shared.V2StageSend{/* values here */}) +``` + +### V2StageDelay + +```go +v2Stage := shared.CreateV2StageV2StageDelay(shared.V2StageDelay{/* values here */}) +``` + +### V2StageWaitEvent + +```go +v2Stage := shared.CreateV2StageV2StageWaitEvent(shared.V2StageWaitEvent{/* values here */}) +``` + diff --git a/docs/models/shared/v2stagedelay.md b/docs/models/shared/v2stagedelay.md new file mode 100755 index 00000000..d191f2e9 --- /dev/null +++ b/docs/models/shared/v2stagedelay.md @@ -0,0 +1,9 @@ +# V2StageDelay + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Duration` | **string* | :heavy_minus_sign: | N/A | +| `Until` | [*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/v2stagesend.md b/docs/models/shared/v2stagesend.md new file mode 100755 index 00000000..c880b7b9 --- /dev/null +++ b/docs/models/shared/v2stagesend.md @@ -0,0 +1,10 @@ +# V2StageSend + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Amount` | [*V2Monetary](../../models/shared/v2monetary.md) | :heavy_minus_sign: | N/A | +| `Destination` | [*V2StageSendDestination](../../models/shared/v2stagesenddestination.md) | :heavy_minus_sign: | N/A | +| `Source` | [*V2StageSendSource](../../models/shared/v2stagesendsource.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesenddestination.md b/docs/models/shared/v2stagesenddestination.md new file mode 100755 index 00000000..6f8e9232 --- /dev/null +++ b/docs/models/shared/v2stagesenddestination.md @@ -0,0 +1,10 @@ +# V2StageSendDestination + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Account` | [*V2StageSendDestinationAccount](../../models/shared/v2stagesenddestinationaccount.md) | :heavy_minus_sign: | N/A | +| `Payment` | [*V2StageSendDestinationPayment](../../models/shared/v2stagesenddestinationpayment.md) | :heavy_minus_sign: | N/A | +| `Wallet` | [*V2StageSendDestinationWallet](../../models/shared/v2stagesenddestinationwallet.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesenddestinationaccount.md b/docs/models/shared/v2stagesenddestinationaccount.md new file mode 100755 index 00000000..09f432fd --- /dev/null +++ b/docs/models/shared/v2stagesenddestinationaccount.md @@ -0,0 +1,9 @@ +# V2StageSendDestinationAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesenddestinationpayment.md b/docs/models/shared/v2stagesenddestinationpayment.md new file mode 100755 index 00000000..e37e485a --- /dev/null +++ b/docs/models/shared/v2stagesenddestinationpayment.md @@ -0,0 +1,8 @@ +# V2StageSendDestinationPayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Psp` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesenddestinationwallet.md b/docs/models/shared/v2stagesenddestinationwallet.md new file mode 100755 index 00000000..72f34ca3 --- /dev/null +++ b/docs/models/shared/v2stagesenddestinationwallet.md @@ -0,0 +1,9 @@ +# V2StageSendDestinationWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesendsource.md b/docs/models/shared/v2stagesendsource.md new file mode 100755 index 00000000..78466ac0 --- /dev/null +++ b/docs/models/shared/v2stagesendsource.md @@ -0,0 +1,10 @@ +# V2StageSendSource + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Account` | [*V2StageSendSourceAccount](../../models/shared/v2stagesendsourceaccount.md) | :heavy_minus_sign: | N/A | +| `Payment` | [*V2StageSendSourcePayment](../../models/shared/v2stagesendsourcepayment.md) | :heavy_minus_sign: | N/A | +| `Wallet` | [*V2StageSendSourceWallet](../../models/shared/v2stagesendsourcewallet.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesendsourceaccount.md b/docs/models/shared/v2stagesendsourceaccount.md new file mode 100755 index 00000000..e590db4a --- /dev/null +++ b/docs/models/shared/v2stagesendsourceaccount.md @@ -0,0 +1,9 @@ +# V2StageSendSourceAccount + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesendsourcepayment.md b/docs/models/shared/v2stagesendsourcepayment.md new file mode 100755 index 00000000..25484111 --- /dev/null +++ b/docs/models/shared/v2stagesendsourcepayment.md @@ -0,0 +1,8 @@ +# V2StageSendSourcePayment + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagesendsourcewallet.md b/docs/models/shared/v2stagesendsourcewallet.md new file mode 100755 index 00000000..e2f25794 --- /dev/null +++ b/docs/models/shared/v2stagesendsourcewallet.md @@ -0,0 +1,9 @@ +# V2StageSendSourceWallet + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Balance` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stagestatus.md b/docs/models/shared/v2stagestatus.md new file mode 100755 index 00000000..1063b1ab --- /dev/null +++ b/docs/models/shared/v2stagestatus.md @@ -0,0 +1,12 @@ +# V2StageStatus + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `InstanceID` | *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/v2stagewaitevent.md b/docs/models/shared/v2stagewaitevent.md new file mode 100755 index 00000000..a8135cb3 --- /dev/null +++ b/docs/models/shared/v2stagewaitevent.md @@ -0,0 +1,8 @@ +# V2StageWaitEvent + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Event` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2stats.md b/docs/models/shared/v2stats.md new file mode 100755 index 00000000..15e788cd --- /dev/null +++ b/docs/models/shared/v2stats.md @@ -0,0 +1,9 @@ +# V2Stats + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Accounts` | *int64* | :heavy_check_mark: | N/A | +| `Transactions` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2statsresponse.md b/docs/models/shared/v2statsresponse.md new file mode 100755 index 00000000..f536fa8b --- /dev/null +++ b/docs/models/shared/v2statsresponse.md @@ -0,0 +1,8 @@ +# V2StatsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Data` | [V2Stats](../../models/shared/v2stats.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2subject.md b/docs/models/shared/v2subject.md new file mode 100755 index 00000000..834c491b --- /dev/null +++ b/docs/models/shared/v2subject.md @@ -0,0 +1,17 @@ +# V2Subject + + +## Supported Types + +### V2LedgerAccountSubject + +```go +v2Subject := shared.CreateV2SubjectAccount(shared.V2LedgerAccountSubject{/* values here */}) +``` + +### V2WalletSubject + +```go +v2Subject := shared.CreateV2SubjectWallet(shared.V2WalletSubject{/* values here */}) +``` + diff --git a/docs/models/shared/v2targetid.md b/docs/models/shared/v2targetid.md new file mode 100755 index 00000000..3c17fa2f --- /dev/null +++ b/docs/models/shared/v2targetid.md @@ -0,0 +1,17 @@ +# V2TargetID + + +## Supported Types + +### + +```go +v2TargetID := shared.CreateV2TargetIDStr(string{/* values here */}) +``` + +### + +```go +v2TargetID := shared.CreateV2TargetIDBigint(*big.Int{/* values here */}) +``` + diff --git a/docs/models/shared/v2targettype.md b/docs/models/shared/v2targettype.md new file mode 100755 index 00000000..e50c5715 --- /dev/null +++ b/docs/models/shared/v2targettype.md @@ -0,0 +1,9 @@ +# V2TargetType + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `V2TargetTypeTransaction` | TRANSACTION | +| `V2TargetTypeAccount` | ACCOUNT | \ No newline at end of file diff --git a/docs/models/shared/v2transaction.md b/docs/models/shared/v2transaction.md new file mode 100755 index 00000000..e6881ed5 --- /dev/null +++ b/docs/models/shared/v2transaction.md @@ -0,0 +1,13 @@ +# V2Transaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `ID` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | | +| `Metadata` | map[string]*string* | :heavy_check_mark: | N/A | [object Object] | +| `Postings` | [][V2Posting](../../models/shared/v2posting.md) | :heavy_check_mark: | N/A | | +| `Reference` | **string* | :heavy_minus_sign: | N/A | ref:001 | +| `Reverted` | *bool* | :heavy_check_mark: | N/A | | +| `Timestamp` | [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/v2transactionscursorresponse.md b/docs/models/shared/v2transactionscursorresponse.md new file mode 100755 index 00000000..7c72c458 --- /dev/null +++ b/docs/models/shared/v2transactionscursorresponse.md @@ -0,0 +1,8 @@ +# V2TransactionsCursorResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `Cursor` | [V2TransactionsCursorResponseCursor](../../models/shared/v2transactionscursorresponsecursor.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2transactionscursorresponsecursor.md b/docs/models/shared/v2transactionscursorresponsecursor.md new file mode 100755 index 00000000..9227f2c0 --- /dev/null +++ b/docs/models/shared/v2transactionscursorresponsecursor.md @@ -0,0 +1,12 @@ +# V2TransactionsCursorResponseCursor + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Data` | [][V2ExpandedTransaction](../../models/shared/v2expandedtransaction.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/v2trigger.md b/docs/models/shared/v2trigger.md new file mode 100755 index 00000000..af9ac82e --- /dev/null +++ b/docs/models/shared/v2trigger.md @@ -0,0 +1,13 @@ +# V2Trigger + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Event` | *string* | :heavy_check_mark: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `WorkflowID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2triggerdata.md b/docs/models/shared/v2triggerdata.md new file mode 100755 index 00000000..8ffac4d1 --- /dev/null +++ b/docs/models/shared/v2triggerdata.md @@ -0,0 +1,11 @@ +# V2TriggerData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Event` | *string* | :heavy_check_mark: | N/A | +| `Filter` | **string* | :heavy_minus_sign: | N/A | +| `Vars` | map[string]*interface{}* | :heavy_minus_sign: | N/A | +| `WorkflowID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2triggeroccurrence.md b/docs/models/shared/v2triggeroccurrence.md new file mode 100755 index 00000000..a9adc492 --- /dev/null +++ b/docs/models/shared/v2triggeroccurrence.md @@ -0,0 +1,11 @@ +# V2TriggerOccurrence + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Date` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Event` | map[string]*interface{}* | :heavy_check_mark: | N/A | +| `TriggerID` | *string* | :heavy_check_mark: | N/A | +| `WorkflowInstanceID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2volume.md b/docs/models/shared/v2volume.md new file mode 100755 index 00000000..46803ce9 --- /dev/null +++ b/docs/models/shared/v2volume.md @@ -0,0 +1,10 @@ +# V2Volume + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Balance` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | +| `Input` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `Output` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2walletsubject.md b/docs/models/shared/v2walletsubject.md new file mode 100755 index 00000000..0073d817 --- /dev/null +++ b/docs/models/shared/v2walletsubject.md @@ -0,0 +1,10 @@ +# V2WalletSubject + + +## 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/v2walletwithbalances.md b/docs/models/shared/v2walletwithbalances.md new file mode 100755 index 00000000..047bb7b0 --- /dev/null +++ b/docs/models/shared/v2walletwithbalances.md @@ -0,0 +1,13 @@ +# V2WalletWithBalances + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Balances` | [V2WalletWithBalancesBalances](../../models/shared/v2walletwithbalancesbalances.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]*string* | :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/v2walletwithbalancesbalances.md b/docs/models/shared/v2walletwithbalancesbalances.md new file mode 100755 index 00000000..104f927c --- /dev/null +++ b/docs/models/shared/v2walletwithbalancesbalances.md @@ -0,0 +1,8 @@ +# V2WalletWithBalancesBalances + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Main` | [V2AssetHolder](../../models/shared/v2assetholder.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2workflow.md b/docs/models/shared/v2workflow.md new file mode 100755 index 00000000..20241913 --- /dev/null +++ b/docs/models/shared/v2workflow.md @@ -0,0 +1,11 @@ +# V2Workflow + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Config` | [V2WorkflowConfig](../../models/shared/v2workflowconfig.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/v2workflowconfig.md b/docs/models/shared/v2workflowconfig.md new file mode 100755 index 00000000..38ed9e6b --- /dev/null +++ b/docs/models/shared/v2workflowconfig.md @@ -0,0 +1,9 @@ +# V2WorkflowConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `Stages` | []map[string]*interface{}* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2workflowinstance.md b/docs/models/shared/v2workflowinstance.md new file mode 100755 index 00000000..b582cde7 --- /dev/null +++ b/docs/models/shared/v2workflowinstance.md @@ -0,0 +1,15 @@ +# V2WorkflowInstance + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Status` | [][V2StageStatus](../../models/shared/v2stagestatus.md) | :heavy_minus_sign: | N/A | +| `Terminated` | *bool* | :heavy_check_mark: | N/A | +| `TerminatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | 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/models/shared/v2workflowinstancehistory.md b/docs/models/shared/v2workflowinstancehistory.md new file mode 100755 index 00000000..02bd60cc --- /dev/null +++ b/docs/models/shared/v2workflowinstancehistory.md @@ -0,0 +1,13 @@ +# V2WorkflowInstanceHistory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `Input` | [V2Stage](../../models/shared/v2stage.md) | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `StartedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Terminated` | *bool* | :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/v2workflowinstancehistorystage.md b/docs/models/shared/v2workflowinstancehistorystage.md new file mode 100755 index 00000000..77901e6b --- /dev/null +++ b/docs/models/shared/v2workflowinstancehistorystage.md @@ -0,0 +1,17 @@ +# V2WorkflowInstanceHistoryStage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Attempt` | *int64* | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `Input` | [V2WorkflowInstanceHistoryStageInput](../../models/shared/v2workflowinstancehistorystageinput.md) | :heavy_check_mark: | N/A | +| `LastFailure` | **string* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `NextExecution` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | +| `Output` | [*V2WorkflowInstanceHistoryStageOutput](../../models/shared/v2workflowinstancehistorystageoutput.md) | :heavy_minus_sign: | N/A | +| `StartedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Terminated` | *bool* | :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/v2workflowinstancehistorystageinput.md b/docs/models/shared/v2workflowinstancehistorystageinput.md new file mode 100755 index 00000000..db44fc40 --- /dev/null +++ b/docs/models/shared/v2workflowinstancehistorystageinput.md @@ -0,0 +1,16 @@ +# V2WorkflowInstanceHistoryStageInput + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ConfirmHold` | [*V2ActivityConfirmHold](../../models/shared/v2activityconfirmhold.md) | :heavy_minus_sign: | N/A | +| `CreateTransaction` | [*V2ActivityCreateTransaction](../../models/shared/v2activitycreatetransaction.md) | :heavy_minus_sign: | N/A | +| `CreditWallet` | [*V2ActivityCreditWallet](../../models/shared/v2activitycreditwallet.md) | :heavy_minus_sign: | N/A | +| `DebitWallet` | [*V2ActivityDebitWallet](../../models/shared/v2activitydebitwallet.md) | :heavy_minus_sign: | N/A | +| `GetAccount` | [*V2ActivityGetAccount](../../models/shared/v2activitygetaccount.md) | :heavy_minus_sign: | N/A | +| `GetPayment` | [*V2ActivityGetPayment](../../models/shared/v2activitygetpayment.md) | :heavy_minus_sign: | N/A | +| `GetWallet` | [*V2ActivityGetWallet](../../models/shared/v2activitygetwallet.md) | :heavy_minus_sign: | N/A | +| `StripeTransfer` | [*V2ActivityStripeTransfer](../../models/shared/v2activitystripetransfer.md) | :heavy_minus_sign: | N/A | +| `VoidHold` | [*V2ActivityVoidHold](../../models/shared/v2activityvoidhold.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/v2workflowinstancehistorystageoutput.md b/docs/models/shared/v2workflowinstancehistorystageoutput.md new file mode 100755 index 00000000..a8a02a30 --- /dev/null +++ b/docs/models/shared/v2workflowinstancehistorystageoutput.md @@ -0,0 +1,12 @@ +# V2WorkflowInstanceHistoryStageOutput + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `CreateTransaction` | [*V2ActivityCreateTransactionOutput](../../models/shared/v2activitycreatetransactionoutput.md) | :heavy_minus_sign: | N/A | +| `DebitWallet` | [*V2ActivityDebitWalletOutput](../../models/shared/v2activitydebitwalletoutput.md) | :heavy_minus_sign: | N/A | +| `GetAccount` | [*V2ActivityGetAccountOutput](../../models/shared/v2activitygetaccountoutput.md) | :heavy_minus_sign: | N/A | +| `GetPayment` | [*V2ActivityGetPaymentOutput](../../models/shared/v2activitygetpaymentoutput.md) | :heavy_minus_sign: | N/A | +| `GetWallet` | [*V2ActivityGetWalletOutput](../../models/shared/v2activitygetwalletoutput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/version.md b/docs/models/shared/version.md new file mode 100755 index 00000000..5d1245df --- /dev/null +++ b/docs/models/shared/version.md @@ -0,0 +1,10 @@ +# Version + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Health` | *bool* | :heavy_check_mark: | N/A | +| `Name` | *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/volume.md b/docs/models/shared/volume.md new file mode 100755 index 00000000..a7e26131 --- /dev/null +++ b/docs/models/shared/volume.md @@ -0,0 +1,10 @@ +# Volume + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Balance` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_minus_sign: | N/A | +| `Input` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `Output` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..e3b0018d --- /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]*string* | :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 00000000..3e8c8158 --- /dev/null +++ b/docs/models/shared/walletserrorresponse.md @@ -0,0 +1,9 @@ +# WalletsErrorResponse + + +## Fields + +| 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 00000000..aa7118c4 --- /dev/null +++ b/docs/models/shared/walletserrorresponseerrorcode.md @@ -0,0 +1,11 @@ +# WalletsErrorResponseErrorCode + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `WalletsErrorResponseErrorCodeValidation` | VALIDATION | +| `WalletsErrorResponseErrorCodeInternalError` | INTERNAL_ERROR | +| `WalletsErrorResponseErrorCodeInsufficientFund` | INSUFFICIENT_FUND | +| `WalletsErrorResponseErrorCodeHoldClosed` | HOLD_CLOSED | \ 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 00000000..530a2850 --- /dev/null +++ b/docs/models/shared/walletstransaction.md @@ -0,0 +1,15 @@ +# WalletsTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `ID` | *int64* | :heavy_check_mark: | N/A | | +| `Ledger` | **string* | :heavy_minus_sign: | N/A | | +| `Metadata` | map[string]*string* | :heavy_check_mark: | 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 | | \ 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 00000000..0cb03c8e --- /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 00000000..42a69fb7 --- /dev/null +++ b/docs/models/shared/walletsvolume.md @@ -0,0 +1,10 @@ +# WalletsVolume + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Balance` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `Input` | [*big.Int](https://pkg.go.dev/math/big#Int) | :heavy_check_mark: | N/A | +| `Output` | [*big.Int](https://pkg.go.dev/math/big#Int) | :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 00000000..bf7c3b96 --- /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]*string* | :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 00000000..b3ceb392 --- /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 00000000..83588255 --- /dev/null +++ b/docs/models/shared/webhooksconfig.md @@ -0,0 +1,14 @@ +# WebhooksConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `Active` | *bool* | :heavy_check_mark: | N/A | true | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | | +| `Endpoint` | *string* | :heavy_check_mark: | N/A | https://example.com | +| `EventTypes` | []*string* | :heavy_check_mark: | N/A | TYPE1,TYPE2 | +| `ID` | *string* | :heavy_check_mark: | N/A | | +| `Secret` | *string* | :heavy_check_mark: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 | +| `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/webhookserrorresponse.md b/docs/models/shared/webhookserrorresponse.md new file mode 100755 index 00000000..3589c480 --- /dev/null +++ b/docs/models/shared/webhookserrorresponse.md @@ -0,0 +1,10 @@ +# WebhooksErrorResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Details` | **string* | :heavy_minus_sign: | N/A | https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9 | +| `ErrorCode` | [WebhooksErrorsEnum](../../models/shared/webhookserrorsenum.md) | :heavy_check_mark: | N/A | VALIDATION | +| `ErrorMessage` | *string* | :heavy_check_mark: | N/A | [VALIDATION] invalid 'cursor' query param | \ No newline at end of file diff --git a/docs/models/shared/webhookserrorsenum.md b/docs/models/shared/webhookserrorsenum.md new file mode 100755 index 00000000..1ea7b27d --- /dev/null +++ b/docs/models/shared/webhookserrorsenum.md @@ -0,0 +1,10 @@ +# WebhooksErrorsEnum + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `WebhooksErrorsEnumInternal` | INTERNAL | +| `WebhooksErrorsEnumValidation` | VALIDATION | +| `WebhooksErrorsEnumNotFound` | NOT_FOUND | \ 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 00000000..f3b25d05 --- /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 00000000..3bb58352 --- /dev/null +++ b/docs/models/shared/workflowconfig.md @@ -0,0 +1,9 @@ +# WorkflowConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | +| `Stages` | []map[string]*interface{}* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workflowinstance.md b/docs/models/shared/workflowinstance.md new file mode 100755 index 00000000..8b47617e --- /dev/null +++ b/docs/models/shared/workflowinstance.md @@ -0,0 +1,15 @@ +# WorkflowInstance + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `ID` | *string* | :heavy_check_mark: | N/A | +| `Status` | [][StageStatus](../../models/shared/stagestatus.md) | :heavy_minus_sign: | N/A | +| `Terminated` | *bool* | :heavy_check_mark: | N/A | +| `TerminatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | 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/models/shared/workflowinstancehistory.md b/docs/models/shared/workflowinstancehistory.md new file mode 100755 index 00000000..6b93e896 --- /dev/null +++ b/docs/models/shared/workflowinstancehistory.md @@ -0,0 +1,13 @@ +# WorkflowInstanceHistory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `Input` | [Stage](../../models/shared/stage.md) | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `StartedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Terminated` | *bool* | :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/workflowinstancehistorystage.md b/docs/models/shared/workflowinstancehistorystage.md new file mode 100755 index 00000000..83f8911c --- /dev/null +++ b/docs/models/shared/workflowinstancehistorystage.md @@ -0,0 +1,17 @@ +# WorkflowInstanceHistoryStage + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Attempt` | *int64* | :heavy_check_mark: | N/A | +| `Error` | **string* | :heavy_minus_sign: | N/A | +| `Input` | [WorkflowInstanceHistoryStageInput](../../models/shared/workflowinstancehistorystageinput.md) | :heavy_check_mark: | N/A | +| `LastFailure` | **string* | :heavy_minus_sign: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | +| `NextExecution` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | +| `Output` | [*WorkflowInstanceHistoryStageOutput](../../models/shared/workflowinstancehistorystageoutput.md) | :heavy_minus_sign: | N/A | +| `StartedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Terminated` | *bool* | :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/workflowinstancehistorystageinput.md b/docs/models/shared/workflowinstancehistorystageinput.md new file mode 100755 index 00000000..f7bc59a3 --- /dev/null +++ b/docs/models/shared/workflowinstancehistorystageinput.md @@ -0,0 +1,16 @@ +# WorkflowInstanceHistoryStageInput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ConfirmHold` | [*ActivityConfirmHold](../../models/shared/activityconfirmhold.md) | :heavy_minus_sign: | N/A | +| `CreateTransaction` | [*ActivityCreateTransaction](../../models/shared/activitycreatetransaction.md) | :heavy_minus_sign: | N/A | +| `CreditWallet` | [*ActivityCreditWallet](../../models/shared/activitycreditwallet.md) | :heavy_minus_sign: | N/A | +| `DebitWallet` | [*ActivityDebitWallet](../../models/shared/activitydebitwallet.md) | :heavy_minus_sign: | N/A | +| `GetAccount` | [*ActivityGetAccount](../../models/shared/activitygetaccount.md) | :heavy_minus_sign: | N/A | +| `GetPayment` | [*ActivityGetPayment](../../models/shared/activitygetpayment.md) | :heavy_minus_sign: | N/A | +| `GetWallet` | [*ActivityGetWallet](../../models/shared/activitygetwallet.md) | :heavy_minus_sign: | N/A | +| `StripeTransfer` | [*ActivityStripeTransfer](../../models/shared/activitystripetransfer.md) | :heavy_minus_sign: | N/A | +| `VoidHold` | [*ActivityVoidHold](../../models/shared/activityvoidhold.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workflowinstancehistorystageoutput.md b/docs/models/shared/workflowinstancehistorystageoutput.md new file mode 100755 index 00000000..6dfce9f1 --- /dev/null +++ b/docs/models/shared/workflowinstancehistorystageoutput.md @@ -0,0 +1,12 @@ +# WorkflowInstanceHistoryStageOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `CreateTransaction` | [*ActivityCreateTransactionOutput](../../models/shared/activitycreatetransactionoutput.md) | :heavy_minus_sign: | N/A | +| `DebitWallet` | [*ActivityDebitWalletOutput](../../models/shared/activitydebitwalletoutput.md) | :heavy_minus_sign: | N/A | +| `GetAccount` | [*ActivityGetAccountOutput](../../models/shared/activitygetaccountoutput.md) | :heavy_minus_sign: | N/A | +| `GetPayment` | [*ActivityGetPaymentOutput](../../models/shared/activitygetpaymentoutput.md) | :heavy_minus_sign: | N/A | +| `GetWallet` | [*ActivityGetWalletOutput](../../models/shared/activitygetwalletoutput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/payments/README.md b/docs/payments/README.md deleted file mode 100755 index d77eed14..00000000 --- a/docs/payments/README.md +++ /dev/null @@ -1,647 +0,0 @@ -# Payments - -### Available Operations - -* [ConnectorsStripeTransfer](#connectorsstripetransfer) - Transfer funds between Stripe accounts -* [ConnectorsTransfer](#connectorstransfer) - Transfer funds between Connector 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 -* [ListConnectorsTransfers](#listconnectorstransfers) - List transfers and their statuses -* [ListPayments](#listpayments) - List payments -* [PaymentsgetServerInfo](#paymentsgetserverinfo) - Get server info -* [PaymentslistAccounts](#paymentslistaccounts) - List accounts -* [ReadConnectorConfig](#readconnectorconfig) - Read the config of a connector -* [ResetConnector](#resetconnector) - Reset a connector -* [UninstallConnector](#uninstallconnector) - Uninstall a connector -* [UpdateMetadata](#updatemetadata) - Update metadata - -## ConnectorsStripeTransfer - -Execute a transfer between two Stripe accounts. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ConnectorsStripeTransfer(ctx, shared.StripeTransferRequest{ - Amount: formance.Int64(100), - Asset: formance.String("USD"), - Destination: formance.String("acct_1Gqj58KZcSIg2N2q"), - Metadata: map[string]interface{}{ - "suscipit": "natus", - "nobis": "eum", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.StripeTransferResponse != nil { - // handle response - } -} -``` - -## ConnectorsTransfer - -Execute a transfer between two accounts. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ConnectorsTransfer(ctx, operations.ConnectorsTransferRequest{ - TransferRequest: shared.TransferRequest{ - Amount: 100, - Asset: "USD", - Destination: "acct_1Gqj58KZcSIg2N2q", - Source: formance.String("acct_1Gqj58KZcSIg2N2q"), - }, - Connector: shared.ConnectorMoneycorp, - }) - if err != nil { - log.Fatal(err) - } - - if res.TransferResponse != nil { - // handle response - } -} -``` - -## GetConnectorTask - -Get a specific task associated to the connector. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.GetConnectorTask(ctx, operations.GetConnectorTaskRequest{ - Connector: shared.ConnectorDummyPay, - TaskID: "architecto", - }) - if err != nil { - log.Fatal(err) - } - - if res.TaskResponse != nil { - // handle response - } -} -``` - -## GetPayment - -Get a payment - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.GetPayment(ctx, operations.GetPaymentRequest{ - PaymentID: "magnam", - }) - if err != nil { - log.Fatal(err) - } - - if res.PaymentResponse != nil { - // handle response - } -} -``` - -## InstallConnector - -Install a connector by its name and config. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.InstallConnector(ctx, operations.InstallConnectorRequest{ - RequestBody: shared.StripeConfig{ - APIKey: "XXX", - PageSize: formance.Int64(50), - PollingPeriod: formance.String("60s"), - }, - Connector: shared.ConnectorCurrencyCloud, - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## ListAllConnectors - -List all installed connectors. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ListAllConnectors(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ConnectorsResponse != nil { - // handle response - } -} -``` - -## ListConfigsAvailableConnectors - -List the configs of each available connector. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ListConfigsAvailableConnectors(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ConnectorsConfigsResponse != nil { - // handle response - } -} -``` - -## ListConnectorTasks - -List all tasks associated with this connector. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ListConnectorTasks(ctx, operations.ListConnectorTasksRequest{ - Connector: shared.ConnectorWise, - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formance.Int64(590873), - }) - if err != nil { - log.Fatal(err) - } - - if res.TasksCursor != nil { - // handle response - } -} -``` - -## ListConnectorsTransfers - -List transfers - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ListConnectorsTransfers(ctx, operations.ListConnectorsTransfersRequest{ - Connector: shared.ConnectorCurrencyCloud, - }) - if err != nil { - log.Fatal(err) - } - - if res.TransfersResponse != nil { - // handle response - } -} -``` - -## ListPayments - -List payments - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ListPayments(ctx, operations.ListPaymentsRequest{ - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formance.Int64(574325), - Sort: []string{ - "mollitia", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.PaymentsCursor != nil { - // handle response - } -} -``` - -## PaymentsgetServerInfo - -Get server info - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.PaymentsgetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } -} -``` - -## PaymentslistAccounts - -List accounts - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.PaymentslistAccounts(ctx, operations.PaymentslistAccountsRequest{ - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formance.Int64(968962), - Sort: []string{ - "ad", - "eum", - "dolor", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.AccountsCursor != nil { - // handle response - } -} -``` - -## ReadConnectorConfig - -Read connector config - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ReadConnectorConfig(ctx, operations.ReadConnectorConfigRequest{ - Connector: shared.ConnectorMoneycorp, - }) - if err != nil { - log.Fatal(err) - } - - if res.ConnectorConfigResponse != nil { - // handle response - } -} -``` - -## 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" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.ResetConnector(ctx, operations.ResetConnectorRequest{ - Connector: shared.ConnectorDummyPay, - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## UninstallConnector - -Uninstall a connector by its name. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.UninstallConnector(ctx, operations.UninstallConnectorRequest{ - Connector: shared.ConnectorWise, - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## UpdateMetadata - -Update metadata - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Payments.UpdateMetadata(ctx, operations.UpdateMetadataRequest{ - PaymentMetadata: shared.PaymentMetadata{ - Key: formance.String("quasi"), - }, - PaymentID: "iure", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` diff --git a/docs/sdks/auth/README.md b/docs/sdks/auth/README.md new file mode 100755 index 00000000..e8f5603f --- /dev/null +++ b/docs/sdks/auth/README.md @@ -0,0 +1,499 @@ +# Auth +(*Auth*) + +### Available Operations + +* [CreateClient](#createclient) - Create client +* [CreateSecret](#createsecret) - Add a secret to a client +* [DeleteClient](#deleteclient) - Delete client +* [DeleteSecret](#deletesecret) - Delete a secret from a client +* [GetServerInfo](#getserverinfo) - Get server info +* [ListClients](#listclients) - List clients +* [ListUsers](#listusers) - List users +* [ReadClient](#readclient) - Read client +* [ReadUser](#readuser) - Read user +* [UpdateClient](#updateclient) - Update client + +## CreateClient + +Create client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.CreateClient(ctx, &shared.CreateClientRequest{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Name: "string", + PostLogoutRedirectUris: []string{ + "string", + }, + RedirectUris: []string{ + "string", + }, + Scopes: []string{ + "string", + }, + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.CreateSecret(ctx, operations.CreateSecretRequest{ + CreateSecretRequest: &shared.CreateSecretRequest{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Name: "string", + }, + ClientID: "string", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.DeleteClient(ctx, operations.DeleteClientRequest{ + ClientID: "string", + }) + 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** + + +## DeleteSecret + +Delete a secret from a client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.DeleteSecret(ctx, operations.DeleteSecretRequest{ + ClientID: "string", + SecretID: "string", + }) + 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** + + +## GetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.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** + + +## ListClients + +List clients + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.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** + + +## ListUsers + +List users + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.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** + + +## ReadClient + +Read client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.ReadClient(ctx, operations.ReadClientRequest{ + ClientID: "string", + }) + 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** + + +## ReadUser + +Read user + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.ReadUser(ctx, operations.ReadUserRequest{ + UserID: "string", + }) + 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** + + +## UpdateClient + +Update client + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Auth.UpdateClient(ctx, operations.UpdateClientRequest{ + UpdateClientRequest: &shared.UpdateClientRequest{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Name: "string", + PostLogoutRedirectUris: []string{ + "string", + }, + RedirectUris: []string{ + "string", + }, + Scopes: []string{ + "string", + }, + }, + ClientID: "string", + }) + 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 00000000..6b4ee796 --- /dev/null +++ b/docs/sdks/formance/README.md @@ -0,0 +1,104 @@ +# 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 + +* [GetVersions](#getversions) - Show stack version information +* [GetAPIAuthWellKnownOpenidConfiguration](#getapiauthwellknownopenidconfiguration) + +## GetVersions + +Show stack version information + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Formance.GetVersions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.GetVersionsResponse != 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.GetVersionsResponse](../../models/operations/getversionsresponse.md), error** + + +## GetAPIAuthWellKnownOpenidConfiguration + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Formance.GetAPIAuthWellKnownOpenidConfiguration(ctx) + 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. | + + +### Response + +**[*operations.GetAPIAuthWellKnownOpenidConfigurationResponse](../../models/operations/getapiauthwellknownopenidconfigurationresponse.md), error** + diff --git a/docs/sdks/ledger/README.md b/docs/sdks/ledger/README.md new file mode 100755 index 00000000..7fc0cd88 --- /dev/null +++ b/docs/sdks/ledger/README.md @@ -0,0 +1,2145 @@ +# Ledger +(*Ledger*) + +### Available Operations + +* [CreateTransactions](#createtransactions) - Create a new batch of transactions to a ledger +* [AddMetadataOnTransaction](#addmetadataontransaction) - Set the metadata of a transaction by its ID +* [AddMetadataToAccount](#addmetadatatoaccount) - Add metadata to an account +* [CountAccounts](#countaccounts) - Count the accounts from a ledger +* [CountTransactions](#counttransactions) - Count the transactions from a ledger +* [CreateTransaction](#createtransaction) - Create a new transaction to a ledger +* [GetAccount](#getaccount) - Get account by its address +* [GetBalances](#getbalances) - Get the balances from a ledger's account +* [GetBalancesAggregated](#getbalancesaggregated) - Get the aggregated balances from selected accounts +* [GetInfo](#getinfo) - Show server information +* [GetLedgerInfo](#getledgerinfo) - Get information about a ledger +* [GetMapping](#getmapping) - Get the mapping of a ledger +* [GetTransaction](#gettransaction) - Get transaction from a ledger by its ID +* [ListAccounts](#listaccounts) - List accounts from a ledger +* [ListLogs](#listlogs) - List the logs from a ledger +* [ListTransactions](#listtransactions) - List transactions from a ledger +* [ReadStats](#readstats) - Get statistics from a ledger +* [RevertTransaction](#reverttransaction) - Revert a ledger transaction by its ID +* [~~RunScript~~](#runscript) - Execute a Numscript :warning: **Deprecated** +* [UpdateMapping](#updatemapping) - Update the mapping of a ledger +* [V2AddMetadataOnTransaction](#v2addmetadataontransaction) - Set the metadata of a transaction by its ID +* [V2AddMetadataToAccount](#v2addmetadatatoaccount) - Add metadata to an account +* [V2CountAccounts](#v2countaccounts) - Count the accounts from a ledger +* [V2CountTransactions](#v2counttransactions) - Count the transactions from a ledger +* [V2CreateBulk](#v2createbulk) - Bulk request +* [V2CreateLedger](#v2createledger) - Create a ledger +* [V2CreateTransaction](#v2createtransaction) - Create a new transaction to a ledger +* [V2DeleteAccountMetadata](#v2deleteaccountmetadata) - Delete metadata by key +* [V2DeleteTransactionMetadata](#v2deletetransactionmetadata) - Delete metadata by key +* [V2GetAccount](#v2getaccount) - Get account by its address +* [V2GetBalancesAggregated](#v2getbalancesaggregated) - Get the aggregated balances from selected accounts +* [V2GetInfo](#v2getinfo) - Show server information +* [V2GetLedger](#v2getledger) - Get a ledger +* [V2GetLedgerInfo](#v2getledgerinfo) - Get information about a ledger +* [V2GetTransaction](#v2gettransaction) - Get transaction from a ledger by its ID +* [V2ListAccounts](#v2listaccounts) - List accounts from a ledger +* [V2ListLedgers](#v2listledgers) - List ledgers +* [V2ListLogs](#v2listlogs) - List the logs from a ledger +* [V2ListTransactions](#v2listtransactions) - List transactions from a ledger +* [V2ReadStats](#v2readstats) - Get statistics from a ledger +* [V2RevertTransaction](#v2reverttransaction) - 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.CreateTransactions(ctx, operations.CreateTransactionsRequest{ + Transactions: shared.Transactions{ + Transactions: []shared.TransactionData{ + shared.TransactionData{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Postings: []shared.Posting{ + shared.Posting{ + Amount: big.NewInt(100), + Asset: "COIN", + Destination: "users:002", + Source: "users:001", + }, + }, + Reference: formancesdkgo.String("ref:001"), + }, + }, + }, + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.AddMetadataOnTransaction(ctx, operations.AddMetadataOnTransactionRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + Ledger: "ledger001", + Txid: big.NewInt(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** + + +## AddMetadataToAccount + +Add metadata to an account + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.AddMetadataToAccount(ctx, operations.AddMetadataToAccountRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.CountAccounts(ctx, operations.CountAccountsRequest{ + Address: formancesdkgo.String("users:.+"), + Ledger: "ledger001", + Metadata: map[string]interface{}{ + "key": "string", + }, + }) + 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** + + +## CountTransactions + +Count the transactions from a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.CountTransactions(ctx, operations.CountTransactionsRequest{ + Account: formancesdkgo.String("users:001"), + Destination: formancesdkgo.String("users:001"), + Ledger: "ledger001", + Metadata: &operations.CountTransactionsMetadata{}, + Reference: formancesdkgo.String("ref:001"), + Source: formancesdkgo.String("users:001"), + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.CreateTransaction(ctx, operations.CreateTransactionRequest{ + PostTransaction: shared.PostTransaction{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Postings: []shared.Posting{ + shared.Posting{ + Amount: big.NewInt(100), + Asset: "COIN", + Destination: "users:002", + Source: "users:001", + }, + }, + Reference: formancesdkgo.String("ref:001"), + Script: &shared.PostTransactionScript{ + Plain: "vars { + account $user + } + send [COIN 10] ( + source = @world + destination = $user + ) + ", + Vars: map[string]interface{}{ + "user": "string", + }, + }, + }, + Ledger: "ledger001", + Preview: formancesdkgo.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** + + +## GetAccount + +Get account by its address + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.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** + + +## GetBalances + +Get the balances from a ledger's account + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.GetBalances(ctx, operations.GetBalancesRequest{ + Address: formancesdkgo.String("users:001"), + After: formancesdkgo.String("users:003"), + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.GetBalancesAggregated(ctx, operations.GetBalancesAggregatedRequest{ + Address: formancesdkgo.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** + + +## GetInfo + +Show server information + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.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** + + +## GetLedgerInfo + +Get information about a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + 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** + + +## GetMapping + +Get the mapping of a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.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** + + +## GetTransaction + +Get transaction from a ledger by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.GetTransaction(ctx, operations.GetTransactionRequest{ + Ledger: "ledger001", + Txid: big.NewInt(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** + + +## ListAccounts + +List accounts from a ledger, sorted by address in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.ListAccounts(ctx, operations.ListAccountsRequest{ + Address: formancesdkgo.String("users:.+"), + After: formancesdkgo.String("users:003"), + Balance: formancesdkgo.Int64(2400), + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + Metadata: map[string]interface{}{ + "key": "string", + }, + PaginationToken: formancesdkgo.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** + + +## ListLogs + +List the logs from a ledger, sorted by ID in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.ListLogs(ctx, operations.ListLogsRequest{ + After: formancesdkgo.String("1234"), + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + }) + 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** + + +## ListTransactions + +List transactions from a ledger, sorted by txid in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.ListTransactions(ctx, operations.ListTransactionsRequest{ + Account: formancesdkgo.String("users:001"), + After: formancesdkgo.String("1234"), + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Destination: formancesdkgo.String("users:001"), + Ledger: "ledger001", + Metadata: map[string]interface{}{ + "key": "string", + }, + Reference: formancesdkgo.String("ref:001"), + Source: formancesdkgo.String("users:001"), + }) + 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** + + +## ReadStats + +Get statistics from a ledger. (aggregate metrics on accounts and transactions) + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.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** + + +## RevertTransaction + +Revert a ledger transaction by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.RevertTransaction(ctx, operations.RevertTransactionRequest{ + Ledger: "ledger001", + Txid: big.NewInt(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** + + +## ~~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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.RunScript(ctx, operations.RunScriptRequest{ + Script: shared.Script{ + Metadata: map[string]interface{}{ + "key": "string", + }, + Plain: "vars { + account $user + } + send [COIN 10] ( + source = @world + destination = $user + ) + ", + Reference: formancesdkgo.String("order_1234"), + Vars: map[string]interface{}{ + "user": "string", + }, + }, + Ledger: "ledger001", + Preview: formancesdkgo.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** + + +## UpdateMapping + +Update the mapping of a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.UpdateMapping(ctx, operations.UpdateMappingRequest{ + Mapping: &shared.Mapping{ + Contracts: []shared.Contract{ + shared.Contract{ + Account: formancesdkgo.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** + + +## V2AddMetadataOnTransaction + +Set the metadata of a transaction by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2AddMetadataOnTransaction(ctx, operations.V2AddMetadataOnTransactionRequest{ + RequestBody: map[string]string{ + "admin": "true", + }, + DryRun: formancesdkgo.Bool(true), + ID: big.NewInt(1234), + 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.V2AddMetadataOnTransactionRequest](../../models/operations/v2addmetadataontransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2AddMetadataOnTransactionResponse](../../models/operations/v2addmetadataontransactionresponse.md), error** + + +## V2AddMetadataToAccount + +Add metadata to an account + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2AddMetadataToAccount(ctx, operations.V2AddMetadataToAccountRequest{ + RequestBody: map[string]string{ + "admin": "true", + }, + Address: "users:001", + DryRun: formancesdkgo.Bool(true), + 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.V2AddMetadataToAccountRequest](../../models/operations/v2addmetadatatoaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2AddMetadataToAccountResponse](../../models/operations/v2addmetadatatoaccountresponse.md), error** + + +## V2CountAccounts + +Count the accounts from a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2CountAccounts(ctx, operations.V2CountAccountsRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + 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.V2CountAccountsRequest](../../models/operations/v2countaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CountAccountsResponse](../../models/operations/v2countaccountsresponse.md), error** + + +## V2CountTransactions + +Count the transactions from a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2CountTransactions(ctx, operations.V2CountTransactionsRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + 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.V2CountTransactionsRequest](../../models/operations/v2counttransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CountTransactionsResponse](../../models/operations/v2counttransactionsresponse.md), error** + + +## V2CreateBulk + +Bulk request + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2CreateBulk(ctx, operations.V2CreateBulkRequest{ + RequestBody: []shared.V2BulkElement{ + shared.CreateV2BulkElementV2BulkElementV2BulkElementAddMetadata( + shared.V2BulkElementV2BulkElementAddMetadata{ + Action: "string", + Data: &shared.V2BulkElementV2BulkElementAddMetadataData{ + Metadata: map[string]string{ + "key": "string", + }, + TargetID: shared.CreateV2TargetIDStr( + "string", + ), + TargetType: shared.V2TargetTypeAccount, + }, + }, + ), + }, + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2BulkResponse != 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.V2CreateBulkRequest](../../models/operations/v2createbulkrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CreateBulkResponse](../../models/operations/v2createbulkresponse.md), error** + + +## V2CreateLedger + +Create a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2CreateLedger(ctx, operations.V2CreateLedgerRequest{ + V2CreateLedgerRequest: &shared.V2CreateLedgerRequest{}, + 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.V2CreateLedgerRequest](../../models/operations/v2createledgerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CreateLedgerResponse](../../models/operations/v2createledgerresponse.md), error** + + +## V2CreateTransaction + +Create a new transaction to a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2CreateTransaction(ctx, operations.V2CreateTransactionRequest{ + V2PostTransaction: shared.V2PostTransaction{ + Metadata: map[string]string{ + "admin": "true", + }, + Postings: []shared.V2Posting{ + shared.V2Posting{ + Amount: big.NewInt(100), + Asset: "COIN", + Destination: "users:002", + Source: "users:001", + }, + }, + Reference: formancesdkgo.String("ref:001"), + Script: &shared.V2PostTransactionScript{ + Plain: "vars { + account $user + } + send [COIN 10] ( + source = @world + destination = $user + ) + ", + Vars: map[string]interface{}{ + "user": "string", + }, + }, + }, + DryRun: formancesdkgo.Bool(true), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2CreateTransactionResponse != 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.V2CreateTransactionRequest](../../models/operations/v2createtransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CreateTransactionResponse](../../models/operations/v2createtransactionresponse.md), error** + + +## V2DeleteAccountMetadata + +Delete metadata by key + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2DeleteAccountMetadata(ctx, operations.V2DeleteAccountMetadataRequest{ + Address: "3680 Emile Grove", + Key: "foo", + 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.V2DeleteAccountMetadataRequest](../../models/operations/v2deleteaccountmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2DeleteAccountMetadataResponse](../../models/operations/v2deleteaccountmetadataresponse.md), error** + + +## V2DeleteTransactionMetadata + +Delete metadata by key + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2DeleteTransactionMetadata(ctx, operations.V2DeleteTransactionMetadataRequest{ + ID: big.NewInt(1234), + Key: "foo", + 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.V2DeleteTransactionMetadataRequest](../../models/operations/v2deletetransactionmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2DeleteTransactionMetadataResponse](../../models/operations/v2deletetransactionmetadataresponse.md), error** + + +## V2GetAccount + +Get account by its address + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetAccount(ctx, operations.V2GetAccountRequest{ + Address: "users:001", + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2AccountResponse != 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.V2GetAccountRequest](../../models/operations/v2getaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetAccountResponse](../../models/operations/v2getaccountresponse.md), error** + + +## V2GetBalancesAggregated + +Get the aggregated balances from selected accounts + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetBalancesAggregated(ctx, operations.V2GetBalancesAggregatedRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2AggregateBalancesResponse != 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.V2GetBalancesAggregatedRequest](../../models/operations/v2getbalancesaggregatedrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetBalancesAggregatedResponse](../../models/operations/v2getbalancesaggregatedresponse.md), error** + + +## V2GetInfo + +Show server information + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.V2ConfigInfoResponse != 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.V2GetInfoResponse](../../models/operations/v2getinforesponse.md), error** + + +## V2GetLedger + +Get a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetLedger(ctx, operations.V2GetLedgerRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2Ledger != 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.V2GetLedgerRequest](../../models/operations/v2getledgerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetLedgerResponse](../../models/operations/v2getledgerresponse.md), error** + + +## V2GetLedgerInfo + +Get information about a ledger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetLedgerInfo(ctx, operations.V2GetLedgerInfoRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2LedgerInfoResponse != 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.V2GetLedgerInfoRequest](../../models/operations/v2getledgerinforequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetLedgerInfoResponse](../../models/operations/v2getledgerinforesponse.md), error** + + +## V2GetTransaction + +Get transaction from a ledger by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2GetTransaction(ctx, operations.V2GetTransactionRequest{ + ID: big.NewInt(1234), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2GetTransactionResponse != 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.V2GetTransactionRequest](../../models/operations/v2gettransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetTransactionResponse](../../models/operations/v2gettransactionresponse.md), error** + + +## V2ListAccounts + +List accounts from a ledger, sorted by address in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2ListAccounts(ctx, operations.V2ListAccountsRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2AccountsCursorResponse != 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.V2ListAccountsRequest](../../models/operations/v2listaccountsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListAccountsResponse](../../models/operations/v2listaccountsresponse.md), error** + + +## V2ListLedgers + +List ledgers + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2ListLedgers(ctx, operations.V2ListLedgersRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + if err != nil { + log.Fatal(err) + } + + if res.V2LedgerListResponse != 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.V2ListLedgersRequest](../../models/operations/v2listledgersrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListLedgersResponse](../../models/operations/v2listledgersresponse.md), error** + + +## V2ListLogs + +List the logs from a ledger, sorted by ID in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2ListLogs(ctx, operations.V2ListLogsRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2LogsCursorResponse != 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.V2ListLogsRequest](../../models/operations/v2listlogsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListLogsResponse](../../models/operations/v2listlogsresponse.md), error** + + +## V2ListTransactions + +List transactions from a ledger, sorted by id in descending order. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2ListTransactions(ctx, operations.V2ListTransactionsRequest{ + RequestBody: map[string]interface{}{ + "key": "string", + }, + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2TransactionsCursorResponse != 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.V2ListTransactionsRequest](../../models/operations/v2listtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListTransactionsResponse](../../models/operations/v2listtransactionsresponse.md), error** + + +## V2ReadStats + +Get statistics from a ledger. (aggregate metrics on accounts and transactions) + + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2ReadStats(ctx, operations.V2ReadStatsRequest{ + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2StatsResponse != 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.V2ReadStatsRequest](../../models/operations/v2readstatsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ReadStatsResponse](../../models/operations/v2readstatsresponse.md), error** + + +## V2RevertTransaction + +Revert a ledger transaction by its ID + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Ledger.V2RevertTransaction(ctx, operations.V2RevertTransactionRequest{ + ID: big.NewInt(1234), + Ledger: "ledger001", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2RevertTransactionResponse != 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.V2RevertTransactionRequest](../../models/operations/v2reverttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2RevertTransactionResponse](../../models/operations/v2reverttransactionresponse.md), error** + diff --git a/docs/sdks/orchestration/README.md b/docs/sdks/orchestration/README.md new file mode 100755 index 00000000..9325a9f3 --- /dev/null +++ b/docs/sdks/orchestration/README.md @@ -0,0 +1,1605 @@ +# Orchestration +(*Orchestration*) + +### Available Operations + +* [CancelEvent](#cancelevent) - Cancel a running workflow +* [CreateTrigger](#createtrigger) - Create trigger +* [CreateWorkflow](#createworkflow) - Create workflow +* [DeleteTrigger](#deletetrigger) - Delete trigger +* [DeleteWorkflow](#deleteworkflow) - Delete a flow by id +* [GetInstance](#getinstance) - Get a workflow instance by id +* [GetInstanceHistory](#getinstancehistory) - Get a workflow instance history by id +* [GetInstanceStageHistory](#getinstancestagehistory) - Get a workflow instance stage history +* [GetWorkflow](#getworkflow) - Get a flow by id +* [ListInstances](#listinstances) - List instances of a workflow +* [ListTriggers](#listtriggers) - List triggers +* [ListTriggersOccurrences](#listtriggersoccurrences) - List triggers occurrences +* [ListWorkflows](#listworkflows) - List registered workflows +* [OrchestrationgetServerInfo](#orchestrationgetserverinfo) - Get server info +* [ReadTrigger](#readtrigger) - Read trigger +* [RunWorkflow](#runworkflow) - Run workflow +* [SendEvent](#sendevent) - Send an event to a running workflow +* [V2CancelEvent](#v2cancelevent) - Cancel a running workflow +* [V2CreateTrigger](#v2createtrigger) - Create trigger +* [V2CreateWorkflow](#v2createworkflow) - Create workflow +* [V2DeleteTrigger](#v2deletetrigger) - Delete trigger +* [V2DeleteWorkflow](#v2deleteworkflow) - Delete a flow by id +* [V2GetInstance](#v2getinstance) - Get a workflow instance by id +* [V2GetInstanceHistory](#v2getinstancehistory) - Get a workflow instance history by id +* [V2GetInstanceStageHistory](#v2getinstancestagehistory) - Get a workflow instance stage history +* [V2GetServerInfo](#v2getserverinfo) - Get server info +* [V2GetWorkflow](#v2getworkflow) - Get a flow by id +* [V2ListInstances](#v2listinstances) - List instances of a workflow +* [V2ListTriggers](#v2listtriggers) - List triggers +* [V2ListTriggersOccurrences](#v2listtriggersoccurrences) - List triggers occurrences +* [V2ListWorkflows](#v2listworkflows) - List registered workflows +* [V2ReadTrigger](#v2readtrigger) - Read trigger +* [V2RunWorkflow](#v2runworkflow) - Run workflow +* [V2SendEvent](#v2sendevent) - Send an event to a running workflow + +## CancelEvent + +Cancel a running workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.CancelEvent(ctx, operations.CancelEventRequest{ + InstanceID: "string", + }) + 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.CancelEventRequest](../../models/operations/canceleventrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CancelEventResponse](../../models/operations/canceleventresponse.md), error** + + +## CreateTrigger + +Create trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.CreateTrigger(ctx, &shared.TriggerData{ + Event: "string", + Vars: map[string]interface{}{ + "key": "string", + }, + WorkflowID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.CreateTriggerResponse != 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.TriggerData](../../models/shared/triggerdata.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateTriggerResponse](../../models/operations/createtriggerresponse.md), error** + + +## CreateWorkflow + +Create a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.CreateWorkflow(ctx, &shared.CreateWorkflowRequest{ + Stages: []map[string]interface{}{ + map[string]interface{}{ + "key": "string", + }, + }, + }) + 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** + + +## DeleteTrigger + +Read trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.DeleteTrigger(ctx, operations.DeleteTriggerRequest{ + TriggerID: "string", + }) + 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.DeleteTriggerRequest](../../models/operations/deletetriggerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteTriggerResponse](../../models/operations/deletetriggerresponse.md), error** + + +## DeleteWorkflow + +Delete a flow by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.DeleteWorkflow(ctx, operations.DeleteWorkflowRequest{ + FlowID: "string", + }) + 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.DeleteWorkflowRequest](../../models/operations/deleteworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeleteWorkflowResponse](../../models/operations/deleteworkflowresponse.md), error** + + +## GetInstance + +Get a workflow instance by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.GetInstance(ctx, operations.GetInstanceRequest{ + InstanceID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWorkflowInstanceResponse != 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.GetInstanceRequest](../../models/operations/getinstancerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetInstanceResponse](../../models/operations/getinstanceresponse.md), error** + + +## GetInstanceHistory + +Get a workflow instance history by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.GetInstanceHistory(ctx, operations.GetInstanceHistoryRequest{ + InstanceID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWorkflowInstanceHistoryResponse != 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.GetInstanceHistoryRequest](../../models/operations/getinstancehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetInstanceHistoryResponse](../../models/operations/getinstancehistoryresponse.md), error** + + +## GetInstanceStageHistory + +Get a workflow instance stage history + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.GetInstanceStageHistory(ctx, operations.GetInstanceStageHistoryRequest{ + InstanceID: "string", + Number: 600636, + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWorkflowInstanceHistoryStageResponse != 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.GetInstanceStageHistoryRequest](../../models/operations/getinstancestagehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetInstanceStageHistoryResponse](../../models/operations/getinstancestagehistoryresponse.md), error** + + +## GetWorkflow + +Get a flow by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.GetWorkflow(ctx, operations.GetWorkflowRequest{ + FlowID: "string", + }) + 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.GetWorkflowRequest](../../models/operations/getworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetWorkflowResponse](../../models/operations/getworkflowresponse.md), error** + + +## ListInstances + +List instances of a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.ListInstances(ctx, operations.ListInstancesRequest{}) + 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.ListInstancesRequest](../../models/operations/listinstancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListInstancesResponse](../../models/operations/listinstancesresponse.md), error** + + +## ListTriggers + +List triggers + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.ListTriggers(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ListTriggersResponse != 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.ListTriggersResponse](../../models/operations/listtriggersresponse.md), error** + + +## ListTriggersOccurrences + +List triggers occurrences + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.ListTriggersOccurrences(ctx, operations.ListTriggersOccurrencesRequest{ + TriggerID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.ListTriggersOccurrencesResponse != 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.ListTriggersOccurrencesRequest](../../models/operations/listtriggersoccurrencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListTriggersOccurrencesResponse](../../models/operations/listtriggersoccurrencesresponse.md), error** + + +## ListWorkflows + +List registered workflows + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.ListWorkflows(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.ListWorkflowsResponse](../../models/operations/listworkflowsresponse.md), error** + + +## OrchestrationgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + 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** + + +## ReadTrigger + +Read trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.ReadTrigger(ctx, operations.ReadTriggerRequest{ + TriggerID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReadTriggerResponse != 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.ReadTriggerRequest](../../models/operations/readtriggerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReadTriggerResponse](../../models/operations/readtriggerresponse.md), error** + + +## RunWorkflow + +Run workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{ + RequestBody: map[string]string{ + "key": "string", + }, + WorkflowID: "string", + }) + 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** + + +## SendEvent + +Send an event to a running workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.SendEvent(ctx, operations.SendEventRequest{ + RequestBody: &operations.SendEventRequestBody{ + Name: "string", + }, + InstanceID: "string", + }) + 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.SendEventRequest](../../models/operations/sendeventrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.SendEventResponse](../../models/operations/sendeventresponse.md), error** + + +## V2CancelEvent + +Cancel a running workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2CancelEvent(ctx, operations.V2CancelEventRequest{ + InstanceID: "string", + }) + 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.V2CancelEventRequest](../../models/operations/v2canceleventrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CancelEventResponse](../../models/operations/v2canceleventresponse.md), error** + + +## V2CreateTrigger + +Create trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2CreateTrigger(ctx, &shared.V2TriggerData{ + Event: "string", + Vars: map[string]interface{}{ + "key": "string", + }, + WorkflowID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2CreateTriggerResponse != 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.V2TriggerData](../../models/shared/v2triggerdata.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CreateTriggerResponse](../../models/operations/v2createtriggerresponse.md), error** + + +## V2CreateWorkflow + +Create a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2CreateWorkflow(ctx, &shared.V2CreateWorkflowRequest{ + Stages: []map[string]interface{}{ + map[string]interface{}{ + "key": "string", + }, + }, + }) + if err != nil { + log.Fatal(err) + } + + if res.V2CreateWorkflowResponse != 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.V2CreateWorkflowRequest](../../models/shared/v2createworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2CreateWorkflowResponse](../../models/operations/v2createworkflowresponse.md), error** + + +## V2DeleteTrigger + +Read trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2DeleteTrigger(ctx, operations.V2DeleteTriggerRequest{ + TriggerID: "string", + }) + 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.V2DeleteTriggerRequest](../../models/operations/v2deletetriggerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2DeleteTriggerResponse](../../models/operations/v2deletetriggerresponse.md), error** + + +## V2DeleteWorkflow + +Delete a flow by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2DeleteWorkflow(ctx, operations.V2DeleteWorkflowRequest{ + FlowID: "string", + }) + 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.V2DeleteWorkflowRequest](../../models/operations/v2deleteworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2DeleteWorkflowResponse](../../models/operations/v2deleteworkflowresponse.md), error** + + +## V2GetInstance + +Get a workflow instance by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2GetInstance(ctx, operations.V2GetInstanceRequest{ + InstanceID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2GetWorkflowInstanceResponse != 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.V2GetInstanceRequest](../../models/operations/v2getinstancerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetInstanceResponse](../../models/operations/v2getinstanceresponse.md), error** + + +## V2GetInstanceHistory + +Get a workflow instance history by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2GetInstanceHistory(ctx, operations.V2GetInstanceHistoryRequest{ + InstanceID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2GetWorkflowInstanceHistoryResponse != 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.V2GetInstanceHistoryRequest](../../models/operations/v2getinstancehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetInstanceHistoryResponse](../../models/operations/v2getinstancehistoryresponse.md), error** + + +## V2GetInstanceStageHistory + +Get a workflow instance stage history + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2GetInstanceStageHistory(ctx, operations.V2GetInstanceStageHistoryRequest{ + InstanceID: "string", + Number: 465454, + }) + if err != nil { + log.Fatal(err) + } + + if res.V2GetWorkflowInstanceHistoryStageResponse != 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.V2GetInstanceStageHistoryRequest](../../models/operations/v2getinstancestagehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetInstanceStageHistoryResponse](../../models/operations/v2getinstancestagehistoryresponse.md), error** + + +## V2GetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2GetServerInfo(ctx) + if err != nil { + log.Fatal(err) + } + + if res.V2ServerInfo != 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.V2GetServerInfoResponse](../../models/operations/v2getserverinforesponse.md), error** + + +## V2GetWorkflow + +Get a flow by id + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2GetWorkflow(ctx, operations.V2GetWorkflowRequest{ + FlowID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2GetWorkflowResponse != 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.V2GetWorkflowRequest](../../models/operations/v2getworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2GetWorkflowResponse](../../models/operations/v2getworkflowresponse.md), error** + + +## V2ListInstances + +List instances of a workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2ListInstances(ctx, operations.V2ListInstancesRequest{}) + if err != nil { + log.Fatal(err) + } + + if res.V2ListRunsResponse != 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.V2ListInstancesRequest](../../models/operations/v2listinstancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListInstancesResponse](../../models/operations/v2listinstancesresponse.md), error** + + +## V2ListTriggers + +List triggers + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2ListTriggers(ctx) + if err != nil { + log.Fatal(err) + } + + if res.V2ListTriggersResponse != 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.V2ListTriggersResponse](../../models/operations/v2listtriggersresponse.md), error** + + +## V2ListTriggersOccurrences + +List triggers occurrences + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2ListTriggersOccurrences(ctx, operations.V2ListTriggersOccurrencesRequest{ + TriggerID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2ListTriggersOccurrencesResponse != 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.V2ListTriggersOccurrencesRequest](../../models/operations/v2listtriggersoccurrencesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ListTriggersOccurrencesResponse](../../models/operations/v2listtriggersoccurrencesresponse.md), error** + + +## V2ListWorkflows + +List registered workflows + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2ListWorkflows(ctx) + if err != nil { + log.Fatal(err) + } + + if res.V2ListWorkflowsResponse != 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.V2ListWorkflowsResponse](../../models/operations/v2listworkflowsresponse.md), error** + + +## V2ReadTrigger + +Read trigger + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2ReadTrigger(ctx, operations.V2ReadTriggerRequest{ + TriggerID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2ReadTriggerResponse != 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.V2ReadTriggerRequest](../../models/operations/v2readtriggerrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2ReadTriggerResponse](../../models/operations/v2readtriggerresponse.md), error** + + +## V2RunWorkflow + +Run workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2RunWorkflow(ctx, operations.V2RunWorkflowRequest{ + RequestBody: map[string]string{ + "key": "string", + }, + WorkflowID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.V2RunWorkflowResponse != 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.V2RunWorkflowRequest](../../models/operations/v2runworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2RunWorkflowResponse](../../models/operations/v2runworkflowresponse.md), error** + + +## V2SendEvent + +Send an event to a running workflow + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Orchestration.V2SendEvent(ctx, operations.V2SendEventRequest{ + RequestBody: &operations.V2SendEventRequestBody{ + Name: "string", + }, + InstanceID: "string", + }) + 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.V2SendEventRequest](../../models/operations/v2sendeventrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.V2SendEventResponse](../../models/operations/v2sendeventresponse.md), error** + diff --git a/docs/sdks/reconciliation/README.md b/docs/sdks/reconciliation/README.md new file mode 100755 index 00000000..7002fed1 --- /dev/null +++ b/docs/sdks/reconciliation/README.md @@ -0,0 +1,386 @@ +# Reconciliation +(*Reconciliation*) + +### Available Operations + +* [CreatePolicy](#createpolicy) - Create a policy +* [DeletePolicy](#deletepolicy) - Delete a policy +* [GetPolicy](#getpolicy) - Get a policy +* [GetReconciliation](#getreconciliation) - Get a reconciliation +* [ListPolicies](#listpolicies) - List policies +* [ListReconciliations](#listreconciliations) - List reconciliations +* [Reconcile](#reconcile) - Reconcile using a policy +* [ReconciliationgetServerInfo](#reconciliationgetserverinfo) - Get server info + +## CreatePolicy + +Create a policy + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.CreatePolicy(ctx, shared.PolicyRequest{ + LedgerName: "default", + LedgerQuery: "{\"$match\": {\"metadata[reconciliation]\": \"pool:main\"}}", + Name: "XXX", + PaymentsPoolID: "XXX", + }) + if err != nil { + log.Fatal(err) + } + + if res.PolicyResponse != 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.PolicyRequest](../../models/shared/policyrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreatePolicyResponse](../../models/operations/createpolicyresponse.md), error** + + +## DeletePolicy + +Delete a policy by its id. + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.DeletePolicy(ctx, operations.DeletePolicyRequest{ + PolicyID: "string", + }) + 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.DeletePolicyRequest](../../models/operations/deletepolicyrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.DeletePolicyResponse](../../models/operations/deletepolicyresponse.md), error** + + +## GetPolicy + +Get a policy + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.GetPolicy(ctx, operations.GetPolicyRequest{ + PolicyID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.PolicyResponse != 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.GetPolicyRequest](../../models/operations/getpolicyrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetPolicyResponse](../../models/operations/getpolicyresponse.md), error** + + +## GetReconciliation + +Get a reconciliation + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.GetReconciliation(ctx, operations.GetReconciliationRequest{ + ReconciliationID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReconciliationResponse != 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.GetReconciliationRequest](../../models/operations/getreconciliationrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetReconciliationResponse](../../models/operations/getreconciliationresponse.md), error** + + +## ListPolicies + +List policies + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.ListPolicies(ctx, operations.ListPoliciesRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + if err != nil { + log.Fatal(err) + } + + if res.PoliciesCursorResponse != 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.ListPoliciesRequest](../../models/operations/listpoliciesrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListPoliciesResponse](../../models/operations/listpoliciesresponse.md), error** + + +## ListReconciliations + +List reconciliations + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.ListReconciliations(ctx, operations.ListReconciliationsRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + if err != nil { + log.Fatal(err) + } + + if res.ReconciliationsCursorResponse != 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.ListReconciliationsRequest](../../models/operations/listreconciliationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ListReconciliationsResponse](../../models/operations/listreconciliationsresponse.md), error** + + +## Reconcile + +Reconcile using a policy + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/types" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.Reconcile(ctx, operations.ReconcileRequest{ + ReconciliationRequest: shared.ReconciliationRequest{ + ReconciledAtLedger: types.MustTimeFromString("2021-01-01T00:00:00.000Z"), + ReconciledAtPayments: types.MustTimeFromString("2021-01-01T00:00:00.000Z"), + }, + PolicyID: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.ReconciliationResponse != 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.ReconcileRequest](../../models/operations/reconcilerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.ReconcileResponse](../../models/operations/reconcileresponse.md), error** + + +## ReconciliationgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Reconciliation.ReconciliationgetServerInfo(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.ReconciliationgetServerInfoResponse](../../models/operations/reconciliationgetserverinforesponse.md), error** + diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md new file mode 100755 index 00000000..3931de5e --- /dev/null +++ b/docs/sdks/search/README.md @@ -0,0 +1,148 @@ +# Search +(*Search*) + +### Available Operations + +* [Search](#search) - Search +* [SearchgetServerInfo](#searchgetserverinfo) - Get server info + +## Search + +ElasticSearch query engine + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Search.Search(ctx, shared.Query{ + After: []string{ + "u", + "s", + "e", + "r", + "s", + ":", + "0", + "0", + "2", + }, + Cursor: formancesdkgo.String("YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="), + Ledgers: []string{ + "q", + "u", + "i", + "c", + "k", + "s", + "t", + "a", + "r", + "t", + }, + Policy: formancesdkgo.String("OR"), + Raw: &shared.QueryRaw{}, + Sort: formancesdkgo.String("id:asc"), + Terms: []string{ + "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 { + 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** + + +## SearchgetServerInfo + +Get server info + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Search.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/wallets/README.md b/docs/sdks/wallets/README.md new file mode 100755 index 00000000..01f2fba3 --- /dev/null +++ b/docs/sdks/wallets/README.md @@ -0,0 +1,815 @@ +# Wallets +(*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 +* [GetWalletSummary](#getwalletsummary) - Get wallet summary +* [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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.ConfirmHold(ctx, operations.ConfirmHoldRequest{ + ConfirmHoldRequest: &shared.ConfirmHoldRequest{ + Amount: big.NewInt(100), + Final: formancesdkgo.Bool(true), + }, + HoldID: "string", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.CreateBalance(ctx, operations.CreateBalanceRequest{ + CreateBalanceRequest: &shared.CreateBalanceRequest{ + Name: "string", + }, + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.CreateWallet(ctx, &shared.CreateWalletRequest{ + Metadata: map[string]string{ + "key": "string", + }, + Name: "string", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.CreditWallet(ctx, operations.CreditWalletRequest{ + CreditWalletRequest: &shared.CreditWalletRequest{ + Amount: shared.Monetary{ + Amount: big.NewInt(201874), + Asset: "string", + }, + Metadata: map[string]string{ + "key": "string", + }, + Sources: []shared.Subject{ + shared.CreateSubjectLedgerAccountSubject( + shared.LedgerAccountSubject{ + Identifier: "string", + Type: "string", + }, + ), + }, + }, + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "math/big" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.DebitWallet(ctx, operations.DebitWalletRequest{ + DebitWalletRequest: &shared.DebitWalletRequest{ + Amount: shared.Monetary{ + Amount: big.NewInt(245256), + Asset: "string", + }, + Balances: []string{ + "string", + }, + Destination: shared.CreateSubjectLedgerAccountSubject( + shared.LedgerAccountSubject{ + Identifier: "string", + Type: "string", + }, + ), + Metadata: map[string]string{ + "key": "string", + }, + }, + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetBalance(ctx, operations.GetBalanceRequest{ + BalanceName: "string", + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetHold(ctx, operations.GetHoldRequest{ + HoldID: "string", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetHolds(ctx, operations.GetHoldsRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Metadata: map[string]string{ + "key": "string", + }, + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetTransactions(ctx, operations.GetTransactionsRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetWallet(ctx, operations.GetWalletRequest{ + ID: "", + }) + 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** + + +## GetWalletSummary + +Get wallet summary + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.GetWalletSummary(ctx, operations.GetWalletSummaryRequest{ + ID: "", + }) + if err != nil { + log.Fatal(err) + } + + if res.GetWalletSummaryResponse != 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.GetWalletSummaryRequest](../../models/operations/getwalletsummaryrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetWalletSummaryResponse](../../models/operations/getwalletsummaryresponse.md), error** + + +## ListBalances + +List balances of a wallet + +### Example Usage + +```go +package main + +import( + "context" + "log" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.ListBalances(ctx, operations.ListBalancesRequest{ + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.ListWallets(ctx, operations.ListWalletsRequest{ + Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), + Metadata: map[string]string{ + "key": "string", + }, + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ + RequestBody: &operations.UpdateWalletRequestBody{ + Metadata: map[string]string{ + "key": "string", + }, + }, + ID: "", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Wallets.VoidHold(ctx, operations.VoidHoldRequest{ + HoldID: "string", + }) + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" +) + +func main() { + s := formancesdkgo.New() + + 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 00000000..0e18e3d3 --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,357 @@ +# Webhooks +(*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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Webhooks.ChangeConfigSecret(ctx, operations.ChangeConfigSecretRequest{ + ConfigChangeSecret: &shared.ConfigChangeSecret{ + Secret: "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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + 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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Webhooks.GetManyConfigs(ctx, operations.GetManyConfigsRequest{ + Endpoint: formancesdkgo.String("https://example.com"), + ID: formancesdkgo.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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" +) + +func main() { + s := formancesdkgo.New() + + ctx := context.Background() + res, err := s.Webhooks.InsertConfig(ctx, shared.ConfigUser{ + Endpoint: "https://example.com", + EventTypes: []string{ + "TYPE1", + "TYPE2", + }, + Secret: formancesdkgo.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" + formancesdkgo "github.com/formancehq/formance-sdk-go" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" +) + +func main() { + s := formancesdkgo.New() + + 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/docs/search/README.md b/docs/search/README.md deleted file mode 100755 index 82744c27..00000000 --- a/docs/search/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# Search - -### Available Operations - -* [Search](#search) - Search -* [SearchgetServerInfo](#searchgetserverinfo) - Get server info - -## Search - -ElasticSearch query engine - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Search.Search(ctx, shared.Query{ - After: []string{ - "users:002", - "users:002", - "users:002", - "users:002", - }, - Cursor: formance.String("YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="), - Ledgers: []string{ - "quickstart", - "quickstart", - "quickstart", - "quickstart", - }, - PageSize: formance.Int64(260341), - Policy: formance.String("OR"), - Raw: map[string]interface{}{ - "deleniti": "facilis", - "in": "architecto", - "architecto": "repudiandae", - "ullam": "expedita", - }, - Sort: formance.String("txid:asc"), - Target: formance.String("nihil"), - Terms: []string{ - "destination=central_bank1", - "destination=central_bank1", - "destination=central_bank1", - "destination=central_bank1", - }, - }) - if err != nil { - log.Fatal(err) - } - - if res.Response != nil { - // handle response - } -} -``` - -## SearchgetServerInfo - -Get server info - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Search.SearchgetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } -} -``` diff --git a/docs/wallets/README.md b/docs/wallets/README.md deleted file mode 100755 index ddbffbd2..00000000 --- a/docs/wallets/README.md +++ /dev/null @@ -1,680 +0,0 @@ -# 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 -* [GetWalletSummary](#getwalletsummary) - Get wallet summary -* [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" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.ConfirmHold(ctx, operations.ConfirmHoldRequest{ - ConfirmHoldRequest: &shared.ConfirmHoldRequest{ - Amount: big.NewInt(100), - Final: formance.Bool(true), - }, - HoldID: "quibusdam", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## CreateBalance - -Create a balance - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "github.com/formancehq/formance-sdk-go/pkg/types" - "math/big" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.CreateBalance(ctx, operations.CreateBalanceRequest{ - CreateBalanceRequest: &shared.CreateBalanceRequest{ - ExpiresAt: types.MustTimeFromString("2022-02-04T19:17:08.641Z"), - Name: "Edward Crooks", - Priority: big.NewInt(166847), - }, - ID: "1cddc692-601f-4b57-ab0d-5f0d30c5fbb2", - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateBalanceResponse != nil { - // handle response - } -} -``` - -## CreateWallet - -Create a new wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.CreateWallet(ctx, shared.CreateWalletRequest{ - Metadata: map[string]string{ - "totam": "dignissimos", - "eaque": "quis", - }, - Name: "Ruby Auer", - }) - if err != nil { - log.Fatal(err) - } - - if res.CreateWalletResponse != nil { - // handle response - } -} -``` - -## CreditWallet - -Credit a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.CreditWallet(ctx, operations.CreditWalletRequest{ - CreditWalletRequest: &shared.CreditWalletRequest{ - Amount: shared.Monetary{ - Amount: big.NewInt(463451), - Asset: "dolor", - }, - Balance: formance.String("vero"), - Metadata: map[string]string{ - "hic": "recusandae", - "omnis": "facilis", - }, - Reference: formance.String("perspiciatis"), - Sources: []shared.Subject{ - shared.Subject{}, - }, - }, - ID: "c28909b3-fe49-4a8d-9cbf-48633323f9b7", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## DebitWallet - -Debit a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.DebitWallet(ctx, operations.DebitWalletRequest{ - DebitWalletRequest: &shared.DebitWalletRequest{ - Amount: shared.Monetary{ - Amount: big.NewInt(490459), - Asset: "reiciendis", - }, - Balances: []string{ - "dolorum", - }, - Description: formance.String("numquam"), - Destination: &shared.Subject{}, - Metadata: map[string]string{ - "ipsa": "ipsa", - }, - Pending: formance.Bool(false), - }, - ID: "674ebf69-280d-41ba-b7a8-9ebf737ae420", - }) - if err != nil { - log.Fatal(err) - } - - if res.DebitWalletResponse != nil { - // handle response - } -} -``` - -## GetBalance - -Get detailed balance - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetBalance(ctx, operations.GetBalanceRequest{ - BalanceName: "amet", - ID: "ce5e6a95-d8a0-4d44-ace2-af7a73cf3be4", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetBalanceResponse != nil { - // handle response - } -} -``` - -## GetHold - -Get a hold - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetHold(ctx, operations.GetHoldRequest{ - HoldID: "enim", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetHoldResponse != nil { - // handle response - } -} -``` - -## GetHolds - -Get all holds for a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetHolds(ctx, operations.GetHoldsRequest{ - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Metadata: map[string]string{ - "sapiente": "totam", - }, - PageSize: formance.Int64(471752), - WalletID: formance.String("sit"), - }) - if err != nil { - log.Fatal(err) - } - - if res.GetHoldsResponse != nil { - // handle response - } -} -``` - -## GetTransactions - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetTransactions(ctx, operations.GetTransactionsRequest{ - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - PageSize: formance.Int64(711584), - WalletID: formance.String("neque"), - }) - if err != nil { - log.Fatal(err) - } - - if res.GetTransactionsResponse != nil { - // handle response - } -} -``` - -## GetWallet - -Get a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetWallet(ctx, operations.GetWalletRequest{ - ID: "26b5a734-29cd-4b1a-8422-bb679d232271", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWalletResponse != nil { - // handle response - } -} -``` - -## GetWalletSummary - -Get wallet summary - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.GetWalletSummary(ctx, operations.GetWalletSummaryRequest{ - ID: "5bf0cbb1-e31b-48b9-8f34-43a1108e0adc", - }) - if err != nil { - log.Fatal(err) - } - - if res.GetWalletSummaryResponse != nil { - // handle response - } -} -``` - -## ListBalances - -List balances of a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.ListBalances(ctx, operations.ListBalancesRequest{ - ID: "f4b92187-9fce-4953-b73e-f7fbc7abd74d", - }) - if err != nil { - log.Fatal(err) - } - - if res.ListBalancesResponse != nil { - // handle response - } -} -``` - -## ListWallets - -List all wallets - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.ListWallets(ctx, operations.ListWalletsRequest{ - Cursor: formance.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="), - Metadata: map[string]string{ - "sequi": "natus", - "impedit": "aut", - "voluptatibus": "exercitationem", - "nulla": "fugit", - }, - Name: formance.String("Elijah Wyman"), - PageSize: formance.Int64(497391), - }) - if err != nil { - log.Fatal(err) - } - - if res.ListWalletsResponse != nil { - // handle response - } -} -``` - -## UpdateWallet - -Update a wallet - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.UpdateWallet(ctx, operations.UpdateWalletRequest{ - RequestBody: &operations.UpdateWalletRequestBody{ - Metadata: map[string]string{ - "officia": "tempora", - }, - }, - ID: "5626d436-813f-416d-9f5f-ce6c556146c3", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## VoidHold - -Cancel a hold - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.VoidHold(ctx, operations.VoidHoldRequest{ - HoldID: "recusandae", - }) - if err != nil { - log.Fatal(err) - } - - if res.StatusCode == http.StatusOK { - // handle response - } -} -``` - -## WalletsgetServerInfo - -Get server info - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Wallets.WalletsgetServerInfo(ctx) - if err != nil { - log.Fatal(err) - } - - if res.ServerInfo != nil { - // handle response - } -} -``` diff --git a/docs/webhooks/README.md b/docs/webhooks/README.md deleted file mode 100755 index 9f985d17..00000000 --- a/docs/webhooks/README.md +++ /dev/null @@ -1,292 +0,0 @@ -# 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" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - 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 - } -} -``` - -## 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" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Webhooks.ChangeConfigSecret(ctx, operations.ChangeConfigSecretRequest{ - ConfigChangeSecret: &shared.ConfigChangeSecret{ - Secret: "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3", - }, - ID: "4997257d-dfb6-445b-929c-cbe2ab182818", - }) - if err != nil { - log.Fatal(err) - } - - if res.ConfigResponse != nil { - // handle response - } -} -``` - -## DeactivateConfig - -Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - 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 - } -} -``` - -## DeleteConfig - -Delete a webhooks config by ID. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - 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 - } -} -``` - -## GetManyConfigs - -Sorted by updated date descending - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Webhooks.GetManyConfigs(ctx, operations.GetManyConfigsRequest{ - Endpoint: formance.String("https://example.com"), - ID: formance.String("4997257d-dfb6-445b-929c-cbe2ab182818"), - }) - if err != nil { - log.Fatal(err) - } - - if res.ConfigsResponse != nil { - // handle response - } -} -``` - -## 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" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - ctx := context.Background() - res, err := s.Webhooks.InsertConfig(ctx, shared.ConfigUser{ - Endpoint: "https://example.com", - EventTypes: []string{ - "TYPE1", - }, - Secret: formance.String("V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"), - }) - if err != nil { - log.Fatal(err) - } - - if res.ConfigResponse != nil { - // handle response - } -} -``` - -## TestConfig - -Test a config by sending a webhook to its endpoint. - -### Example Usage - -```go -package main - -import( - "context" - "log" - "github.com/formancehq/formance-sdk-go" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" -) - -func main() { - s := formance.New( - formance.WithSecurity(shared.Security{ - Authorization: "Bearer YOUR_ACCESS_TOKEN_HERE", - }), - ) - - 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 - } -} -``` diff --git a/files.gen b/files.gen index bb9b5c4a..bb325bd9 100755 --- a/files.gen +++ b/files.gen @@ -1,56 +1,40 @@ auth.go -flows.go ledger.go -payments.go +orchestration.go +reconciliation.go search.go wallets.go 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 pkg/utils/retries.go pkg/utils/security.go pkg/utils/utils.go -pkg/models/operations/addscopetoclient.go -pkg/models/operations/addtransientscope.go +tests/helpers.go pkg/models/operations/createclient.go -pkg/models/operations/createscope.go pkg/models/operations/createsecret.go pkg/models/operations/deleteclient.go -pkg/models/operations/deletescope.go -pkg/models/operations/deletescopefromclient.go pkg/models/operations/deletesecret.go -pkg/models/operations/deletetransientscope.go pkg/models/operations/getserverinfo.go pkg/models/operations/listclients.go -pkg/models/operations/listscopes.go pkg/models/operations/listusers.go pkg/models/operations/readclient.go -pkg/models/operations/readscope.go pkg/models/operations/readuser.go pkg/models/operations/updateclient.go -pkg/models/operations/updatescope.go -pkg/models/operations/cancelevent.go -pkg/models/operations/createworkflow.go -pkg/models/operations/deleteworkflow.go -pkg/models/operations/getinstance.go -pkg/models/operations/getinstancehistory.go -pkg/models/operations/getinstancestagehistory.go -pkg/models/operations/getworkflow.go -pkg/models/operations/listinstances.go -pkg/models/operations/listworkflows.go -pkg/models/operations/orchestrationgetserverinfo.go -pkg/models/operations/runworkflow.go -pkg/models/operations/sendevent.go pkg/models/operations/createtransactions.go pkg/models/operations/addmetadataontransaction.go pkg/models/operations/addmetadatatoaccount.go @@ -71,22 +55,69 @@ pkg/models/operations/readstats.go pkg/models/operations/reverttransaction.go pkg/models/operations/runscript.go pkg/models/operations/updatemapping.go -pkg/models/operations/connectorsstripetransfer.go -pkg/models/operations/connectorstransfer.go -pkg/models/operations/getconnectortask.go -pkg/models/operations/getpayment.go -pkg/models/operations/installconnector.go -pkg/models/operations/listallconnectors.go -pkg/models/operations/listconfigsavailableconnectors.go -pkg/models/operations/listconnectortasks.go -pkg/models/operations/listconnectorstransfers.go -pkg/models/operations/listpayments.go -pkg/models/operations/paymentsgetserverinfo.go -pkg/models/operations/paymentslistaccounts.go -pkg/models/operations/readconnectorconfig.go -pkg/models/operations/resetconnector.go -pkg/models/operations/uninstallconnector.go -pkg/models/operations/updatemetadata.go +pkg/models/operations/v2addmetadataontransaction.go +pkg/models/operations/v2addmetadatatoaccount.go +pkg/models/operations/v2countaccounts.go +pkg/models/operations/v2counttransactions.go +pkg/models/operations/v2createbulk.go +pkg/models/operations/v2createledger.go +pkg/models/operations/v2createtransaction.go +pkg/models/operations/v2deleteaccountmetadata.go +pkg/models/operations/v2deletetransactionmetadata.go +pkg/models/operations/v2getaccount.go +pkg/models/operations/v2getbalancesaggregated.go +pkg/models/operations/v2getinfo.go +pkg/models/operations/v2getledger.go +pkg/models/operations/v2getledgerinfo.go +pkg/models/operations/v2gettransaction.go +pkg/models/operations/v2listaccounts.go +pkg/models/operations/v2listledgers.go +pkg/models/operations/v2listlogs.go +pkg/models/operations/v2listtransactions.go +pkg/models/operations/v2readstats.go +pkg/models/operations/v2reverttransaction.go +pkg/models/operations/cancelevent.go +pkg/models/operations/createtrigger.go +pkg/models/operations/createworkflow.go +pkg/models/operations/deletetrigger.go +pkg/models/operations/deleteworkflow.go +pkg/models/operations/getinstance.go +pkg/models/operations/getinstancehistory.go +pkg/models/operations/getinstancestagehistory.go +pkg/models/operations/getworkflow.go +pkg/models/operations/listinstances.go +pkg/models/operations/listtriggers.go +pkg/models/operations/listtriggersoccurrences.go +pkg/models/operations/listworkflows.go +pkg/models/operations/orchestrationgetserverinfo.go +pkg/models/operations/readtrigger.go +pkg/models/operations/runworkflow.go +pkg/models/operations/sendevent.go +pkg/models/operations/v2cancelevent.go +pkg/models/operations/v2createtrigger.go +pkg/models/operations/v2createworkflow.go +pkg/models/operations/v2deletetrigger.go +pkg/models/operations/v2deleteworkflow.go +pkg/models/operations/v2getinstance.go +pkg/models/operations/v2getinstancehistory.go +pkg/models/operations/v2getinstancestagehistory.go +pkg/models/operations/v2getserverinfo.go +pkg/models/operations/v2getworkflow.go +pkg/models/operations/v2listinstances.go +pkg/models/operations/v2listtriggers.go +pkg/models/operations/v2listtriggersoccurrences.go +pkg/models/operations/v2listworkflows.go +pkg/models/operations/v2readtrigger.go +pkg/models/operations/v2runworkflow.go +pkg/models/operations/v2sendevent.go +pkg/models/operations/createpolicy.go +pkg/models/operations/deletepolicy.go +pkg/models/operations/getpolicy.go +pkg/models/operations/getreconciliation.go +pkg/models/operations/listpolicies.go +pkg/models/operations/listreconciliations.go +pkg/models/operations/reconcile.go +pkg/models/operations/reconciliationgetserverinfo.go pkg/models/operations/search.go pkg/models/operations/searchgetserverinfo.go pkg/models/operations/confirmhold.go @@ -113,29 +144,91 @@ pkg/models/operations/getmanyconfigs.go pkg/models/operations/insertconfig.go pkg/models/operations/testconfig.go pkg/models/operations/getversions.go +pkg/models/operations/getapiauthwellknownopenidconfiguration.go pkg/models/shared/createclientresponse.go pkg/models/shared/client.go pkg/models/shared/clientsecret.go pkg/models/shared/createclientrequest.go -pkg/models/shared/createscoperesponse.go -pkg/models/shared/scope.go -pkg/models/shared/createscoperequest.go pkg/models/shared/createsecretresponse.go pkg/models/shared/secret.go pkg/models/shared/createsecretrequest.go pkg/models/shared/serverinfo.go pkg/models/shared/listclientsresponse.go -pkg/models/shared/listscopesresponse.go pkg/models/shared/listusersresponse.go pkg/models/shared/user.go pkg/models/shared/readclientresponse.go -pkg/models/shared/readscoperesponse.go pkg/models/shared/readuserresponse.go pkg/models/shared/updateclientresponse.go pkg/models/shared/updateclientrequest.go -pkg/models/shared/updatescoperesponse.go -pkg/models/shared/updatescoperequest.go +pkg/models/shared/transactionsresponse.go +pkg/models/shared/transaction.go +pkg/models/shared/volume.go +pkg/models/shared/posting.go +pkg/models/shared/errorresponse.go +pkg/models/shared/errorsenum.go +pkg/models/shared/transactions.go +pkg/models/shared/transactiondata.go +pkg/models/shared/posttransaction.go +pkg/models/shared/accountresponse.go +pkg/models/shared/accountwithvolumesandbalances.go +pkg/models/shared/balancescursorresponse.go +pkg/models/shared/aggregatebalancesresponse.go +pkg/models/shared/configinforesponse.go +pkg/models/shared/configinfo.go +pkg/models/shared/config.go +pkg/models/shared/ledgerstorage.go +pkg/models/shared/ledgerinforesponse.go +pkg/models/shared/ledgerinfo.go +pkg/models/shared/migrationinfo.go +pkg/models/shared/mappingresponse.go +pkg/models/shared/mapping.go +pkg/models/shared/contract.go +pkg/models/shared/transactionresponse.go +pkg/models/shared/accountscursorresponse.go +pkg/models/shared/account.go +pkg/models/shared/logscursorresponse.go +pkg/models/shared/log.go +pkg/models/shared/transactionscursorresponse.go +pkg/models/shared/statsresponse.go +pkg/models/shared/stats.go +pkg/models/shared/scriptresponse.go +pkg/models/shared/script.go +pkg/models/shared/v2errorresponse.go +pkg/models/shared/v2errorsenum.go +pkg/models/shared/v2bulkresponse.go +pkg/models/shared/v2bulkelementresult.go +pkg/models/shared/v2transaction.go +pkg/models/shared/v2posting.go +pkg/models/shared/v2bulkelement.go +pkg/models/shared/v2posttransaction.go +pkg/models/shared/v2targettype.go +pkg/models/shared/v2targetid.go +pkg/models/shared/v2createledgerrequest.go +pkg/models/shared/v2createtransactionresponse.go +pkg/models/shared/v2accountresponse.go +pkg/models/shared/v2account.go +pkg/models/shared/v2volume.go +pkg/models/shared/v2aggregatebalancesresponse.go +pkg/models/shared/v2configinforesponse.go +pkg/models/shared/v2ledger.go +pkg/models/shared/v2ledgerinforesponse.go +pkg/models/shared/v2ledgerinfo.go +pkg/models/shared/v2migrationinfo.go +pkg/models/shared/v2gettransactionresponse.go +pkg/models/shared/v2expandedtransaction.go +pkg/models/shared/v2accountscursorresponse.go +pkg/models/shared/v2ledgerlistresponse.go +pkg/models/shared/v2logscursorresponse.go +pkg/models/shared/v2log.go +pkg/models/shared/v2transactionscursorresponse.go +pkg/models/shared/v2statsresponse.go +pkg/models/shared/v2stats.go +pkg/models/shared/v2reverttransactionresponse.go +pkg/models/shared/orchestrationv2transaction.go pkg/models/shared/error.go +pkg/models/shared/createtriggerresponse.go +pkg/models/shared/trigger.go +pkg/models/shared/triggerdata.go pkg/models/shared/createworkflowresponse.go pkg/models/shared/workflow.go pkg/models/shared/workflowconfig.go @@ -145,6 +238,7 @@ pkg/models/shared/workflowinstance.go pkg/models/shared/stagestatus.go pkg/models/shared/getworkflowinstancehistoryresponse.go pkg/models/shared/workflowinstancehistory.go +pkg/models/shared/stage.go pkg/models/shared/stagesend.go pkg/models/shared/stagesendsource.go pkg/models/shared/stagesendsourcewallet.go @@ -160,10 +254,6 @@ pkg/models/shared/stagewaitevent.go pkg/models/shared/getworkflowinstancehistorystageresponse.go pkg/models/shared/workflowinstancehistorystage.go pkg/models/shared/workflowinstancehistorystageoutput.go -pkg/models/shared/activityreverttransactionoutput.go -pkg/models/shared/transaction.go -pkg/models/shared/volume.go -pkg/models/shared/posting.go pkg/models/shared/activitygetwalletoutput.go pkg/models/shared/walletwithbalances.go pkg/models/shared/assetholder.go @@ -174,17 +264,17 @@ pkg/models/shared/connector.go pkg/models/shared/paymentmetadata.go pkg/models/shared/paymentadjustment.go pkg/models/shared/activitygetaccountoutput.go -pkg/models/shared/accountwithvolumesandbalances.go +pkg/models/shared/orchestrationaccount.go pkg/models/shared/activitydebitwalletoutput.go pkg/models/shared/hold.go pkg/models/shared/subject.go pkg/models/shared/ledgeraccountsubject.go pkg/models/shared/walletsubject.go pkg/models/shared/activitycreatetransactionoutput.go +pkg/models/shared/orchestrationtransaction.go pkg/models/shared/workflowinstancehistorystageinput.go pkg/models/shared/activityvoidhold.go pkg/models/shared/activitystripetransfer.go -pkg/models/shared/activityreverttransaction.go pkg/models/shared/activitygetwallet.go pkg/models/shared/activitygetpayment.go pkg/models/shared/activitygetaccount.go @@ -193,69 +283,91 @@ pkg/models/shared/debitwalletrequest.go pkg/models/shared/activitycreditwallet.go pkg/models/shared/creditwalletrequest.go pkg/models/shared/activitycreatetransaction.go -pkg/models/shared/posttransaction.go +pkg/models/shared/orchestrationposttransaction.go pkg/models/shared/activityconfirmhold.go pkg/models/shared/getworkflowresponse.go pkg/models/shared/listrunsresponse.go +pkg/models/shared/listtriggersresponse.go +pkg/models/shared/listtriggersoccurrencesresponse.go +pkg/models/shared/triggeroccurrence.go pkg/models/shared/listworkflowsresponse.go +pkg/models/shared/readtriggerresponse.go pkg/models/shared/runworkflowresponse.go -pkg/models/shared/transactionsresponse.go -pkg/models/shared/errorresponse.go -pkg/models/shared/errorsenum.go -pkg/models/shared/transactions.go -pkg/models/shared/transactiondata.go -pkg/models/shared/accountresponse.go -pkg/models/shared/balancescursorresponse.go -pkg/models/shared/aggregatebalancesresponse.go -pkg/models/shared/configinforesponse.go -pkg/models/shared/configinfo.go -pkg/models/shared/config.go -pkg/models/shared/ledgerstorage.go -pkg/models/shared/ledgerinforesponse.go -pkg/models/shared/ledgerinfo.go -pkg/models/shared/migrationinfo.go -pkg/models/shared/mappingresponse.go -pkg/models/shared/mapping.go -pkg/models/shared/contract.go -pkg/models/shared/transactionresponse.go -pkg/models/shared/accountscursorresponse.go -pkg/models/shared/account.go -pkg/models/shared/logscursorresponse.go -pkg/models/shared/log.go -pkg/models/shared/transactionscursorresponse.go -pkg/models/shared/statsresponse.go -pkg/models/shared/stats.go -pkg/models/shared/scriptresponse.go -pkg/models/shared/script.go -pkg/models/shared/stripetransferrequest.go -pkg/models/shared/transferresponse.go -pkg/models/shared/transferrequest.go -pkg/models/shared/taskresponse.go -pkg/models/shared/taskstripe.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/taskmangopay.go -pkg/models/shared/taskmoneycorp.go -pkg/models/shared/paymentresponse.go -pkg/models/shared/stripeconfig.go -pkg/models/shared/dummypayconfig.go -pkg/models/shared/wiseconfig.go -pkg/models/shared/modulrconfig.go -pkg/models/shared/currencycloudconfig.go -pkg/models/shared/bankingcircleconfig.go -pkg/models/shared/mangopayconfig.go -pkg/models/shared/moneycorpconfig.go -pkg/models/shared/connectorsresponse.go -pkg/models/shared/connectorsconfigsresponse.go -pkg/models/shared/taskscursor.go -pkg/models/shared/transfersresponse.go -pkg/models/shared/paymentscursor.go -pkg/models/shared/accountscursor.go -pkg/models/shared/paymentsaccount.go -pkg/models/shared/connectorconfigresponse.go +pkg/models/shared/v2error.go +pkg/models/shared/v2createtriggerresponse.go +pkg/models/shared/v2trigger.go +pkg/models/shared/v2triggerdata.go +pkg/models/shared/v2createworkflowresponse.go +pkg/models/shared/v2workflow.go +pkg/models/shared/v2workflowconfig.go +pkg/models/shared/v2createworkflowrequest.go +pkg/models/shared/v2getworkflowinstanceresponse.go +pkg/models/shared/v2workflowinstance.go +pkg/models/shared/v2stagestatus.go +pkg/models/shared/v2getworkflowinstancehistoryresponse.go +pkg/models/shared/v2workflowinstancehistory.go +pkg/models/shared/v2stage.go +pkg/models/shared/v2stagesend.go +pkg/models/shared/v2stagesendsource.go +pkg/models/shared/v2stagesendsourcewallet.go +pkg/models/shared/v2stagesendsourcepayment.go +pkg/models/shared/v2stagesendsourceaccount.go +pkg/models/shared/v2stagesenddestination.go +pkg/models/shared/v2stagesenddestinationwallet.go +pkg/models/shared/v2stagesenddestinationpayment.go +pkg/models/shared/v2stagesenddestinationaccount.go +pkg/models/shared/v2monetary.go +pkg/models/shared/v2stagedelay.go +pkg/models/shared/v2stagewaitevent.go +pkg/models/shared/v2getworkflowinstancehistorystageresponse.go +pkg/models/shared/v2workflowinstancehistorystage.go +pkg/models/shared/v2workflowinstancehistorystageoutput.go +pkg/models/shared/v2activitygetwalletoutput.go +pkg/models/shared/v2walletwithbalances.go +pkg/models/shared/v2assetholder.go +pkg/models/shared/v2activitygetpaymentoutput.go +pkg/models/shared/v2payment.go +pkg/models/shared/v2paymentstatus.go +pkg/models/shared/v2connector.go +pkg/models/shared/v2paymentmetadata.go +pkg/models/shared/v2paymentadjustment.go +pkg/models/shared/v2activitygetaccountoutput.go +pkg/models/shared/v2activitydebitwalletoutput.go +pkg/models/shared/v2hold.go +pkg/models/shared/v2subject.go +pkg/models/shared/v2ledgeraccountsubject.go +pkg/models/shared/v2walletsubject.go +pkg/models/shared/v2activitycreatetransactionoutput.go +pkg/models/shared/v2workflowinstancehistorystageinput.go +pkg/models/shared/v2activityvoidhold.go +pkg/models/shared/v2activitystripetransfer.go +pkg/models/shared/v2activitygetwallet.go +pkg/models/shared/v2activitygetpayment.go +pkg/models/shared/v2activitygetaccount.go +pkg/models/shared/v2activitydebitwallet.go +pkg/models/shared/v2debitwalletrequest.go +pkg/models/shared/v2activitycreditwallet.go +pkg/models/shared/v2creditwalletrequest.go +pkg/models/shared/v2activitycreatetransaction.go +pkg/models/shared/v2activityconfirmhold.go +pkg/models/shared/v2serverinfo.go +pkg/models/shared/v2getworkflowresponse.go +pkg/models/shared/v2listrunsresponse.go +pkg/models/shared/v2listtriggersresponse.go +pkg/models/shared/v2listtriggersoccurrencesresponse.go +pkg/models/shared/v2triggeroccurrence.go +pkg/models/shared/v2listworkflowsresponse.go +pkg/models/shared/v2readtriggerresponse.go +pkg/models/shared/v2runworkflowresponse.go +pkg/models/shared/reconciliationerrorresponse.go +pkg/models/shared/policyresponse.go +pkg/models/shared/policy.go +pkg/models/shared/policyrequest.go +pkg/models/shared/reconciliationresponse.go +pkg/models/shared/reconciliation.go +pkg/models/shared/policiescursorresponse.go +pkg/models/shared/reconciliationscursorresponse.go +pkg/models/shared/reconciliationrequest.go pkg/models/shared/response.go pkg/models/shared/query.go pkg/models/shared/walletserrorresponse.go @@ -275,7 +387,6 @@ pkg/models/shared/getholdsresponse.go pkg/models/shared/gettransactionsresponse.go pkg/models/shared/walletstransaction.go pkg/models/shared/walletsvolume.go -pkg/models/shared/walletsposting.go pkg/models/shared/getwalletresponse.go pkg/models/shared/getwalletsummaryresponse.go pkg/models/shared/listbalancesresponse.go @@ -291,13 +402,548 @@ pkg/models/shared/attemptresponse.go pkg/models/shared/attempt.go pkg/models/shared/getversionsresponse.go pkg/models/shared/version.go -pkg/models/shared/security.go -docs/formance/README.md -docs/auth/README.md -docs/flows/README.md -docs/ledger/README.md -docs/payments/README.md -docs/search/README.md -docs/wallets/README.md -docs/webhooks/README.md -USAGE.md \ No newline at end of file +USAGE.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/deletesecretrequest.md +docs/models/operations/deletesecretresponse.md +docs/models/operations/getserverinforesponse.md +docs/models/operations/listclientsresponse.md +docs/models/operations/listusersresponse.md +docs/models/operations/readclientrequest.md +docs/models/operations/readclientresponse.md +docs/models/operations/readuserrequest.md +docs/models/operations/readuserresponse.md +docs/models/operations/updateclientrequest.md +docs/models/operations/updateclientresponse.md +docs/models/operations/createtransactionsrequest.md +docs/models/operations/createtransactionsresponse.md +docs/models/operations/addmetadataontransactionrequest.md +docs/models/operations/addmetadataontransactionresponse.md +docs/models/operations/addmetadatatoaccountrequest.md +docs/models/operations/addmetadatatoaccountresponse.md +docs/models/operations/countaccountsrequest.md +docs/models/operations/countaccountsresponse.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/getaccountrequest.md +docs/models/operations/getaccountresponse.md +docs/models/operations/getbalancesrequest.md +docs/models/operations/getbalancesresponse.md +docs/models/operations/getbalancesaggregatedrequest.md +docs/models/operations/getbalancesaggregatedresponse.md +docs/models/operations/getinforesponse.md +docs/models/operations/getledgerinforequest.md +docs/models/operations/getledgerinforesponse.md +docs/models/operations/getmappingrequest.md +docs/models/operations/getmappingresponse.md +docs/models/operations/gettransactionrequest.md +docs/models/operations/gettransactionresponse.md +docs/models/operations/listaccountsrequest.md +docs/models/operations/listaccountsresponse.md +docs/models/operations/listlogsrequest.md +docs/models/operations/listlogsresponse.md +docs/models/operations/listtransactionsrequest.md +docs/models/operations/listtransactionsresponse.md +docs/models/operations/readstatsrequest.md +docs/models/operations/readstatsresponse.md +docs/models/operations/reverttransactionrequest.md +docs/models/operations/reverttransactionresponse.md +docs/models/operations/runscriptrequest.md +docs/models/operations/runscriptresponse.md +docs/models/operations/updatemappingrequest.md +docs/models/operations/updatemappingresponse.md +docs/models/operations/v2addmetadataontransactionrequest.md +docs/models/operations/v2addmetadataontransactionresponse.md +docs/models/operations/v2addmetadatatoaccountrequest.md +docs/models/operations/v2addmetadatatoaccountresponse.md +docs/models/operations/v2countaccountsrequest.md +docs/models/operations/v2countaccountsresponse.md +docs/models/operations/v2counttransactionsrequest.md +docs/models/operations/v2counttransactionsresponse.md +docs/models/operations/v2createbulkrequest.md +docs/models/operations/v2createbulkresponse.md +docs/models/operations/v2createledgerrequest.md +docs/models/operations/v2createledgerresponse.md +docs/models/operations/v2createtransactionrequest.md +docs/models/operations/v2createtransactionresponse.md +docs/models/operations/v2deleteaccountmetadatarequest.md +docs/models/operations/v2deleteaccountmetadataresponse.md +docs/models/operations/v2deletetransactionmetadatarequest.md +docs/models/operations/v2deletetransactionmetadataresponse.md +docs/models/operations/v2getaccountrequest.md +docs/models/operations/v2getaccountresponse.md +docs/models/operations/v2getbalancesaggregatedrequest.md +docs/models/operations/v2getbalancesaggregatedresponse.md +docs/models/operations/v2getinforesponse.md +docs/models/operations/v2getledgerrequest.md +docs/models/operations/v2getledgerresponse.md +docs/models/operations/v2getledgerinforequest.md +docs/models/operations/v2getledgerinforesponse.md +docs/models/operations/v2gettransactionrequest.md +docs/models/operations/v2gettransactionresponse.md +docs/models/operations/v2listaccountsrequest.md +docs/models/operations/v2listaccountsresponse.md +docs/models/operations/v2listledgersrequest.md +docs/models/operations/v2listledgersresponse.md +docs/models/operations/v2listlogsrequest.md +docs/models/operations/v2listlogsresponse.md +docs/models/operations/v2listtransactionsrequest.md +docs/models/operations/v2listtransactionsresponse.md +docs/models/operations/v2readstatsrequest.md +docs/models/operations/v2readstatsresponse.md +docs/models/operations/v2reverttransactionrequest.md +docs/models/operations/v2reverttransactionresponse.md +docs/models/operations/canceleventrequest.md +docs/models/operations/canceleventresponse.md +docs/models/operations/createtriggerresponse.md +docs/models/operations/createworkflowresponse.md +docs/models/operations/deletetriggerrequest.md +docs/models/operations/deletetriggerresponse.md +docs/models/operations/deleteworkflowrequest.md +docs/models/operations/deleteworkflowresponse.md +docs/models/operations/getinstancerequest.md +docs/models/operations/getinstanceresponse.md +docs/models/operations/getinstancehistoryrequest.md +docs/models/operations/getinstancehistoryresponse.md +docs/models/operations/getinstancestagehistoryrequest.md +docs/models/operations/getinstancestagehistoryresponse.md +docs/models/operations/getworkflowrequest.md +docs/models/operations/getworkflowresponse.md +docs/models/operations/listinstancesrequest.md +docs/models/operations/listinstancesresponse.md +docs/models/operations/listtriggersresponse.md +docs/models/operations/listtriggersoccurrencesrequest.md +docs/models/operations/listtriggersoccurrencesresponse.md +docs/models/operations/listworkflowsresponse.md +docs/models/operations/orchestrationgetserverinforesponse.md +docs/models/operations/readtriggerrequest.md +docs/models/operations/readtriggerresponse.md +docs/models/operations/runworkflowrequest.md +docs/models/operations/runworkflowresponse.md +docs/models/operations/sendeventrequestbody.md +docs/models/operations/sendeventrequest.md +docs/models/operations/sendeventresponse.md +docs/models/operations/v2canceleventrequest.md +docs/models/operations/v2canceleventresponse.md +docs/models/operations/v2createtriggerresponse.md +docs/models/operations/v2createworkflowresponse.md +docs/models/operations/v2deletetriggerrequest.md +docs/models/operations/v2deletetriggerresponse.md +docs/models/operations/v2deleteworkflowrequest.md +docs/models/operations/v2deleteworkflowresponse.md +docs/models/operations/v2getinstancerequest.md +docs/models/operations/v2getinstanceresponse.md +docs/models/operations/v2getinstancehistoryrequest.md +docs/models/operations/v2getinstancehistoryresponse.md +docs/models/operations/v2getinstancestagehistoryrequest.md +docs/models/operations/v2getinstancestagehistoryresponse.md +docs/models/operations/v2getserverinforesponse.md +docs/models/operations/v2getworkflowrequest.md +docs/models/operations/v2getworkflowresponse.md +docs/models/operations/v2listinstancesrequest.md +docs/models/operations/v2listinstancesresponse.md +docs/models/operations/v2listtriggersresponse.md +docs/models/operations/v2listtriggersoccurrencesrequest.md +docs/models/operations/v2listtriggersoccurrencesresponse.md +docs/models/operations/v2listworkflowsresponse.md +docs/models/operations/v2readtriggerrequest.md +docs/models/operations/v2readtriggerresponse.md +docs/models/operations/v2runworkflowrequest.md +docs/models/operations/v2runworkflowresponse.md +docs/models/operations/v2sendeventrequestbody.md +docs/models/operations/v2sendeventrequest.md +docs/models/operations/v2sendeventresponse.md +docs/models/operations/createpolicyresponse.md +docs/models/operations/deletepolicyrequest.md +docs/models/operations/deletepolicyresponse.md +docs/models/operations/getpolicyrequest.md +docs/models/operations/getpolicyresponse.md +docs/models/operations/getreconciliationrequest.md +docs/models/operations/getreconciliationresponse.md +docs/models/operations/listpoliciesrequest.md +docs/models/operations/listpoliciesresponse.md +docs/models/operations/listreconciliationsrequest.md +docs/models/operations/listreconciliationsresponse.md +docs/models/operations/reconcilerequest.md +docs/models/operations/reconcileresponse.md +docs/models/operations/reconciliationgetserverinforesponse.md +docs/models/operations/searchresponse.md +docs/models/operations/searchgetserverinforesponse.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/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/getwalletsummaryrequest.md +docs/models/operations/getwalletsummaryresponse.md +docs/models/operations/listbalancesrequest.md +docs/models/operations/listbalancesresponse.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/getversionsresponse.md +docs/models/operations/getapiauthwellknownopenidconfigurationresponse.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/serverinfo.md +docs/models/shared/listclientsresponse.md +docs/models/shared/listusersresponse.md +docs/models/shared/user.md +docs/models/shared/readclientresponse.md +docs/models/shared/readuserresponse.md +docs/models/shared/updateclientresponse.md +docs/models/shared/updateclientrequest.md +docs/models/shared/transactionsresponse.md +docs/models/shared/transaction.md +docs/models/shared/volume.md +docs/models/shared/posting.md +docs/models/shared/errorresponse.md +docs/models/shared/errorsenum.md +docs/models/shared/transactions.md +docs/models/shared/transactiondata.md +docs/models/shared/posttransactionscript.md +docs/models/shared/posttransaction.md +docs/models/shared/accountresponse.md +docs/models/shared/accountwithvolumesandbalances.md +docs/models/shared/balancescursorresponsecursor.md +docs/models/shared/balancescursorresponse.md +docs/models/shared/aggregatebalancesresponse.md +docs/models/shared/configinforesponse.md +docs/models/shared/configinfo.md +docs/models/shared/config.md +docs/models/shared/ledgerstorage.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/mappingresponse.md +docs/models/shared/mapping.md +docs/models/shared/contractexpr.md +docs/models/shared/contract.md +docs/models/shared/transactionresponse.md +docs/models/shared/accountscursorresponsecursor.md +docs/models/shared/accountscursorresponse.md +docs/models/shared/account.md +docs/models/shared/logscursorresponsecursor.md +docs/models/shared/logscursorresponse.md +docs/models/shared/logtype.md +docs/models/shared/log.md +docs/models/shared/transactionscursorresponsecursor.md +docs/models/shared/transactionscursorresponse.md +docs/models/shared/statsresponse.md +docs/models/shared/stats.md +docs/models/shared/scriptresponse.md +docs/models/shared/script.md +docs/models/shared/v2errorresponse.md +docs/models/shared/v2errorsenum.md +docs/models/shared/v2bulkresponse.md +docs/models/shared/v2bulkelementresultv2bulkelementresulterror.md +docs/models/shared/v2bulkelementresultv2bulkelementresultdeletemetadata.md +docs/models/shared/v2bulkelementresultv2bulkelementresultreverttransaction.md +docs/models/shared/v2bulkelementresultv2bulkelementresultaddmetadata.md +docs/models/shared/v2bulkelementresultv2bulkelementresultcreatetransaction.md +docs/models/shared/v2bulkelementresult.md +docs/models/shared/v2transaction.md +docs/models/shared/v2posting.md +docs/models/shared/v2bulkelementv2bulkelementdeletemetadatadata.md +docs/models/shared/v2bulkelementv2bulkelementdeletemetadata.md +docs/models/shared/v2bulkelementv2bulkelementreverttransactiondata.md +docs/models/shared/v2bulkelementv2bulkelementreverttransaction.md +docs/models/shared/v2bulkelementv2bulkelementaddmetadatadata.md +docs/models/shared/v2bulkelementv2bulkelementaddmetadata.md +docs/models/shared/v2bulkelementv2bulkelementcreatetransaction.md +docs/models/shared/v2bulkelement.md +docs/models/shared/v2posttransactionscript.md +docs/models/shared/v2posttransaction.md +docs/models/shared/v2targettype.md +docs/models/shared/v2targetid.md +docs/models/shared/v2createledgerrequest.md +docs/models/shared/v2createtransactionresponse.md +docs/models/shared/v2accountresponse.md +docs/models/shared/v2account.md +docs/models/shared/v2volume.md +docs/models/shared/v2aggregatebalancesresponse.md +docs/models/shared/v2configinforesponse.md +docs/models/shared/v2ledger.md +docs/models/shared/v2ledgerinforesponse.md +docs/models/shared/v2ledgerinfostorage.md +docs/models/shared/v2ledgerinfo.md +docs/models/shared/v2migrationinfostate.md +docs/models/shared/v2migrationinfo.md +docs/models/shared/v2gettransactionresponse.md +docs/models/shared/v2expandedtransaction.md +docs/models/shared/v2accountscursorresponsecursor.md +docs/models/shared/v2accountscursorresponse.md +docs/models/shared/v2ledgerlistresponsecursor.md +docs/models/shared/v2ledgerlistresponse.md +docs/models/shared/v2logscursorresponsecursor.md +docs/models/shared/v2logscursorresponse.md +docs/models/shared/v2logtype.md +docs/models/shared/v2log.md +docs/models/shared/v2transactionscursorresponsecursor.md +docs/models/shared/v2transactionscursorresponse.md +docs/models/shared/v2statsresponse.md +docs/models/shared/v2stats.md +docs/models/shared/v2reverttransactionresponse.md +docs/models/shared/orchestrationv2transaction.md +docs/models/shared/errorerrorcode.md +docs/models/shared/error.md +docs/models/shared/createtriggerresponse.md +docs/models/shared/trigger.md +docs/models/shared/triggerdata.md +docs/models/shared/createworkflowresponse.md +docs/models/shared/workflow.md +docs/models/shared/workflowconfig.md +docs/models/shared/createworkflowrequest.md +docs/models/shared/getworkflowinstanceresponse.md +docs/models/shared/workflowinstance.md +docs/models/shared/stagestatus.md +docs/models/shared/getworkflowinstancehistoryresponse.md +docs/models/shared/workflowinstancehistory.md +docs/models/shared/stage.md +docs/models/shared/stagesend.md +docs/models/shared/stagesendsource.md +docs/models/shared/stagesendsourcewallet.md +docs/models/shared/stagesendsourcepayment.md +docs/models/shared/stagesendsourceaccount.md +docs/models/shared/stagesenddestination.md +docs/models/shared/stagesenddestinationwallet.md +docs/models/shared/stagesenddestinationpayment.md +docs/models/shared/stagesenddestinationaccount.md +docs/models/shared/monetary.md +docs/models/shared/stagedelay.md +docs/models/shared/stagewaitevent.md +docs/models/shared/getworkflowinstancehistorystageresponse.md +docs/models/shared/workflowinstancehistorystage.md +docs/models/shared/workflowinstancehistorystageoutput.md +docs/models/shared/activitygetwalletoutput.md +docs/models/shared/walletwithbalancesbalances.md +docs/models/shared/walletwithbalances.md +docs/models/shared/assetholder.md +docs/models/shared/activitygetpaymentoutput.md +docs/models/shared/paymentraw.md +docs/models/shared/paymentscheme.md +docs/models/shared/paymenttype.md +docs/models/shared/payment.md +docs/models/shared/paymentstatus.md +docs/models/shared/connector.md +docs/models/shared/paymentmetadata.md +docs/models/shared/paymentadjustmentraw.md +docs/models/shared/paymentadjustment.md +docs/models/shared/activitygetaccountoutput.md +docs/models/shared/orchestrationaccount.md +docs/models/shared/activitydebitwalletoutput.md +docs/models/shared/hold.md +docs/models/shared/subject.md +docs/models/shared/ledgeraccountsubject.md +docs/models/shared/walletsubject.md +docs/models/shared/activitycreatetransactionoutput.md +docs/models/shared/orchestrationtransaction.md +docs/models/shared/workflowinstancehistorystageinput.md +docs/models/shared/activityvoidhold.md +docs/models/shared/activitystripetransfermetadata.md +docs/models/shared/activitystripetransfer.md +docs/models/shared/activitygetwallet.md +docs/models/shared/activitygetpayment.md +docs/models/shared/activitygetaccount.md +docs/models/shared/activitydebitwallet.md +docs/models/shared/debitwalletrequest.md +docs/models/shared/activitycreditwallet.md +docs/models/shared/creditwalletrequest.md +docs/models/shared/activitycreatetransaction.md +docs/models/shared/orchestrationposttransactionscript.md +docs/models/shared/orchestrationposttransaction.md +docs/models/shared/activityconfirmhold.md +docs/models/shared/getworkflowresponse.md +docs/models/shared/listrunsresponse.md +docs/models/shared/listtriggersresponse.md +docs/models/shared/listtriggersoccurrencesresponse.md +docs/models/shared/triggeroccurrence.md +docs/models/shared/listworkflowsresponse.md +docs/models/shared/readtriggerresponse.md +docs/models/shared/runworkflowresponse.md +docs/models/shared/v2errorerrorcode.md +docs/models/shared/v2error.md +docs/models/shared/v2createtriggerresponse.md +docs/models/shared/v2trigger.md +docs/models/shared/v2triggerdata.md +docs/models/shared/v2createworkflowresponse.md +docs/models/shared/v2workflow.md +docs/models/shared/v2workflowconfig.md +docs/models/shared/v2createworkflowrequest.md +docs/models/shared/v2getworkflowinstanceresponse.md +docs/models/shared/v2workflowinstance.md +docs/models/shared/v2stagestatus.md +docs/models/shared/v2getworkflowinstancehistoryresponse.md +docs/models/shared/v2workflowinstancehistory.md +docs/models/shared/v2stage.md +docs/models/shared/v2stagesend.md +docs/models/shared/v2stagesendsource.md +docs/models/shared/v2stagesendsourcewallet.md +docs/models/shared/v2stagesendsourcepayment.md +docs/models/shared/v2stagesendsourceaccount.md +docs/models/shared/v2stagesenddestination.md +docs/models/shared/v2stagesenddestinationwallet.md +docs/models/shared/v2stagesenddestinationpayment.md +docs/models/shared/v2stagesenddestinationaccount.md +docs/models/shared/v2monetary.md +docs/models/shared/v2stagedelay.md +docs/models/shared/v2stagewaitevent.md +docs/models/shared/v2getworkflowinstancehistorystageresponse.md +docs/models/shared/v2workflowinstancehistorystage.md +docs/models/shared/v2workflowinstancehistorystageoutput.md +docs/models/shared/v2activitygetwalletoutput.md +docs/models/shared/v2walletwithbalancesbalances.md +docs/models/shared/v2walletwithbalances.md +docs/models/shared/v2assetholder.md +docs/models/shared/v2activitygetpaymentoutput.md +docs/models/shared/v2paymentraw.md +docs/models/shared/v2paymentscheme.md +docs/models/shared/v2paymenttype.md +docs/models/shared/v2payment.md +docs/models/shared/v2paymentstatus.md +docs/models/shared/v2connector.md +docs/models/shared/v2paymentmetadata.md +docs/models/shared/v2paymentadjustmentraw.md +docs/models/shared/v2paymentadjustment.md +docs/models/shared/v2activitygetaccountoutput.md +docs/models/shared/v2activitydebitwalletoutput.md +docs/models/shared/v2hold.md +docs/models/shared/v2subject.md +docs/models/shared/v2ledgeraccountsubject.md +docs/models/shared/v2walletsubject.md +docs/models/shared/v2activitycreatetransactionoutput.md +docs/models/shared/v2workflowinstancehistorystageinput.md +docs/models/shared/v2activityvoidhold.md +docs/models/shared/v2activitystripetransfermetadata.md +docs/models/shared/v2activitystripetransfer.md +docs/models/shared/v2activitygetwallet.md +docs/models/shared/v2activitygetpayment.md +docs/models/shared/v2activitygetaccount.md +docs/models/shared/v2activitydebitwallet.md +docs/models/shared/v2debitwalletrequest.md +docs/models/shared/v2activitycreditwallet.md +docs/models/shared/v2creditwalletrequest.md +docs/models/shared/v2activitycreatetransaction.md +docs/models/shared/v2activityconfirmhold.md +docs/models/shared/v2serverinfo.md +docs/models/shared/v2getworkflowresponse.md +docs/models/shared/v2listrunsresponsecursor.md +docs/models/shared/v2listrunsresponse.md +docs/models/shared/v2listtriggersresponsecursor.md +docs/models/shared/v2listtriggersresponse.md +docs/models/shared/v2listtriggersoccurrencesresponsecursor.md +docs/models/shared/v2listtriggersoccurrencesresponse.md +docs/models/shared/v2triggeroccurrence.md +docs/models/shared/v2listworkflowsresponsecursor.md +docs/models/shared/v2listworkflowsresponse.md +docs/models/shared/v2readtriggerresponse.md +docs/models/shared/v2runworkflowresponse.md +docs/models/shared/reconciliationerrorresponse.md +docs/models/shared/policyresponse.md +docs/models/shared/policy.md +docs/models/shared/policyrequest.md +docs/models/shared/reconciliationresponse.md +docs/models/shared/reconciliation.md +docs/models/shared/policiescursorresponsecursor.md +docs/models/shared/policiescursorresponse.md +docs/models/shared/reconciliationscursorresponsecursor.md +docs/models/shared/reconciliationscursorresponse.md +docs/models/shared/reconciliationrequest.md +docs/models/shared/responsecursortotal.md +docs/models/shared/responsecursor.md +docs/models/shared/response.md +docs/models/shared/queryraw.md +docs/models/shared/query.md +docs/models/shared/walletserrorresponseerrorcode.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/debitwalletresponse.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/getwalletsummaryresponse.md +docs/models/shared/listbalancesresponsecursor.md +docs/models/shared/listbalancesresponse.md +docs/models/shared/listwalletsresponsecursor.md +docs/models/shared/listwalletsresponse.md +docs/models/shared/webhookserrorresponse.md +docs/models/shared/webhookserrorsenum.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/getversionsresponse.md +docs/models/shared/version.md +docs/sdks/formance/README.md +docs/sdks/auth/README.md +docs/sdks/ledger/README.md +docs/sdks/orchestration/README.md +docs/sdks/reconciliation/README.md +docs/sdks/search/README.md +docs/sdks/wallets/README.md +docs/sdks/webhooks/README.md +.gitattributes \ No newline at end of file diff --git a/flows.go b/flows.go deleted file mode 100755 index 3f245951..00000000 --- a/flows.go +++ /dev/null @@ -1,742 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package formance - -import ( - "context" - "fmt" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "github.com/formancehq/formance-sdk-go/pkg/utils" - "net/http" - "strings" -) - -type flows struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string -} - -func newFlows(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *flows { - return &flows{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, - } -} - -// CancelEvent - Cancel a running workflow -// Cancel a running workflow -func (s *flows) CancelEvent(ctx context.Context, request operations.CancelEventRequest) (*operations.CancelEventResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/abort", 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.CancelEventResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// CreateWorkflow - Create workflow -// Create a workflow -func (s *flows) CreateWorkflow(ctx context.Context, request shared.CreateWorkflowRequest) (*operations.CreateWorkflowResponse, error) { - baseURL := s.serverURL - url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/workflows" - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.CreateWorkflowResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.CreateWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.CreateWorkflowResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// DeleteWorkflow - Delete a flow by id -// Delete a flow by id -func (s *flows) DeleteWorkflow(ctx context.Context, request operations.DeleteWorkflowRequest) (*operations.DeleteWorkflowResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{flowId}", 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", "application/json") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.DeleteWorkflowResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// GetInstance - Get a workflow instance by id -// Get a workflow instance by id -func (s *flows) GetInstance(ctx context.Context, request operations.GetInstanceRequest) (*operations.GetInstanceResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}", 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetInstanceResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowInstanceResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.GetWorkflowInstanceResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// GetInstanceHistory - Get a workflow instance history by id -// Get a workflow instance history by id -func (s *flows) GetInstanceHistory(ctx context.Context, request operations.GetInstanceHistoryRequest) (*operations.GetInstanceHistoryResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/history", 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetInstanceHistoryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowInstanceHistoryResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.GetWorkflowInstanceHistoryResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// GetInstanceStageHistory - Get a workflow instance stage history -// Get a workflow instance stage history -func (s *flows) GetInstanceStageHistory(ctx context.Context, request operations.GetInstanceStageHistoryRequest) (*operations.GetInstanceStageHistoryResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/stages/{number}/history", 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetInstanceStageHistoryResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowInstanceHistoryStageResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.GetWorkflowInstanceHistoryStageResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// GetWorkflow - Get a flow by id -// Get a flow by id -func (s *flows) GetWorkflow(ctx context.Context, request operations.GetWorkflowRequest) (*operations.GetWorkflowResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetWorkflowResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.GetWorkflowResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// ListInstances - List instances of a workflow -// List instances of a workflow -func (s *flows) ListInstances(ctx context.Context, request operations.ListInstancesRequest) (*operations.ListInstancesResponse, error) { - baseURL := s.serverURL - url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/instances" - - 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListInstancesResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListRunsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ListRunsResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// ListWorkflows - List registered workflows -// List registered workflows -func (s *flows) ListWorkflows(ctx context.Context) (*operations.ListWorkflowsResponse, error) { - baseURL := s.serverURL - url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/workflows" - - 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListWorkflowsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ListWorkflowsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ListWorkflowsResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// OrchestrationgetServerInfo - Get server info -func (s *flows) OrchestrationgetServerInfo(ctx context.Context) (*operations.OrchestrationgetServerInfoResponse, error) { - baseURL := s.serverURL - 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.OrchestrationgetServerInfoResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ServerInfo = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// RunWorkflow - Run workflow -// Run workflow -func (s *flows) RunWorkflow(ctx context.Context, request operations.RunWorkflowRequest) (*operations.RunWorkflowResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{workflowID}/instances", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.RunWorkflowResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.RunWorkflowResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.RunWorkflowResponse = out - } - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} - -// SendEvent - Send an event to a running workflow -// Send an event to a running workflow -func (s *flows) SendEvent(ctx context.Context, request operations.SendEventRequest) (*operations.SendEventResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/events", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.SendEventResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - default: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.Error - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.Error = out - } - } - - return res, nil -} diff --git a/formance.go b/formance.go index bcfa8881..1d111285 100755 --- a/formance.go +++ b/formance.go @@ -1,13 +1,16 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" "time" @@ -17,8 +20,6 @@ import ( 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 @@ -44,7 +45,29 @@ 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 } -// Formance - Open, modular foundation for unique payments flows +type sdkConfiguration struct { + DefaultClient HTTPClient + SecurityClient HTTPClient + + ServerURL string + ServerIndex int + Language string + OpenAPIDocVersion string + SDKVersion string + GenVersion string + UserAgent string + RetryConfig *utils.RetryConfig +} + +func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { + if c.ServerURL != "" { + return c.ServerURL, nil + } + + return ServerList[c.ServerIndex], nil +} + +// Formance Stack API: Open, modular foundation for unique payments flows // // # Introduction // This API is documented in **OpenAPI format**. @@ -57,22 +80,15 @@ func Float64(f float64) *float64 { return &f } // and standard method from web, mobile and desktop applications. // type Formance struct { - Auth *auth - Flows *flows - Ledger *ledger - Payments *payments - Search *search - 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 + Auth *auth + Ledger *ledger + Orchestration *orchestration + Reconciliation *reconciliation + Search *search + Wallets *wallets + Webhooks *webhooks + + sdkConfiguration sdkConfiguration } type SDKOption func(*Formance) @@ -80,7 +96,7 @@ 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 } } @@ -91,120 +107,77 @@ func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOptio 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 } } // 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 { +func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption { return func(sdk *Formance) { - sdk._security = &security + 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: "v1.0.20230915", - _genVersion: "2.31.0", + sdkConfiguration: sdkConfiguration{ + Language: "go", + OpenAPIDocVersion: "v2.0.0-beta.1", + SDKVersion: "", + GenVersion: "2.173.0", + UserAgent: "speakeasy-sdk/go 2.173.0 v2.0.0-beta.1 github.com/formancehq/formance-sdk-go", + }, } 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._securityClient == nil { - if sdk._security != nil { - sdk._securityClient = utils.ConfigureSecurityClient(sdk._defaultClient, sdk._security) - } else { - sdk._securityClient = sdk._defaultClient - } + if sdk.sdkConfiguration.DefaultClient == nil { + sdk.sdkConfiguration.DefaultClient = &http.Client{Timeout: 60 * time.Second} + } + if sdk.sdkConfiguration.SecurityClient == nil { + sdk.sdkConfiguration.SecurityClient = sdk.sdkConfiguration.DefaultClient } - if sdk._serverURL == "" { - sdk._serverURL = ServerList[0] - } - - sdk.Auth = newAuth( - sdk._defaultClient, - sdk._securityClient, - sdk._serverURL, - sdk._language, - sdk._sdkVersion, - sdk._genVersion, - ) - - sdk.Flows = newFlows( - 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.Payments = newPayments( - 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.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.Auth = newAuth(sdk.sdkConfiguration) + + sdk.Ledger = newLedger(sdk.sdkConfiguration) + + sdk.Orchestration = newOrchestration(sdk.sdkConfiguration) + + sdk.Reconciliation = newReconciliation(sdk.sdkConfiguration) + + sdk.Search = newSearch(sdk.sdkConfiguration) + + sdk.Wallets = newWallets(sdk.sdkConfiguration) + + sdk.Webhooks = newWebhooks(sdk.sdkConfiguration) return sdk } // GetVersions - Show stack version information func (s *Formance) GetVersions(ctx context.Context) (*operations.GetVersionsResponse, error) { - baseURL := s._serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/versions" req, err := http.NewRequestWithContext(ctx, "GET", url, nil) @@ -212,9 +185,9 @@ func (s *Formance) GetVersions(ctx context.Context) (*operations.GetVersionsResp 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._language, s._sdkVersion, s._genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s._securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -223,7 +196,6 @@ func (s *Formance) GetVersions(ctx context.Context) (*operations.GetVersionsResp if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -232,18 +204,69 @@ func (s *Formance) GetVersions(ctx context.Context) (*operations.GetVersionsResp 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetVersionsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetVersionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetVersionsResponse = out + res.GetVersionsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } return res, nil } + +func (s *Formance) GetAPIAuthWellKnownOpenidConfiguration(ctx context.Context) (*operations.GetAPIAuthWellKnownOpenidConfigurationResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/auth/.well-known/openid-configuration" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetAPIAuthWellKnownOpenidConfigurationResponse{ + StatusCode: httpRes.StatusCode, + 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: + } + + return res, nil +} diff --git a/gen.yaml b/gen.yaml index eaff4797..1521405d 100755 --- a/gen.yaml +++ b/gen.yaml @@ -4,16 +4,18 @@ generation: singleTagPerOp: true telemetryEnabled: false features: - version: "" go: - core: 2.86.4 + constsAndDefaults: 0.1.1 + core: 2.94.0 deprecations: 2.81.1 - globalSecurity: 2.81.1 + errors: 2.81.7 + getRequestBodies: 2.81.1 globalServerURLs: 2.82.0 ignores: 2.81.1 - unions: 2.81.2 + unions: 2.84.1 go: - version: v1.0.20230915 + version: "" author: Formance + flattenGlobalSecurity: false maxMethodParams: 0 packageName: github.com/formancehq/formance-sdk-go diff --git a/go.mod b/go.mod index 3704ddc7..2d250056 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 2307997a..ae03a472 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 4e7b55a1..139febab 100755 --- a/ledger.go +++ b/ledger.go @@ -1,46 +1,39 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" ) 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, } } // CreateTransactions - Create a new batch of transactions to a ledger func (s *ledger) CreateTransactions(ctx context.Context, request operations.CreateTransactionsRequest) (*operations.CreateTransactionsResponse, error) { - baseURL := s.serverURL + 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) } @@ -52,12 +45,12 @@ func (s *ledger) CreateTransactions(ctx context.Context, request operations.Crea if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -66,7 +59,6 @@ func (s *ledger) CreateTransactions(ctx context.Context, request operations.Crea if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -75,26 +67,37 @@ func (s *ledger) CreateTransactions(ctx context.Context, request operations.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 == 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) } } @@ -103,13 +106,13 @@ func (s *ledger) CreateTransactions(ctx context.Context, request operations.Crea // AddMetadataOnTransaction - Set the metadata of a transaction by its ID func (s *ledger) AddMetadataOnTransaction(ctx context.Context, request operations.AddMetadataOnTransactionRequest) (*operations.AddMetadataOnTransactionResponse, error) { - baseURL := s.serverURL + 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) } @@ -119,11 +122,11 @@ func (s *ledger) AddMetadataOnTransaction(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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -132,7 +135,6 @@ func (s *ledger) AddMetadataOnTransaction(ctx context.Context, request operation if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -141,17 +143,26 @@ func (s *ledger) AddMetadataOnTransaction(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 == 204: 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) } } @@ -160,13 +171,13 @@ func (s *ledger) AddMetadataOnTransaction(ctx context.Context, request operation // AddMetadataToAccount - Add metadata to an account func (s *ledger) AddMetadataToAccount(ctx context.Context, request operations.AddMetadataToAccountRequest) (*operations.AddMetadataToAccountResponse, error) { - baseURL := s.serverURL + 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) } @@ -179,11 +190,11 @@ func (s *ledger) AddMetadataToAccount(ctx context.Context, request operations.Ad 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -192,7 +203,6 @@ func (s *ledger) AddMetadataToAccount(ctx context.Context, request operations.Ad if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -201,17 +211,30 @@ func (s *ledger) AddMetadataToAccount(ctx context.Context, request operations.Ad 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: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough 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) } } @@ -220,7 +243,7 @@ func (s *ledger) AddMetadataToAccount(ctx context.Context, request operations.Ad // CountAccounts - Count the accounts from a ledger func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAccountsRequest) (*operations.CountAccountsResponse, error) { - baseURL := s.serverURL + 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) @@ -231,13 +254,13 @@ func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAcco 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.language, s.sdkVersion, s.genVersion)) + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -246,7 +269,6 @@ func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAcco if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -255,6 +277,13 @@ func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAcco 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 @@ -262,12 +291,14 @@ func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAcco 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) } } @@ -276,7 +307,7 @@ func (s *ledger) CountAccounts(ctx context.Context, request operations.CountAcco // CountTransactions - Count the transactions from a ledger func (s *ledger) CountTransactions(ctx context.Context, request operations.CountTransactionsRequest) (*operations.CountTransactionsResponse, error) { - baseURL := s.serverURL + 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) @@ -287,13 +318,13 @@ func (s *ledger) CountTransactions(ctx context.Context, request operations.Count 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.language, s.sdkVersion, s.genVersion)) + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -302,7 +333,6 @@ func (s *ledger) CountTransactions(ctx context.Context, request operations.Count if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -311,6 +341,13 @@ func (s *ledger) CountTransactions(ctx context.Context, request operations.Count 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 @@ -318,12 +355,14 @@ func (s *ledger) CountTransactions(ctx context.Context, request operations.Count 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) } } @@ -332,13 +371,13 @@ func (s *ledger) CountTransactions(ctx context.Context, request operations.Count // CreateTransaction - Create a new transaction to a ledger func (s *ledger) CreateTransaction(ctx context.Context, request operations.CreateTransactionRequest) (*operations.CreateTransactionResponse, error) { - baseURL := s.serverURL + 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) } @@ -350,8 +389,8 @@ func (s *ledger) CreateTransaction(ctx context.Context, request operations.Creat if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -359,7 +398,7 @@ func (s *ledger) CreateTransaction(ctx context.Context, request operations.Creat return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -368,7 +407,6 @@ func (s *ledger) CreateTransaction(ctx context.Context, request operations.Creat if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -377,26 +415,39 @@ func (s *ledger) CreateTransaction(ctx context.Context, request operations.Creat 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 { 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) } + case httpRes.StatusCode == 400: + fallthrough 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) } } @@ -405,7 +456,7 @@ func (s *ledger) CreateTransaction(ctx context.Context, request operations.Creat // GetAccount - Get account by its address func (s *ledger) GetAccount(ctx context.Context, request operations.GetAccountRequest) (*operations.GetAccountResponse, error) { - baseURL := s.serverURL + 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) @@ -415,10 +466,10 @@ func (s *ledger) GetAccount(ctx context.Context, request operations.GetAccountRe if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -427,7 +478,6 @@ func (s *ledger) GetAccount(ctx context.Context, request operations.GetAccountRe if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -436,26 +486,37 @@ func (s *ledger) GetAccount(ctx context.Context, request operations.GetAccountRe 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 { 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) } } @@ -464,7 +525,7 @@ func (s *ledger) GetAccount(ctx context.Context, request operations.GetAccountRe // GetBalances - Get the balances from a ledger's account func (s *ledger) GetBalances(ctx context.Context, request operations.GetBalancesRequest) (*operations.GetBalancesResponse, error) { - baseURL := s.serverURL + 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) @@ -474,14 +535,14 @@ func (s *ledger) GetBalances(ctx context.Context, request operations.GetBalances if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -490,7 +551,6 @@ func (s *ledger) GetBalances(ctx context.Context, request operations.GetBalances if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -499,26 +559,37 @@ func (s *ledger) GetBalances(ctx context.Context, request operations.GetBalances 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 { 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) } } @@ -527,7 +598,7 @@ func (s *ledger) GetBalances(ctx context.Context, request operations.GetBalances // GetBalancesAggregated - Get the aggregated balances from selected accounts func (s *ledger) GetBalancesAggregated(ctx context.Context, request operations.GetBalancesAggregatedRequest) (*operations.GetBalancesAggregatedResponse, error) { - baseURL := s.serverURL + 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) @@ -537,14 +608,14 @@ func (s *ledger) GetBalancesAggregated(ctx context.Context, request operations.G if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -553,7 +624,6 @@ func (s *ledger) GetBalancesAggregated(ctx context.Context, request operations.G if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -562,26 +632,37 @@ func (s *ledger) GetBalancesAggregated(ctx context.Context, request operations.G 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 { 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) } } @@ -590,17 +671,17 @@ func (s *ledger) GetBalancesAggregated(ctx context.Context, request operations.G // GetInfo - Show server information func (s *ledger) 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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -609,7 +690,6 @@ func (s *ledger) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -618,26 +698,37 @@ func (s *ledger) 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 { 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) } } @@ -646,7 +737,7 @@ func (s *ledger) GetInfo(ctx context.Context) (*operations.GetInfoResponse, erro // GetLedgerInfo - Get information about a ledger func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedgerInfoRequest) (*operations.GetLedgerInfoResponse, error) { - baseURL := s.serverURL + 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) @@ -656,10 +747,10 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -668,7 +759,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -677,26 +767,37 @@ 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.LedgerInfoResponse - 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) } } @@ -705,7 +806,7 @@ func (s *ledger) GetLedgerInfo(ctx context.Context, request operations.GetLedger // GetMapping - Get the mapping of a ledger func (s *ledger) GetMapping(ctx context.Context, request operations.GetMappingRequest) (*operations.GetMappingResponse, error) { - baseURL := s.serverURL + 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) @@ -715,10 +816,10 @@ func (s *ledger) GetMapping(ctx context.Context, request operations.GetMappingRe if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -727,7 +828,6 @@ func (s *ledger) GetMapping(ctx context.Context, request operations.GetMappingRe if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -736,26 +836,37 @@ func (s *ledger) GetMapping(ctx context.Context, request operations.GetMappingRe 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 { 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) } } @@ -764,7 +875,7 @@ func (s *ledger) GetMapping(ctx context.Context, request operations.GetMappingRe // GetTransaction - Get transaction from a ledger by its ID func (s *ledger) GetTransaction(ctx context.Context, request operations.GetTransactionRequest) (*operations.GetTransactionResponse, error) { - baseURL := s.serverURL + 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) @@ -774,10 +885,10 @@ func (s *ledger) GetTransaction(ctx context.Context, request operations.GetTrans if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -786,7 +897,6 @@ func (s *ledger) GetTransaction(ctx context.Context, request operations.GetTrans if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -795,26 +905,37 @@ func (s *ledger) GetTransaction(ctx context.Context, request operations.GetTrans 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 { 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) } } @@ -824,7 +945,7 @@ func (s *ledger) GetTransaction(ctx context.Context, request operations.GetTrans // ListAccounts - List accounts from a ledger // List accounts from a ledger, sorted by address in descending order. func (s *ledger) ListAccounts(ctx context.Context, request operations.ListAccountsRequest) (*operations.ListAccountsResponse, error) { - baseURL := s.serverURL + 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) @@ -834,14 +955,14 @@ func (s *ledger) ListAccounts(ctx context.Context, request operations.ListAccoun if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -850,7 +971,6 @@ func (s *ledger) ListAccounts(ctx context.Context, request operations.ListAccoun if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -859,26 +979,37 @@ func (s *ledger) ListAccounts(ctx context.Context, request operations.ListAccoun 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 { 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) } } @@ -888,7 +1019,7 @@ func (s *ledger) ListAccounts(ctx context.Context, request operations.ListAccoun // ListLogs - List the logs from a ledger // List the logs from a ledger, sorted by ID in descending order. func (s *ledger) ListLogs(ctx context.Context, request operations.ListLogsRequest) (*operations.ListLogsResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/{ledger}/logs", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -898,14 +1029,14 @@ func (s *ledger) ListLogs(ctx context.Context, request operations.ListLogsReques if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -914,7 +1045,6 @@ func (s *ledger) ListLogs(ctx context.Context, request operations.ListLogsReques if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -923,26 +1053,37 @@ func (s *ledger) ListLogs(ctx context.Context, request operations.ListLogsReques 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 { 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) } } @@ -952,7 +1093,7 @@ func (s *ledger) ListLogs(ctx context.Context, request operations.ListLogsReques // ListTransactions - List transactions from a ledger // List transactions from a ledger, sorted by txid in descending order. func (s *ledger) ListTransactions(ctx context.Context, request operations.ListTransactionsRequest) (*operations.ListTransactionsResponse, error) { - baseURL := s.serverURL + 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) @@ -962,14 +1103,14 @@ func (s *ledger) ListTransactions(ctx context.Context, request operations.ListTr if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -978,7 +1119,6 @@ func (s *ledger) ListTransactions(ctx context.Context, request operations.ListTr if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -987,26 +1127,37 @@ func (s *ledger) ListTransactions(ctx context.Context, request operations.ListTr 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 { 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) } } @@ -1016,7 +1167,7 @@ func (s *ledger) ListTransactions(ctx context.Context, request operations.ListTr // ReadStats - Get statistics from a ledger // Get statistics from a ledger. (aggregate metrics on accounts and transactions) func (s *ledger) ReadStats(ctx context.Context, request operations.ReadStatsRequest) (*operations.ReadStatsResponse, error) { - baseURL := s.serverURL + 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) @@ -1026,10 +1177,10 @@ func (s *ledger) ReadStats(ctx context.Context, request operations.ReadStatsRequ if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -1038,7 +1189,6 @@ func (s *ledger) ReadStats(ctx context.Context, request operations.ReadStatsRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -1047,26 +1197,37 @@ func (s *ledger) ReadStats(ctx context.Context, request operations.ReadStatsRequ 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 { 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) } } @@ -1075,7 +1236,7 @@ func (s *ledger) ReadStats(ctx context.Context, request operations.ReadStatsRequ // RevertTransaction - Revert a ledger transaction by its ID func (s *ledger) RevertTransaction(ctx context.Context, request operations.RevertTransactionRequest) (*operations.RevertTransactionResponse, error) { - baseURL := s.serverURL + 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) @@ -1085,14 +1246,14 @@ func (s *ledger) RevertTransaction(ctx context.Context, request operations.Rever if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -1101,7 +1262,6 @@ func (s *ledger) RevertTransaction(ctx context.Context, request operations.Rever if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -1110,26 +1270,37 @@ func (s *ledger) RevertTransaction(ctx context.Context, request operations.Rever 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 { 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) } } @@ -1139,15 +1310,15 @@ func (s *ledger) RevertTransaction(ctx context.Context, request operations.Rever // RunScript - Execute a Numscript // This route is deprecated, and has been merged into `POST /{ledger}/transactions`. // -// Deprecated: this method will be removed in a future release, please migrate away from it as soon as possible. +// Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. func (s *ledger) RunScript(ctx context.Context, request operations.RunScriptRequest) (*operations.RunScriptResponse, error) { - baseURL := s.serverURL + 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) } @@ -1160,7 +1331,7 @@ func (s *ledger) 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) @@ -1168,7 +1339,7 @@ func (s *ledger) RunScript(ctx context.Context, request operations.RunScriptRequ return nil, fmt.Errorf("error populating query params: %w", err) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -1177,7 +1348,6 @@ func (s *ledger) RunScript(ctx context.Context, request operations.RunScriptRequ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -1186,16 +1356,25 @@ func (s *ledger) 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 { 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) } } @@ -1204,13 +1383,13 @@ func (s *ledger) RunScript(ctx context.Context, request operations.RunScriptRequ // UpdateMapping - Update the mapping of a ledger func (s *ledger) UpdateMapping(ctx context.Context, request operations.UpdateMappingRequest) (*operations.UpdateMappingResponse, error) { - baseURL := s.serverURL + 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) } @@ -1222,12 +1401,12 @@ func (s *ledger) UpdateMapping(ctx context.Context, request operations.UpdateMap if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -1236,7 +1415,6 @@ func (s *ledger) UpdateMapping(ctx context.Context, request operations.UpdateMap if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -1245,26 +1423,1570 @@ func (s *ledger) UpdateMapping(ctx context.Context, request operations.UpdateMap 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 { 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 + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2AddMetadataOnTransaction - Set the metadata of a transaction by its ID +func (s *ledger) V2AddMetadataOnTransaction(ctx context.Context, request operations.V2AddMetadataOnTransactionRequest) (*operations.V2AddMetadataOnTransactionResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions/{id}/metadata", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + utils.PopulateHeaders(ctx, req, request) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2AddMetadataOnTransactionResponse{ + StatusCode: httpRes.StatusCode, + 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: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2AddMetadataToAccount - Add metadata to an account +func (s *ledger) V2AddMetadataToAccount(ctx context.Context, request operations.V2AddMetadataToAccountRequest) (*operations.V2AddMetadataToAccountResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{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, false, false, "RequestBody", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + if bodyReader == nil { + return nil, fmt.Errorf("request body is required") + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + utils.PopulateHeaders(ctx, req, request) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2AddMetadataToAccountResponse{ + StatusCode: httpRes.StatusCode, + 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: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CountAccounts - Count the accounts from a ledger +func (s *ledger) V2CountAccounts(ctx context.Context, request operations.V2CountAccountsRequest) (*operations.V2CountAccountsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/accounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "HEAD", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CountAccountsResponse{ + StatusCode: httpRes.StatusCode, + 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: + res.Headers = httpRes.Header + + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CountTransactions - Count the transactions from a ledger +func (s *ledger) V2CountTransactions(ctx context.Context, request operations.V2CountTransactionsRequest) (*operations.V2CountTransactionsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "HEAD", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CountTransactionsResponse{ + StatusCode: httpRes.StatusCode, + 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: + res.Headers = httpRes.Header + + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CreateBulk - Bulk request +func (s *ledger) V2CreateBulk(ctx context.Context, request operations.V2CreateBulkRequest) (*operations.V2CreateBulkResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/_bulk", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CreateBulkResponse{ + StatusCode: httpRes.StatusCode, + 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: + fallthrough + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2BulkResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2BulkResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CreateLedger - Create a ledger +func (s *ledger) V2CreateLedger(ctx context.Context, request operations.V2CreateLedgerRequest) (*operations.V2CreateLedgerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "V2CreateLedgerRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CreateLedgerResponse{ + StatusCode: httpRes.StatusCode, + 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: + case httpRes.StatusCode == 400: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CreateTransaction - Create a new transaction to a ledger +func (s *ledger) V2CreateTransaction(ctx context.Context, request operations.V2CreateTransactionRequest) (*operations.V2CreateTransactionResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "V2PostTransaction", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + if bodyReader == nil { + return nil, fmt.Errorf("request body is required") + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + utils.PopulateHeaders(ctx, req, request) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CreateTransactionResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2CreateTransactionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2CreateTransactionResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2DeleteAccountMetadata - Delete metadata by key +// Delete metadata by key +func (s *ledger) V2DeleteAccountMetadata(ctx context.Context, request operations.V2DeleteAccountMetadataRequest) (*operations.V2DeleteAccountMetadataResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2DeleteAccountMetadataResponse{ + StatusCode: httpRes.StatusCode, + 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 && httpRes.StatusCode < 300: + } + + return res, nil +} + +// V2DeleteTransactionMetadata - Delete metadata by key +// Delete metadata by key +func (s *ledger) V2DeleteTransactionMetadata(ctx context.Context, request operations.V2DeleteTransactionMetadataRequest) (*operations.V2DeleteTransactionMetadataResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2DeleteTransactionMetadataResponse{ + StatusCode: httpRes.StatusCode, + 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 && httpRes.StatusCode < 300: + case httpRes.StatusCode == 400: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetAccount - Get account by its address +func (s *ledger) V2GetAccount(ctx context.Context, request operations.V2GetAccountRequest) (*operations.V2GetAccountResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetAccountResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2AccountResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2AccountResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetBalancesAggregated - Get the aggregated balances from selected accounts +func (s *ledger) V2GetBalancesAggregated(ctx context.Context, request operations.V2GetBalancesAggregatedRequest) (*operations.V2GetBalancesAggregatedResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/aggregate/balances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetBalancesAggregatedResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2AggregateBalancesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2AggregateBalancesResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetInfo - Show server information +func (s *ledger) V2GetInfo(ctx context.Context) (*operations.V2GetInfoResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/ledger/v2/_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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetInfoResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ConfigInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ConfigInfoResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetLedger - Get a ledger +func (s *ledger) V2GetLedger(ctx context.Context, request operations.V2GetLedgerRequest) (*operations.V2GetLedgerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetLedgerResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2Ledger + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Ledger = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetLedgerInfo - Get information about a ledger +func (s *ledger) V2GetLedgerInfo(ctx context.Context, request operations.V2GetLedgerInfoRequest) (*operations.V2GetLedgerInfoResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetLedgerInfoResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2LedgerInfoResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2LedgerInfoResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetTransaction - Get transaction from a ledger by its ID +func (s *ledger) V2GetTransaction(ctx context.Context, request operations.V2GetTransactionRequest) (*operations.V2GetTransactionResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions/{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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetTransactionResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2GetTransactionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2GetTransactionResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListAccounts - List accounts from a ledger +// List accounts from a ledger, sorted by address in descending order. +func (s *ledger) V2ListAccounts(ctx context.Context, request operations.V2ListAccountsRequest) (*operations.V2ListAccountsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/accounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListAccountsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2AccountsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2AccountsCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListLedgers - List ledgers +func (s *ledger) V2ListLedgers(ctx context.Context, request operations.V2ListLedgersRequest) (*operations.V2ListLedgersResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/ledger/v2" + + 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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListLedgersResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2LedgerListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2LedgerListResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListLogs - List the logs from a ledger +// List the logs from a ledger, sorted by ID in descending order. +func (s *ledger) V2ListLogs(ctx context.Context, request operations.V2ListLogsRequest) (*operations.V2ListLogsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/logs", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListLogsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2LogsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2LogsCursorResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListTransactions - List transactions from a ledger +// List transactions from a ledger, sorted by id in descending order. +func (s *ledger) V2ListTransactions(ctx context.Context, request operations.V2ListTransactionsRequest) (*operations.V2ListTransactionsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListTransactionsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2TransactionsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2TransactionsCursorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ReadStats - Get statistics from a ledger +// Get statistics from a ledger. (aggregate metrics on accounts and transactions) +func (s *ledger) V2ReadStats(ctx context.Context, request operations.V2ReadStatsRequest) (*operations.V2ReadStatsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ReadStatsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2StatsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2StatsResponse = &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.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2RevertTransaction - Revert a ledger transaction by its ID +func (s *ledger) V2RevertTransaction(ctx context.Context, request operations.V2RevertTransactionRequest) (*operations.V2RevertTransactionResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/ledger/v2/{ledger}/transactions/{id}/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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2RevertTransactionResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2RevertTransactionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.MappingResponse = out + res.V2RevertTransactionResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } + case httpRes.StatusCode == 400: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.V2ErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorResponse = out + res.V2ErrorResponse = &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 new file mode 100755 index 00000000..259a0712 --- /dev/null +++ b/orchestration.go @@ -0,0 +1,2358 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" + "net/http" + "strings" +) + +type orchestration struct { + sdkConfiguration sdkConfiguration +} + +func newOrchestration(sdkConfig sdkConfiguration) *orchestration { + return &orchestration{ + sdkConfiguration: sdkConfig, + } +} + +// CancelEvent - Cancel a running workflow +// Cancel a running workflow +func (s *orchestration) CancelEvent(ctx context.Context, request operations.CancelEventRequest) (*operations.CancelEventResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/abort", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CancelEventResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// CreateTrigger - Create trigger +// Create trigger +func (s *orchestration) CreateTrigger(ctx context.Context, request *shared.TriggerData) (*operations.CreateTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/triggers" + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.CreateTriggerResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.CreateTriggerResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// CreateWorkflow - Create workflow +// Create a workflow +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/workflows" + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.CreateWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// DeleteTrigger - Delete trigger +// Read trigger +func (s *orchestration) DeleteTrigger(ctx context.Context, request operations.DeleteTriggerRequest) (*operations.DeleteTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/triggers/{triggerID}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.DeleteTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// DeleteWorkflow - Delete a flow by id +// Delete a flow by id +func (s *orchestration) DeleteWorkflow(ctx context.Context, request operations.DeleteWorkflowRequest) (*operations.DeleteWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{flowId}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.DeleteWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetInstance - Get a workflow instance by id +// Get a workflow instance by id +func (s *orchestration) GetInstance(ctx context.Context, request operations.GetInstanceRequest) (*operations.GetInstanceResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetInstanceResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.GetWorkflowInstanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetWorkflowInstanceResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetInstanceHistory - Get a workflow instance history by id +// Get a workflow instance history by id +func (s *orchestration) GetInstanceHistory(ctx context.Context, request operations.GetInstanceHistoryRequest) (*operations.GetInstanceHistoryResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/history", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetInstanceHistoryResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.GetWorkflowInstanceHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetWorkflowInstanceHistoryResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetInstanceStageHistory - Get a workflow instance stage history +// Get a workflow instance stage history +func (s *orchestration) GetInstanceStageHistory(ctx context.Context, request operations.GetInstanceStageHistoryRequest) (*operations.GetInstanceStageHistoryResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/stages/{number}/history", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetInstanceStageHistoryResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.GetWorkflowInstanceHistoryStageResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetWorkflowInstanceHistoryStageResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetWorkflow - Get a flow by id +// Get a flow by id +func (s *orchestration) GetWorkflow(ctx context.Context, request operations.GetWorkflowRequest) (*operations.GetWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.GetWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListInstances - List instances of a workflow +// List instances of a workflow +func (s *orchestration) ListInstances(ctx context.Context, request operations.ListInstancesRequest) (*operations.ListInstancesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/instances" + + 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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListInstancesResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ListRunsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListTriggers - List triggers +// List triggers +func (s *orchestration) ListTriggers(ctx context.Context) (*operations.ListTriggersResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/triggers" + + 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListTriggersResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ListTriggersResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ListTriggersResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListTriggersOccurrences - List triggers occurrences +// List triggers occurrences +func (s *orchestration) ListTriggersOccurrences(ctx context.Context, request operations.ListTriggersOccurrencesRequest) (*operations.ListTriggersOccurrencesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/triggers/{triggerID}/occurrences", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListTriggersOccurrencesResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ListTriggersOccurrencesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ListTriggersOccurrencesResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListWorkflows - List registered workflows +// List registered workflows +func (s *orchestration) ListWorkflows(ctx context.Context) (*operations.ListWorkflowsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/workflows" + + 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListWorkflowsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ListWorkflowsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// OrchestrationgetServerInfo - Get server info +func (s *orchestration) OrchestrationgetServerInfo(ctx context.Context) (*operations.OrchestrationgetServerInfoResponse, error) { + 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.OrchestrationgetServerInfoResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ReadTrigger - Read trigger +// Read trigger +func (s *orchestration) ReadTrigger(ctx context.Context, request operations.ReadTriggerRequest) (*operations.ReadTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/triggers/{triggerID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ReadTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ReadTriggerResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReadTriggerResponse = &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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// RunWorkflow - Run workflow +// Run workflow +func (s *orchestration) RunWorkflow(ctx context.Context, request operations.RunWorkflowRequest) (*operations.RunWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/workflows/{workflowID}/instances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.RunWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.RunWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// SendEvent - Send an event to a running workflow +// Send an event to a running workflow +func (s *orchestration) SendEvent(ctx context.Context, request operations.SendEventRequest) (*operations.SendEventResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/instances/{instanceID}/events", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.SendEventResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CancelEvent - Cancel a running workflow +// Cancel a running workflow +func (s *orchestration) V2CancelEvent(ctx context.Context, request operations.V2CancelEventRequest) (*operations.V2CancelEventResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/instances/{instanceID}/abort", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CancelEventResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CreateTrigger - Create trigger +// Create trigger +func (s *orchestration) V2CreateTrigger(ctx context.Context, request *shared.V2TriggerData) (*operations.V2CreateTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/triggers" + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CreateTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2CreateTriggerResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2CreateTriggerResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2CreateWorkflow - Create workflow +// Create a workflow +func (s *orchestration) V2CreateWorkflow(ctx context.Context, request *shared.V2CreateWorkflowRequest) (*operations.V2CreateWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/workflows" + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2CreateWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2CreateWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2CreateWorkflowResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2DeleteTrigger - Delete trigger +// Read trigger +func (s *orchestration) V2DeleteTrigger(ctx context.Context, request operations.V2DeleteTriggerRequest) (*operations.V2DeleteTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/triggers/{triggerID}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2DeleteTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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: + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2DeleteWorkflow - Delete a flow by id +// Delete a flow by id +func (s *orchestration) V2DeleteWorkflow(ctx context.Context, request operations.V2DeleteWorkflowRequest) (*operations.V2DeleteWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/workflows/{flowId}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2DeleteWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetInstance - Get a workflow instance by id +// Get a workflow instance by id +func (s *orchestration) V2GetInstance(ctx context.Context, request operations.V2GetInstanceRequest) (*operations.V2GetInstanceResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/instances/{instanceID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetInstanceResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2GetWorkflowInstanceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2GetWorkflowInstanceResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetInstanceHistory - Get a workflow instance history by id +// Get a workflow instance history by id +func (s *orchestration) V2GetInstanceHistory(ctx context.Context, request operations.V2GetInstanceHistoryRequest) (*operations.V2GetInstanceHistoryResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/instances/{instanceID}/history", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetInstanceHistoryResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2GetWorkflowInstanceHistoryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2GetWorkflowInstanceHistoryResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetInstanceStageHistory - Get a workflow instance stage history +// Get a workflow instance stage history +func (s *orchestration) V2GetInstanceStageHistory(ctx context.Context, request operations.V2GetInstanceStageHistoryRequest) (*operations.V2GetInstanceStageHistoryResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/instances/{instanceID}/stages/{number}/history", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetInstanceStageHistoryResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2GetWorkflowInstanceHistoryStageResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2GetWorkflowInstanceHistoryStageResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetServerInfo - Get server info +func (s *orchestration) V2GetServerInfo(ctx context.Context) (*operations.V2GetServerInfoResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/_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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetServerInfoResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ServerInfo = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2GetWorkflow - Get a flow by id +// Get a flow by id +func (s *orchestration) V2GetWorkflow(ctx context.Context, request operations.V2GetWorkflowRequest) (*operations.V2GetWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/workflows/{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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2GetWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2GetWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2GetWorkflowResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListInstances - List instances of a workflow +// List instances of a workflow +func (s *orchestration) V2ListInstances(ctx context.Context, request operations.V2ListInstancesRequest) (*operations.V2ListInstancesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/instances" + + 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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListInstancesResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ListRunsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ListRunsResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListTriggers - List triggers +// List triggers +func (s *orchestration) V2ListTriggers(ctx context.Context) (*operations.V2ListTriggersResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/triggers" + + 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListTriggersResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ListTriggersResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ListTriggersResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListTriggersOccurrences - List triggers occurrences +// List triggers occurrences +func (s *orchestration) V2ListTriggersOccurrences(ctx context.Context, request operations.V2ListTriggersOccurrencesRequest) (*operations.V2ListTriggersOccurrencesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/triggers/{triggerID}/occurrences", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListTriggersOccurrencesResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ListTriggersOccurrencesResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ListTriggersOccurrencesResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ListWorkflows - List registered workflows +// List registered workflows +func (s *orchestration) V2ListWorkflows(ctx context.Context) (*operations.V2ListWorkflowsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/orchestration/v2/workflows" + + 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ListWorkflowsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ListWorkflowsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ListWorkflowsResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2ReadTrigger - Read trigger +// Read trigger +func (s *orchestration) V2ReadTrigger(ctx context.Context, request operations.V2ReadTriggerRequest) (*operations.V2ReadTriggerResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/triggers/{triggerID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2ReadTriggerResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2ReadTriggerResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2ReadTriggerResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2RunWorkflow - Run workflow +// Run workflow +func (s *orchestration) V2RunWorkflow(ctx context.Context, request operations.V2RunWorkflowRequest) (*operations.V2RunWorkflowResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/workflows/{workflowID}/instances", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2RunWorkflowResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2RunWorkflowResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2RunWorkflowResponse = &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.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// V2SendEvent - Send an event to a running workflow +// Send an event to a running workflow +func (s *orchestration) V2SendEvent(ctx context.Context, request operations.V2SendEventRequest) (*operations.V2SendEventResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/orchestration/v2/instances/{instanceID}/events", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + 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) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.V2SendEventResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.V2Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.V2Error = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/payments.go b/payments.go deleted file mode 100755 index ebdcc367..00000000 --- a/payments.go +++ /dev/null @@ -1,827 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package formance - -import ( - "context" - "fmt" - "github.com/formancehq/formance-sdk-go/pkg/models/operations" - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "github.com/formancehq/formance-sdk-go/pkg/utils" - "net/http" - "strings" -) - -type payments struct { - defaultClient HTTPClient - securityClient HTTPClient - serverURL string - language string - sdkVersion string - genVersion string -} - -func newPayments(defaultClient, securityClient HTTPClient, serverURL, language, sdkVersion, genVersion string) *payments { - return &payments{ - defaultClient: defaultClient, - securityClient: securityClient, - serverURL: serverURL, - language: language, - sdkVersion: sdkVersion, - genVersion: genVersion, - } -} - -// 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 - url := strings.TrimSuffix(baseURL, "/") + "/api/payments/connectors/stripe/transfers" - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - if bodyReader == nil { - return nil, fmt.Errorf("request body is required") - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ConnectorsStripeTransferResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - 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 { - return nil, err - } - - res.StripeTransferResponse = out - } - } - - return res, nil -} - -// ConnectorsTransfer - Transfer funds between Connector accounts -// Execute a transfer between two accounts. -func (s *payments) ConnectorsTransfer(ctx context.Context, request operations.ConnectorsTransferRequest) (*operations.ConnectorsTransferResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/transfers", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "TransferRequest", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - if bodyReader == nil { - return nil, fmt.Errorf("request body is required") - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ConnectorsTransferResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransferResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.TransferResponse = out - } - } - - return res, nil -} - -// 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, 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetConnectorTaskResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.TaskResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.TaskResponse = out - } - } - - return res, nil -} - -// GetPayment - Get a payment -func (s *payments) GetPayment(ctx context.Context, request operations.GetPaymentRequest) (*operations.GetPaymentResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.GetPaymentResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.PaymentResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.PaymentResponse = out - } - } - - return res, nil -} - -// 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, 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") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - if bodyReader == nil { - return nil, fmt.Errorf("request body is required") - } - - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.InstallConnectorResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - -// ListAllConnectors - List all installed connectors -// List all installed connectors. -func (s *payments) ListAllConnectors(ctx context.Context) (*operations.ListAllConnectorsResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListAllConnectorsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ConnectorsResponse = out - } - } - - return res, nil -} - -// 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 - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListConfigsAvailableConnectorsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorsConfigsResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ConnectorsConfigsResponse = out - } - } - - return res, nil -} - -// 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, 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.language, s.sdkVersion, s.genVersion)) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListConnectorTasksResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.TasksCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.TasksCursor = out - } - } - - return res, nil -} - -// ListConnectorsTransfers - List transfers and their statuses -// List transfers -func (s *payments) ListConnectorsTransfers(ctx context.Context, request operations.ListConnectorsTransfersRequest) (*operations.ListConnectorsTransfersResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/connectors/{connector}/transfers", 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListConnectorsTransfersResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.TransfersResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.TransfersResponse = out - } - } - - return res, nil -} - -// ListPayments - List payments -func (s *payments) ListPayments(ctx context.Context, request operations.ListPaymentsRequest) (*operations.ListPaymentsResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ListPaymentsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.PaymentsCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.PaymentsCursor = out - } - } - - return res, nil -} - -// PaymentsgetServerInfo - Get server info -func (s *payments) PaymentsgetServerInfo(ctx context.Context) (*operations.PaymentsgetServerInfoResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.PaymentsgetServerInfoResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ServerInfo - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ServerInfo = out - } - } - - return res, nil -} - -// PaymentslistAccounts - List accounts -func (s *payments) PaymentslistAccounts(ctx context.Context, request operations.PaymentslistAccountsRequest) (*operations.PaymentslistAccountsResponse, error) { - baseURL := s.serverURL - 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.language, s.sdkVersion, s.genVersion)) - - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.PaymentslistAccountsResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountsCursor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.AccountsCursor = out - } - } - - return res, nil -} - -// 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, 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ReadConnectorConfigResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(contentType, `application/json`): - var out *shared.ConnectorConfigResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { - return nil, err - } - - res.ConnectorConfigResponse = out - } - } - - return res, nil -} - -// ResetConnector - Reset a connector -// 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, 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.ResetConnectorResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - -// 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, 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.language, s.sdkVersion, s.genVersion)) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.UninstallConnectorResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} - -// UpdateMetadata - Update metadata -func (s *payments) UpdateMetadata(ctx context.Context, request operations.UpdateMetadataRequest) (*operations.UpdateMetadataResponse, error) { - baseURL := s.serverURL - url, err := utils.GenerateURL(ctx, baseURL, "/api/payments/payments/{paymentId}/metadata", request, nil) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "PaymentMetadata", "json") - if err != nil { - return nil, fmt.Errorf("error serializing request body: %w", err) - } - if bodyReader == nil { - return nil, fmt.Errorf("request body is required") - } - - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) - 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.language, s.sdkVersion, s.genVersion)) - - req.Header.Set("Content-Type", reqContentType) - - client := s.securityClient - - httpRes, err := client.Do(req) - if err != nil { - return nil, fmt.Errorf("error sending request: %w", err) - } - if httpRes == nil { - return nil, fmt.Errorf("error sending request: no response") - } - defer httpRes.Body.Close() - - contentType := httpRes.Header.Get("Content-Type") - - res := &operations.UpdateMetadataResponse{ - StatusCode: httpRes.StatusCode, - ContentType: contentType, - RawResponse: httpRes, - } - switch { - case httpRes.StatusCode == 204: - } - - return res, nil -} diff --git a/pkg/models/operations/activateconfig.go b/pkg/models/operations/activateconfig.go index e9fc0c32..c492d0e6 100755 --- a/pkg/models/operations/activateconfig.go +++ b/pkg/models/operations/activateconfig.go @@ -12,12 +12,57 @@ type ActivateConfigRequest struct { 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 + // 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *ActivateConfigResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/addmetadataontransaction.go b/pkg/models/operations/addmetadataontransaction.go index a2325cc0..d1fdfd5e 100755 --- a/pkg/models/operations/addmetadataontransaction.go +++ b/pkg/models/operations/addmetadataontransaction.go @@ -4,6 +4,8 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "net/http" ) @@ -13,13 +15,76 @@ type AddMetadataOnTransactionRequest struct { // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` // Transaction ID. - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + Txid *big.Int `pathParam:"style=simple,explode=false,name=txid"` +} + +func (a AddMetadataOnTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AddMetadataOnTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +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() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Txid } 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 { + 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 346621ae..d7e29152 100755 --- a/pkg/models/operations/addmetadatatoaccount.go +++ b/pkg/models/operations/addmetadatatoaccount.go @@ -20,10 +20,62 @@ type AddMetadataToAccountRequest struct { 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 { + // 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 { + 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 deleted file mode 100755 index 69d31dcb..00000000 --- a/pkg/models/operations/addscopetoclient.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type AddScopeToClientRequest struct { - // Client ID - ClientID string `pathParam:"style=simple,explode=false,name=clientId"` - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` -} - -type AddScopeToClientResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/addtransientscope.go b/pkg/models/operations/addtransientscope.go deleted file mode 100755 index ea9b04be..00000000 --- a/pkg/models/operations/addtransientscope.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type AddTransientScopeRequest struct { - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` - // Transient scope ID - TransientScopeID string `pathParam:"style=simple,explode=false,name=transientScopeId"` -} - -type AddTransientScopeResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/cancelevent.go b/pkg/models/operations/cancelevent.go index 6222ee9c..9256eb2f 100755 --- a/pkg/models/operations/cancelevent.go +++ b/pkg/models/operations/cancelevent.go @@ -12,10 +12,48 @@ type CancelEventRequest struct { InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` } +func (o *CancelEventRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + type CancelEventResponse struct { + // HTTP response content type for this operation ContentType string // 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 } + +func (o *CancelEventResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CancelEventResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *CancelEventResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CancelEventResponse) 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 d83f52ad..f158008b 100755 --- a/pkg/models/operations/changeconfigsecret.go +++ b/pkg/models/operations/changeconfigsecret.go @@ -13,12 +13,64 @@ type ChangeConfigSecretRequest struct { 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 + // 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *ChangeConfigSecretResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/confirmhold.go b/pkg/models/operations/confirmhold.go index f2883bea..f50557a8 100755 --- a/pkg/models/operations/confirmhold.go +++ b/pkg/models/operations/confirmhold.go @@ -12,10 +12,55 @@ 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 { + // 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 } + +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 deleted file mode 100755 index 54abcba6..00000000 --- a/pkg/models/operations/connectorsstripetransfer.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type ConnectorsStripeTransferResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // OK - StripeTransferResponse map[string]interface{} -} diff --git a/pkg/models/operations/connectorstransfer.go b/pkg/models/operations/connectorstransfer.go deleted file mode 100755 index b049a212..00000000 --- a/pkg/models/operations/connectorstransfer.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ConnectorsTransferRequest struct { - TransferRequest shared.TransferRequest `request:"mediaType=application/json"` - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type ConnectorsTransferResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // OK - TransferResponse *shared.TransferResponse -} diff --git a/pkg/models/operations/countaccounts.go b/pkg/models/operations/countaccounts.go index 23c087d2..b7373a97 100755 --- a/pkg/models/operations/countaccounts.go +++ b/pkg/models/operations/countaccounts.go @@ -16,11 +16,70 @@ type CountAccountsRequest struct { Metadata map[string]interface{} `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() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + 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 { + 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 4d0afd9e..54da2dc4 100755 --- a/pkg/models/operations/counttransactions.go +++ b/pkg/models/operations/counttransactions.go @@ -4,10 +4,15 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/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 { // 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"` @@ -20,7 +25,7 @@ type CountTransactionsRequest struct { // 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 map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` + 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 $). @@ -31,11 +36,116 @@ type CountTransactionsRequest struct { StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` } +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) 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 +} + 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 { + 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 5fd77484..3f8e8f35 100755 --- a/pkg/models/operations/createbalance.go +++ b/pkg/models/operations/createbalance.go @@ -12,12 +12,64 @@ 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 { + // 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 } + +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 264d0a6e..17268060 100755 --- a/pkg/models/operations/createclient.go +++ b/pkg/models/operations/createclient.go @@ -8,9 +8,40 @@ 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 { + 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/createpolicy.go b/pkg/models/operations/createpolicy.go new file mode 100755 index 00000000..68a836f3 --- /dev/null +++ b/pkg/models/operations/createpolicy.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type CreatePolicyResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + PolicyResponse *shared.PolicyResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *CreatePolicyResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreatePolicyResponse) GetPolicyResponse() *shared.PolicyResponse { + if o == nil { + return nil + } + return o.PolicyResponse +} + +func (o *CreatePolicyResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreatePolicyResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreatePolicyResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/createscope.go b/pkg/models/operations/createscope.go deleted file mode 100755 index 71c4e9e2..00000000 --- a/pkg/models/operations/createscope.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type CreateScopeResponse struct { - ContentType string - // Created scope - CreateScopeResponse *shared.CreateScopeResponse - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/createsecret.go b/pkg/models/operations/createsecret.go index ad02cf5d..b14bd26c 100755 --- a/pkg/models/operations/createsecret.go +++ b/pkg/models/operations/createsecret.go @@ -13,10 +13,55 @@ type CreateSecretRequest struct { 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 { + // 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 { + 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 62d634bc..315629f4 100755 --- a/pkg/models/operations/createtransaction.go +++ b/pkg/models/operations/createtransaction.go @@ -19,12 +19,71 @@ type CreateTransactionRequest struct { 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 { + // 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 } + +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 34b63a89..e0df6aaf 100755 --- a/pkg/models/operations/createtransactions.go +++ b/pkg/models/operations/createtransactions.go @@ -13,12 +13,64 @@ type CreateTransactionsRequest struct { 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 { + // 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 } + +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/createtrigger.go b/pkg/models/operations/createtrigger.go new file mode 100755 index 00000000..a10f0e4b --- /dev/null +++ b/pkg/models/operations/createtrigger.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type CreateTriggerResponse struct { + // HTTP response content type for this operation + ContentType string + // Created trigger + CreateTriggerResponse *shared.CreateTriggerResponse + // General error + Error *shared.Error + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *CreateTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateTriggerResponse) GetCreateTriggerResponse() *shared.CreateTriggerResponse { + if o == nil { + return nil + } + return o.CreateTriggerResponse +} + +func (o *CreateTriggerResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *CreateTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateTriggerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/createwallet.go b/pkg/models/operations/createwallet.go index ab0a5b62..9a062976 100755 --- a/pkg/models/operations/createwallet.go +++ b/pkg/models/operations/createwallet.go @@ -8,11 +8,49 @@ 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 } + +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 deee216f..52bf1763 100755 --- a/pkg/models/operations/createworkflow.go +++ b/pkg/models/operations/createworkflow.go @@ -8,11 +8,49 @@ 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 } + +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 c8b53644..b84fc328 100755 --- a/pkg/models/operations/creditwallet.go +++ b/pkg/models/operations/creditwallet.go @@ -12,10 +12,55 @@ 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 { + // 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 } + +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 2dbc5dc3..4050cf49 100755 --- a/pkg/models/operations/deactivateconfig.go +++ b/pkg/models/operations/deactivateconfig.go @@ -12,12 +12,57 @@ type DeactivateConfigRequest struct { 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 + // 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *DeactivateConfigResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/debitwallet.go b/pkg/models/operations/debitwallet.go index 94231684..0fd02192 100755 --- a/pkg/models/operations/debitwallet.go +++ b/pkg/models/operations/debitwallet.go @@ -12,12 +12,64 @@ 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 { + // 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 } + +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 41c20a83..116c6456 100755 --- a/pkg/models/operations/deleteclient.go +++ b/pkg/models/operations/deleteclient.go @@ -11,8 +11,39 @@ type DeleteClientRequest struct { ClientID string `pathParam:"style=simple,explode=false,name=clientId"` } +func (o *DeleteClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + 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 } + +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 bcabc5ee..6914acd8 100755 --- a/pkg/models/operations/deleteconfig.go +++ b/pkg/models/operations/deleteconfig.go @@ -12,10 +12,48 @@ type DeleteConfigRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *DeleteConfigRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *DeleteConfigResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/deletepolicy.go b/pkg/models/operations/deletepolicy.go new file mode 100755 index 00000000..2d72ee8c --- /dev/null +++ b/pkg/models/operations/deletepolicy.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type DeletePolicyRequest struct { + // The policy ID. + PolicyID string `pathParam:"style=simple,explode=false,name=policyID"` +} + +func (o *DeletePolicyRequest) GetPolicyID() string { + if o == nil { + return "" + } + return o.PolicyID +} + +type DeletePolicyResponse struct { + // 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 + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *DeletePolicyResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeletePolicyResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeletePolicyResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *DeletePolicyResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/deletescope.go b/pkg/models/operations/deletescope.go deleted file mode 100755 index b0e87c9c..00000000 --- a/pkg/models/operations/deletescope.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type DeleteScopeRequest struct { - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` -} - -type DeleteScopeResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/deletescopefromclient.go b/pkg/models/operations/deletescopefromclient.go deleted file mode 100755 index 06849c9c..00000000 --- a/pkg/models/operations/deletescopefromclient.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type DeleteScopeFromClientRequest struct { - // Client ID - ClientID string `pathParam:"style=simple,explode=false,name=clientId"` - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` -} - -type DeleteScopeFromClientResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/deletesecret.go b/pkg/models/operations/deletesecret.go index ff1056e8..1e0e1e45 100755 --- a/pkg/models/operations/deletesecret.go +++ b/pkg/models/operations/deletesecret.go @@ -13,8 +13,46 @@ type DeleteSecretRequest struct { 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 { + // 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 } + +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 deleted file mode 100755 index 73595cb8..00000000 --- a/pkg/models/operations/deletetransientscope.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "net/http" -) - -type DeleteTransientScopeRequest struct { - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` - // Transient scope ID - TransientScopeID string `pathParam:"style=simple,explode=false,name=transientScopeId"` -} - -type DeleteTransientScopeResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/deletetrigger.go b/pkg/models/operations/deletetrigger.go new file mode 100755 index 00000000..a82e1a87 --- /dev/null +++ b/pkg/models/operations/deletetrigger.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type DeleteTriggerRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *DeleteTriggerRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type DeleteTriggerResponse struct { + // HTTP response content type for this operation + ContentType string + // General error + Error *shared.Error + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeleteTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteTriggerResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *DeleteTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteTriggerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/deleteworkflow.go b/pkg/models/operations/deleteworkflow.go index 6c492cd2..bef8053b 100755 --- a/pkg/models/operations/deleteworkflow.go +++ b/pkg/models/operations/deleteworkflow.go @@ -12,10 +12,48 @@ type DeleteWorkflowRequest struct { FlowID string `pathParam:"style=simple,explode=false,name=flowId"` } +func (o *DeleteWorkflowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + type DeleteWorkflowResponse struct { + // HTTP response content type for this operation ContentType string // 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 } + +func (o *DeleteWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteWorkflowResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *DeleteWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteWorkflowResponse) 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 6badb69b..d619166c 100755 --- a/pkg/models/operations/getaccount.go +++ b/pkg/models/operations/getaccount.go @@ -18,12 +18,64 @@ type GetAccountRequest struct { 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 + // 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 { + 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/getapiauthwellknownopenidconfiguration.go b/pkg/models/operations/getapiauthwellknownopenidconfiguration.go new file mode 100755 index 00000000..44e756a4 --- /dev/null +++ b/pkg/models/operations/getapiauthwellknownopenidconfiguration.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetAPIAuthWellKnownOpenidConfigurationResponse struct { + // 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 *GetAPIAuthWellKnownOpenidConfigurationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetAPIAuthWellKnownOpenidConfigurationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetAPIAuthWellKnownOpenidConfigurationResponse) 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 7c80d2ce..0b17288a 100755 --- a/pkg/models/operations/getbalance.go +++ b/pkg/models/operations/getbalance.go @@ -12,12 +12,64 @@ 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 { + // 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 } + +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 6debb314..90e89370 100755 --- a/pkg/models/operations/getbalances.go +++ b/pkg/models/operations/getbalances.go @@ -20,21 +20,80 @@ type GetBalancesRequest struct { 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: this field 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 } 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 { + 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 357c7ffb..5248b9bc 100755 --- a/pkg/models/operations/getbalancesaggregated.go +++ b/pkg/models/operations/getbalancesaggregated.go @@ -14,12 +14,64 @@ type GetBalancesAggregatedRequest struct { 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 + // 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 { + 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 deleted file mode 100755 index 3dd17e75..00000000 --- a/pkg/models/operations/getconnectortask.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type GetConnectorTaskRequest struct { - // 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"` -} - -type GetConnectorTaskResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // OK - TaskResponse *shared.TaskResponse -} diff --git a/pkg/models/operations/gethold.go b/pkg/models/operations/gethold.go index 23701448..ab734536 100755 --- a/pkg/models/operations/gethold.go +++ b/pkg/models/operations/gethold.go @@ -12,12 +12,57 @@ type GetHoldRequest struct { HoldID string `pathParam:"style=simple,explode=false,name=holdID"` } +func (o *GetHoldRequest) GetHoldID() string { + if o == nil { + return "" + } + return o.HoldID +} + 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 } + +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 4880985b..d8506c15 100755 --- a/pkg/models/operations/getholds.go +++ b/pkg/models/operations/getholds.go @@ -4,6 +4,7 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" ) @@ -17,17 +18,94 @@ type GetHoldsRequest struct { // Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. Metadata map[string]string `queryParam:"style=deepObject,explode=true,name=metadata"` // The maximum number of results to return per page - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + 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() map[string]string { + 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 { + // 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 } + +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 afd4a9a0..7bde8e93 100755 --- a/pkg/models/operations/getinfo.go +++ b/pkg/models/operations/getinfo.go @@ -10,9 +10,47 @@ 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 { + 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/getinstance.go b/pkg/models/operations/getinstance.go index 4a940e65..5f9a57b5 100755 --- a/pkg/models/operations/getinstance.go +++ b/pkg/models/operations/getinstance.go @@ -12,12 +12,57 @@ type GetInstanceRequest struct { InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` } +func (o *GetInstanceRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + type GetInstanceResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow instance GetWorkflowInstanceResponse *shared.GetWorkflowInstanceResponse - 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 *GetInstanceResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetInstanceResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetInstanceResponse) GetGetWorkflowInstanceResponse() *shared.GetWorkflowInstanceResponse { + if o == nil { + return nil + } + return o.GetWorkflowInstanceResponse +} + +func (o *GetInstanceResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetInstanceResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getinstancehistory.go b/pkg/models/operations/getinstancehistory.go index 3acb283c..183a4125 100755 --- a/pkg/models/operations/getinstancehistory.go +++ b/pkg/models/operations/getinstancehistory.go @@ -12,12 +12,57 @@ type GetInstanceHistoryRequest struct { InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` } +func (o *GetInstanceHistoryRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + type GetInstanceHistoryResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow instance history GetWorkflowInstanceHistoryResponse *shared.GetWorkflowInstanceHistoryResponse - 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 *GetInstanceHistoryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetInstanceHistoryResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetInstanceHistoryResponse) GetGetWorkflowInstanceHistoryResponse() *shared.GetWorkflowInstanceHistoryResponse { + if o == nil { + return nil + } + return o.GetWorkflowInstanceHistoryResponse +} + +func (o *GetInstanceHistoryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetInstanceHistoryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getinstancestagehistory.go b/pkg/models/operations/getinstancestagehistory.go index d8c535f3..9344ecae 100755 --- a/pkg/models/operations/getinstancestagehistory.go +++ b/pkg/models/operations/getinstancestagehistory.go @@ -14,12 +14,64 @@ type GetInstanceStageHistoryRequest struct { Number int64 `pathParam:"style=simple,explode=false,name=number"` } +func (o *GetInstanceStageHistoryRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +func (o *GetInstanceStageHistoryRequest) GetNumber() int64 { + if o == nil { + return 0 + } + return o.Number +} + type GetInstanceStageHistoryResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow instance stage history GetWorkflowInstanceHistoryStageResponse *shared.GetWorkflowInstanceHistoryStageResponse - 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 *GetInstanceStageHistoryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetInstanceStageHistoryResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetInstanceStageHistoryResponse) GetGetWorkflowInstanceHistoryStageResponse() *shared.GetWorkflowInstanceHistoryStageResponse { + if o == nil { + return nil + } + return o.GetWorkflowInstanceHistoryStageResponse +} + +func (o *GetInstanceStageHistoryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetInstanceStageHistoryResponse) 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 565419d4..bdbf95fe 100755 --- a/pkg/models/operations/getledgerinfo.go +++ b/pkg/models/operations/getledgerinfo.go @@ -12,12 +12,57 @@ type GetLedgerInfoRequest struct { Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *GetLedgerInfoRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + 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 { + 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 c1dd2841..456165e6 100755 --- a/pkg/models/operations/getmanyconfigs.go +++ b/pkg/models/operations/getmanyconfigs.go @@ -14,12 +14,64 @@ type GetManyConfigsRequest struct { 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 + // 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *GetManyConfigsResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/getmapping.go b/pkg/models/operations/getmapping.go index 87870bbb..621c237f 100755 --- a/pkg/models/operations/getmapping.go +++ b/pkg/models/operations/getmapping.go @@ -12,12 +12,57 @@ type GetMappingRequest struct { Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *GetMappingRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + 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 { + 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 deleted file mode 100755 index 1c2a90a6..00000000 --- a/pkg/models/operations/getpayment.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type GetPaymentRequest struct { - // The payment ID. - PaymentID string `pathParam:"style=simple,explode=false,name=paymentId"` -} - -type GetPaymentResponse struct { - ContentType string - // OK - PaymentResponse *shared.PaymentResponse - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/getpolicy.go b/pkg/models/operations/getpolicy.go new file mode 100755 index 00000000..37c53380 --- /dev/null +++ b/pkg/models/operations/getpolicy.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type GetPolicyRequest struct { + // The policy ID. + PolicyID string `pathParam:"style=simple,explode=false,name=policyID"` +} + +func (o *GetPolicyRequest) GetPolicyID() string { + if o == nil { + return "" + } + return o.PolicyID +} + +type GetPolicyResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + PolicyResponse *shared.PolicyResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *GetPolicyResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPolicyResponse) GetPolicyResponse() *shared.PolicyResponse { + if o == nil { + return nil + } + return o.PolicyResponse +} + +func (o *GetPolicyResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPolicyResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetPolicyResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/getreconciliation.go b/pkg/models/operations/getreconciliation.go new file mode 100755 index 00000000..7e037742 --- /dev/null +++ b/pkg/models/operations/getreconciliation.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type GetReconciliationRequest struct { + // The reconciliation ID. + ReconciliationID string `pathParam:"style=simple,explode=false,name=reconciliationID"` +} + +func (o *GetReconciliationRequest) GetReconciliationID() string { + if o == nil { + return "" + } + return o.ReconciliationID +} + +type GetReconciliationResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + ReconciliationResponse *shared.ReconciliationResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *GetReconciliationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetReconciliationResponse) GetReconciliationResponse() *shared.ReconciliationResponse { + if o == nil { + return nil + } + return o.ReconciliationResponse +} + +func (o *GetReconciliationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetReconciliationResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetReconciliationResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/getserverinfo.go b/pkg/models/operations/getserverinfo.go index 48f3c27d..31c471d1 100755 --- a/pkg/models/operations/getserverinfo.go +++ b/pkg/models/operations/getserverinfo.go @@ -8,9 +8,40 @@ 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 } + +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 4496b5bf..232b69cd 100755 --- a/pkg/models/operations/gettransaction.go +++ b/pkg/models/operations/gettransaction.go @@ -4,6 +4,8 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "net/http" ) @@ -11,15 +13,78 @@ type GetTransactionRequest struct { // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` // Transaction ID. - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + Txid *big.Int `pathParam:"style=simple,explode=false,name=txid"` +} + +func (g GetTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *GetTransactionRequest) GetTxid() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Txid } 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 } + +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 48e13a0d..23ba9379 100755 --- a/pkg/models/operations/gettransactions.go +++ b/pkg/models/operations/gettransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" ) @@ -15,17 +16,87 @@ type GetTransactionsRequest struct { // Cursor *string `queryParam:"style=form,explode=true,name=cursor"` // The maximum number of results to return per page - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + 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=walletID"` } +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 { + // 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 } + +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/getversions.go b/pkg/models/operations/getversions.go index 0852d904..9b34be84 100755 --- a/pkg/models/operations/getversions.go +++ b/pkg/models/operations/getversions.go @@ -8,9 +8,40 @@ import ( ) type GetVersionsResponse struct { + // HTTP response content type for this operation ContentType string // OK GetVersionsResponse *shared.GetVersionsResponse - 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 *GetVersionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetVersionsResponse) GetGetVersionsResponse() *shared.GetVersionsResponse { + if o == nil { + return nil + } + return o.GetVersionsResponse +} + +func (o *GetVersionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetVersionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/getwallet.go b/pkg/models/operations/getwallet.go index 6e300e57..9ee15fc5 100755 --- a/pkg/models/operations/getwallet.go +++ b/pkg/models/operations/getwallet.go @@ -11,12 +11,57 @@ 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 { + // 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 } + +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/getwalletsummary.go b/pkg/models/operations/getwalletsummary.go index f47022c8..965b9f5a 100755 --- a/pkg/models/operations/getwalletsummary.go +++ b/pkg/models/operations/getwalletsummary.go @@ -11,12 +11,57 @@ type GetWalletSummaryRequest struct { ID string `pathParam:"style=simple,explode=false,name=id"` } +func (o *GetWalletSummaryRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + type GetWalletSummaryResponse struct { + // HTTP response content type for this operation ContentType string // Wallet summary GetWalletSummaryResponse *shared.GetWalletSummaryResponse - 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 } + +func (o *GetWalletSummaryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetWalletSummaryResponse) GetGetWalletSummaryResponse() *shared.GetWalletSummaryResponse { + if o == nil { + return nil + } + return o.GetWalletSummaryResponse +} + +func (o *GetWalletSummaryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetWalletSummaryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetWalletSummaryResponse) GetWalletsErrorResponse() *shared.WalletsErrorResponse { + if o == nil { + return nil + } + return o.WalletsErrorResponse +} diff --git a/pkg/models/operations/getworkflow.go b/pkg/models/operations/getworkflow.go index 96fb7610..463ddbd6 100755 --- a/pkg/models/operations/getworkflow.go +++ b/pkg/models/operations/getworkflow.go @@ -12,12 +12,57 @@ type GetWorkflowRequest struct { FlowID string `pathParam:"style=simple,explode=false,name=flowId"` } +func (o *GetWorkflowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + type GetWorkflowResponse 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 *GetWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetWorkflowResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *GetWorkflowResponse) GetGetWorkflowResponse() *shared.GetWorkflowResponse { + if o == nil { + return nil + } + return o.GetWorkflowResponse +} + +func (o *GetWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetWorkflowResponse) 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 7ef6ffbe..18ceda87 100755 --- a/pkg/models/operations/insertconfig.go +++ b/pkg/models/operations/insertconfig.go @@ -10,9 +10,47 @@ 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/installconnector.go b/pkg/models/operations/installconnector.go deleted file mode 100755 index 9fb41b98..00000000 --- a/pkg/models/operations/installconnector.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type InstallConnectorRequest struct { - RequestBody interface{} `request:"mediaType=application/json"` - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type InstallConnectorResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/listaccounts.go b/pkg/models/operations/listaccounts.go index a6f1ee8d..9e57e9e0 100755 --- a/pkg/models/operations/listaccounts.go +++ b/pkg/models/operations/listaccounts.go @@ -3,63 +3,18 @@ package operations import ( - "encoding/json" - "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "math/big" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" ) -// 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 ( - 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) - } -} - type ListAccountsRequest struct { // 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 *big.Int `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"` + Balance *int64 `queryParam:"style=form,explode=true,name=balance"` // 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. @@ -72,7 +27,7 @@ type ListAccountsRequest struct { Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` // The maximum number of results to return per page. // - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` // 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. @@ -80,16 +35,121 @@ type ListAccountsRequest struct { // Deprecated, please use `cursor` instead. // // - // Deprecated: this field will be removed in a future release, please migrate away from it as soon as possible. + // 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) 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() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ListAccountsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListAccountsRequest) GetPaginationToken() *string { + if o == nil { + return nil + } + return o.PaginationToken +} + 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 { + 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 deleted file mode 100755 index 7e749649..00000000 --- a/pkg/models/operations/listallconnectors.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListAllConnectorsResponse struct { - // OK - ConnectorsResponse *shared.ConnectorsResponse - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/listbalances.go b/pkg/models/operations/listbalances.go index e3092430..635742fe 100755 --- a/pkg/models/operations/listbalances.go +++ b/pkg/models/operations/listbalances.go @@ -11,10 +11,48 @@ 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 { + // 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 { + 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 d25a52c4..e4050bff 100755 --- a/pkg/models/operations/listclients.go +++ b/pkg/models/operations/listclients.go @@ -8,9 +8,40 @@ 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 { + 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 deleted file mode 100755 index f3c905d2..00000000 --- a/pkg/models/operations/listconfigsavailableconnectors.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListConfigsAvailableConnectorsResponse struct { - // OK - ConnectorsConfigsResponse *shared.ConnectorsConfigsResponse - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/listconnectorstransfers.go b/pkg/models/operations/listconnectorstransfers.go deleted file mode 100755 index cfd27a35..00000000 --- a/pkg/models/operations/listconnectorstransfers.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListConnectorsTransfersRequest struct { - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type ListConnectorsTransfersResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // OK - TransfersResponse *shared.TransfersResponse -} diff --git a/pkg/models/operations/listconnectortasks.go b/pkg/models/operations/listconnectortasks.go deleted file mode 100755 index 7e98759a..00000000 --- a/pkg/models/operations/listconnectortasks.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListConnectorTasksRequest struct { - // 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 `queryParam:"style=form,explode=true,name=pageSize"` -} - -type ListConnectorTasksResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // OK - TasksCursor *shared.TasksCursor -} diff --git a/pkg/models/operations/listinstances.go b/pkg/models/operations/listinstances.go index 10724db1..2aae885b 100755 --- a/pkg/models/operations/listinstances.go +++ b/pkg/models/operations/listinstances.go @@ -14,12 +14,64 @@ type ListInstancesRequest struct { WorkflowID *string `queryParam:"style=form,explode=true,name=workflowID"` } +func (o *ListInstancesRequest) GetRunning() *bool { + if o == nil { + return nil + } + return o.Running +} + +func (o *ListInstancesRequest) GetWorkflowID() *string { + if o == nil { + return nil + } + return o.WorkflowID +} + type ListInstancesResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // List of workflow instances 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 *ListInstancesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListInstancesResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListInstancesResponse) GetListRunsResponse() *shared.ListRunsResponse { + if o == nil { + return nil + } + return o.ListRunsResponse +} + +func (o *ListInstancesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListInstancesResponse) 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 2af5f8bf..c28d9c69 100755 --- a/pkg/models/operations/listlogs.go +++ b/pkg/models/operations/listlogs.go @@ -4,6 +4,7 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" "time" ) @@ -25,28 +26,110 @@ type ListLogsRequest struct { Ledger string `pathParam:"style=simple,explode=false,name=ledger"` // The maximum number of results to return per page. // - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - // 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: this field 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"` + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` // 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"` } +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) 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) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + 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 { + 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 deleted file mode 100755 index 09a4885b..00000000 --- a/pkg/models/operations/listpayments.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListPaymentsRequest struct { - // 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 `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"` -} - -type ListPaymentsResponse struct { - ContentType string - // OK - PaymentsCursor *shared.PaymentsCursor - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/listpolicies.go b/pkg/models/operations/listpolicies.go new file mode 100755 index 00000000..a3d97a7c --- /dev/null +++ b/pkg/models/operations/listpolicies.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ListPoliciesRequest struct { + // 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 `queryParam:"style=form,explode=true,name=pageSize"` +} + +func (o *ListPoliciesRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListPoliciesRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +type ListPoliciesResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + PoliciesCursorResponse *shared.PoliciesCursorResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *ListPoliciesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListPoliciesResponse) GetPoliciesCursorResponse() *shared.PoliciesCursorResponse { + if o == nil { + return nil + } + return o.PoliciesCursorResponse +} + +func (o *ListPoliciesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListPoliciesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListPoliciesResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/listreconciliations.go b/pkg/models/operations/listreconciliations.go new file mode 100755 index 00000000..4a631801 --- /dev/null +++ b/pkg/models/operations/listreconciliations.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ListReconciliationsRequest struct { + // 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 `queryParam:"style=form,explode=true,name=pageSize"` +} + +func (o *ListReconciliationsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListReconciliationsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +type ListReconciliationsResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + ReconciliationsCursorResponse *shared.ReconciliationsCursorResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *ListReconciliationsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListReconciliationsResponse) GetReconciliationsCursorResponse() *shared.ReconciliationsCursorResponse { + if o == nil { + return nil + } + return o.ReconciliationsCursorResponse +} + +func (o *ListReconciliationsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListReconciliationsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListReconciliationsResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/listscopes.go b/pkg/models/operations/listscopes.go deleted file mode 100755 index d87d4932..00000000 --- a/pkg/models/operations/listscopes.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ListScopesResponse struct { - ContentType string - // List of scopes - ListScopesResponse *shared.ListScopesResponse - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/listtransactions.go b/pkg/models/operations/listtransactions.go index b8cbe803..22e975e6 100755 --- a/pkg/models/operations/listtransactions.go +++ b/pkg/models/operations/listtransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" "time" ) @@ -31,16 +32,7 @@ type ListTransactionsRequest struct { Metadata map[string]interface{} `queryParam:"style=deepObject,explode=true,name=metadata"` // The maximum number of results to return per page. // - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` - // 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: this field 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"` + PageSize *int64 `default:"15" queryParam:"style=form,explode=true,name=pageSize"` // 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 $). @@ -51,12 +43,138 @@ type ListTransactionsRequest struct { StartTime *time.Time `queryParam:"style=form,explode=true,name=startTime"` } +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) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *ListTransactionsRequest) GetMetadata() map[string]interface{} { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ListTransactionsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +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 +} + 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 } + +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/listtriggers.go b/pkg/models/operations/listtriggers.go new file mode 100755 index 00000000..75dacd81 --- /dev/null +++ b/pkg/models/operations/listtriggers.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ListTriggersResponse struct { + // HTTP response content type for this operation + ContentType string + // General error + Error *shared.Error + // List of triggers + ListTriggersResponse *shared.ListTriggersResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *ListTriggersResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListTriggersResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListTriggersResponse) GetListTriggersResponse() *shared.ListTriggersResponse { + if o == nil { + return nil + } + return o.ListTriggersResponse +} + +func (o *ListTriggersResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListTriggersResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listtriggersoccurrences.go b/pkg/models/operations/listtriggersoccurrences.go new file mode 100755 index 00000000..5f59d894 --- /dev/null +++ b/pkg/models/operations/listtriggersoccurrences.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ListTriggersOccurrencesRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *ListTriggersOccurrencesRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type ListTriggersOccurrencesResponse struct { + // HTTP response content type for this operation + ContentType string + // General error + Error *shared.Error + // List of triggers occurrences + ListTriggersOccurrencesResponse *shared.ListTriggersOccurrencesResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *ListTriggersOccurrencesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListTriggersOccurrencesResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListTriggersOccurrencesResponse) GetListTriggersOccurrencesResponse() *shared.ListTriggersOccurrencesResponse { + if o == nil { + return nil + } + return o.ListTriggersOccurrencesResponse +} + +func (o *ListTriggersOccurrencesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListTriggersOccurrencesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/listusers.go b/pkg/models/operations/listusers.go index fc3cde49..15695391 100755 --- a/pkg/models/operations/listusers.go +++ b/pkg/models/operations/listusers.go @@ -8,9 +8,40 @@ 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 { + 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 4ce235f5..0722c207 100755 --- a/pkg/models/operations/listwallets.go +++ b/pkg/models/operations/listwallets.go @@ -4,6 +4,7 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" "net/http" ) @@ -19,13 +20,83 @@ type ListWalletsRequest struct { // Filter on wallet name Name *string `queryParam:"style=form,explode=true,name=name"` // The maximum number of results to return per page - PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + 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() map[string]string { + 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 { + // 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 { + 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/listworkflows.go b/pkg/models/operations/listworkflows.go index e7365eea..72926309 100755 --- a/pkg/models/operations/listworkflows.go +++ b/pkg/models/operations/listworkflows.go @@ -8,11 +8,49 @@ import ( ) type ListWorkflowsResponse 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 *ListWorkflowsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListWorkflowsResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ListWorkflowsResponse) GetListWorkflowsResponse() *shared.ListWorkflowsResponse { + if o == nil { + return nil + } + return o.ListWorkflowsResponse +} + +func (o *ListWorkflowsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListWorkflowsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse } diff --git a/pkg/models/operations/orchestrationgetserverinfo.go b/pkg/models/operations/orchestrationgetserverinfo.go index 54c6f6e2..d0f02631 100755 --- a/pkg/models/operations/orchestrationgetserverinfo.go +++ b/pkg/models/operations/orchestrationgetserverinfo.go @@ -8,11 +8,49 @@ 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 } + +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 deleted file mode 100755 index f52cdc71..00000000 --- a/pkg/models/operations/paymentsgetserverinfo.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type PaymentsgetServerInfoResponse struct { - ContentType string - // Server information - ServerInfo *shared.ServerInfo - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/paymentslistaccounts.go b/pkg/models/operations/paymentslistaccounts.go deleted file mode 100755 index e2d73d3d..00000000 --- a/pkg/models/operations/paymentslistaccounts.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type PaymentslistAccountsRequest struct { - // 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 `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"` -} - -type PaymentslistAccountsResponse struct { - // OK - AccountsCursor *shared.AccountsCursor - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/readclient.go b/pkg/models/operations/readclient.go index 8302c115..a94bfb89 100755 --- a/pkg/models/operations/readclient.go +++ b/pkg/models/operations/readclient.go @@ -12,10 +12,48 @@ type ReadClientRequest struct { ClientID string `pathParam:"style=simple,explode=false,name=clientId"` } +func (o *ReadClientRequest) GetClientID() string { + if o == nil { + return "" + } + return o.ClientID +} + 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 { + 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 deleted file mode 100755 index 20d3e9f7..00000000 --- a/pkg/models/operations/readconnectorconfig.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ReadConnectorConfigRequest struct { - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type ReadConnectorConfigResponse struct { - // OK - ConnectorConfigResponse *shared.ConnectorConfigResponse - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/readscope.go b/pkg/models/operations/readscope.go deleted file mode 100755 index 83cf322a..00000000 --- a/pkg/models/operations/readscope.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ReadScopeRequest struct { - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` -} - -type ReadScopeResponse struct { - ContentType string - // Retrieved scope - ReadScopeResponse *shared.ReadScopeResponse - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/readstats.go b/pkg/models/operations/readstats.go index 1d9dd37c..28c1b19d 100755 --- a/pkg/models/operations/readstats.go +++ b/pkg/models/operations/readstats.go @@ -12,12 +12,57 @@ type ReadStatsRequest struct { Ledger string `pathParam:"style=simple,explode=false,name=ledger"` } +func (o *ReadStatsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + 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 { + 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/readtrigger.go b/pkg/models/operations/readtrigger.go new file mode 100755 index 00000000..48221b30 --- /dev/null +++ b/pkg/models/operations/readtrigger.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ReadTriggerRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *ReadTriggerRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type ReadTriggerResponse struct { + // HTTP response content type for this operation + ContentType string + // General error + Error *shared.Error + // A specific trigger + ReadTriggerResponse *shared.ReadTriggerResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *ReadTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReadTriggerResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *ReadTriggerResponse) GetReadTriggerResponse() *shared.ReadTriggerResponse { + if o == nil { + return nil + } + return o.ReadTriggerResponse +} + +func (o *ReadTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReadTriggerResponse) 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 6c136388..dd1cd682 100755 --- a/pkg/models/operations/readuser.go +++ b/pkg/models/operations/readuser.go @@ -12,10 +12,48 @@ type ReadUserRequest struct { UserID string `pathParam:"style=simple,explode=false,name=userId"` } +func (o *ReadUserRequest) GetUserID() string { + if o == nil { + return "" + } + return o.UserID +} + 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 { + 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/reconcile.go b/pkg/models/operations/reconcile.go new file mode 100755 index 00000000..4f519cb8 --- /dev/null +++ b/pkg/models/operations/reconcile.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ReconcileRequest struct { + ReconciliationRequest shared.ReconciliationRequest `request:"mediaType=application/json"` + // The policy ID. + PolicyID string `pathParam:"style=simple,explode=false,name=policyID"` +} + +func (o *ReconcileRequest) GetReconciliationRequest() shared.ReconciliationRequest { + if o == nil { + return shared.ReconciliationRequest{} + } + return o.ReconciliationRequest +} + +func (o *ReconcileRequest) GetPolicyID() string { + if o == nil { + return "" + } + return o.PolicyID +} + +type ReconcileResponse struct { + // HTTP response content type for this operation + ContentType string + // OK + ReconciliationResponse *shared.ReconciliationResponse + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *ReconcileResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReconcileResponse) GetReconciliationResponse() *shared.ReconciliationResponse { + if o == nil { + return nil + } + return o.ReconciliationResponse +} + +func (o *ReconcileResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReconcileResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ReconcileResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/reconciliationgetserverinfo.go b/pkg/models/operations/reconciliationgetserverinfo.go new file mode 100755 index 00000000..8225dd60 --- /dev/null +++ b/pkg/models/operations/reconciliationgetserverinfo.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type ReconciliationgetServerInfoResponse struct { + // HTTP response content type for this operation + ContentType string + // Server information + ServerInfo *shared.ServerInfo + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error response + ReconciliationErrorResponse *shared.ReconciliationErrorResponse +} + +func (o *ReconciliationgetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ReconciliationgetServerInfoResponse) GetServerInfo() *shared.ServerInfo { + if o == nil { + return nil + } + return o.ServerInfo +} + +func (o *ReconciliationgetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ReconciliationgetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ReconciliationgetServerInfoResponse) GetReconciliationErrorResponse() *shared.ReconciliationErrorResponse { + if o == nil { + return nil + } + return o.ReconciliationErrorResponse +} diff --git a/pkg/models/operations/resetconnector.go b/pkg/models/operations/resetconnector.go deleted file mode 100755 index 5b0261f7..00000000 --- a/pkg/models/operations/resetconnector.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type ResetConnectorRequest struct { - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type ResetConnectorResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/reverttransaction.go b/pkg/models/operations/reverttransaction.go index bf05ee0d..7bcc55dc 100755 --- a/pkg/models/operations/reverttransaction.go +++ b/pkg/models/operations/reverttransaction.go @@ -4,6 +4,8 @@ package operations import ( "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "net/http" ) @@ -13,15 +15,85 @@ type RevertTransactionRequest struct { // Name of the ledger. Ledger string `pathParam:"style=simple,explode=false,name=ledger"` // Transaction ID. - Txid int64 `pathParam:"style=simple,explode=false,name=txid"` + Txid *big.Int `pathParam:"style=simple,explode=false,name=txid"` +} + +func (r RevertTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RevertTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + +func (o *RevertTransactionRequest) GetDisableChecks() *bool { + if o == nil { + return nil + } + return o.DisableChecks +} + +func (o *RevertTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *RevertTransactionRequest) GetTxid() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Txid } 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 } + +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 e8f279e3..76de442e 100755 --- a/pkg/models/operations/runscript.go +++ b/pkg/models/operations/runscript.go @@ -15,7 +15,29 @@ type RunScriptRequest struct { 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 { + // 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. // @@ -25,6 +47,36 @@ 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 { + 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 15967b31..36f4c4c8 100755 --- a/pkg/models/operations/runworkflow.go +++ b/pkg/models/operations/runworkflow.go @@ -15,12 +15,71 @@ type RunWorkflowRequest struct { WorkflowID string `pathParam:"style=simple,explode=false,name=workflowID"` } +func (o *RunWorkflowRequest) GetRequestBody() map[string]string { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *RunWorkflowRequest) GetWait() *bool { + if o == nil { + return nil + } + return o.Wait +} + +func (o *RunWorkflowRequest) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} + type RunWorkflowResponse struct { + // HTTP response content type for this operation ContentType string // General error Error *shared.Error // The workflow instance 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 { + 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 93a5c7af..e36038fc 100755 --- a/pkg/models/operations/search.go +++ b/pkg/models/operations/search.go @@ -8,9 +8,40 @@ 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 } + +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 c5b864fa..e53033f9 100755 --- a/pkg/models/operations/searchgetserverinfo.go +++ b/pkg/models/operations/searchgetserverinfo.go @@ -8,9 +8,40 @@ 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 } + +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/sendevent.go b/pkg/models/operations/sendevent.go index 9d3b6fd3..b0f4b573 100755 --- a/pkg/models/operations/sendevent.go +++ b/pkg/models/operations/sendevent.go @@ -11,16 +11,68 @@ type SendEventRequestBody struct { Name string `json:"name"` } +func (o *SendEventRequestBody) GetName() string { + if o == nil { + return "" + } + return o.Name +} + type SendEventRequest struct { RequestBody *SendEventRequestBody `request:"mediaType=application/json"` // The instance id InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` } +func (o *SendEventRequest) GetRequestBody() *SendEventRequestBody { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *SendEventRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + type SendEventResponse struct { + // HTTP response content type for this operation ContentType string // 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 } + +func (o *SendEventResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *SendEventResponse) GetError() *shared.Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *SendEventResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *SendEventResponse) 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 eef15980..979f8e24 100755 --- a/pkg/models/operations/testconfig.go +++ b/pkg/models/operations/testconfig.go @@ -12,12 +12,57 @@ type TestConfigRequest struct { 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 + // 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 // Error WebhooksErrorResponse *shared.WebhooksErrorResponse } + +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 +} + +func (o *TestConfigResponse) GetWebhooksErrorResponse() *shared.WebhooksErrorResponse { + if o == nil { + return nil + } + return o.WebhooksErrorResponse +} diff --git a/pkg/models/operations/uninstallconnector.go b/pkg/models/operations/uninstallconnector.go deleted file mode 100755 index f70a02b3..00000000 --- a/pkg/models/operations/uninstallconnector.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type UninstallConnectorRequest struct { - // The name of the connector. - Connector shared.Connector `pathParam:"style=simple,explode=false,name=connector"` -} - -type UninstallConnectorResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/updateclient.go b/pkg/models/operations/updateclient.go index 52b0575c..117a72b7 100755 --- a/pkg/models/operations/updateclient.go +++ b/pkg/models/operations/updateclient.go @@ -13,10 +13,55 @@ type UpdateClientRequest struct { 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 { + // 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 } + +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 6d9c5fc5..6f9e4f9c 100755 --- a/pkg/models/operations/updatemapping.go +++ b/pkg/models/operations/updatemapping.go @@ -8,17 +8,69 @@ import ( ) type UpdateMappingRequest struct { - Mapping shared.Mapping `request:"mediaType=application/json"` + 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 { + // 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 { + 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/updatemetadata.go b/pkg/models/operations/updatemetadata.go deleted file mode 100755 index e52c48ed..00000000 --- a/pkg/models/operations/updatemetadata.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type UpdateMetadataRequest struct { - PaymentMetadata shared.PaymentMetadata `request:"mediaType=application/json"` - // The payment ID. - PaymentID string `pathParam:"style=simple,explode=false,name=paymentId"` -} - -type UpdateMetadataResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response -} diff --git a/pkg/models/operations/updatescope.go b/pkg/models/operations/updatescope.go deleted file mode 100755 index 92508f27..00000000 --- a/pkg/models/operations/updatescope.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package operations - -import ( - "github.com/formancehq/formance-sdk-go/pkg/models/shared" - "net/http" -) - -type UpdateScopeRequest struct { - UpdateScopeRequest *shared.UpdateScopeRequest `request:"mediaType=application/json"` - // Scope ID - ScopeID string `pathParam:"style=simple,explode=false,name=scopeId"` -} - -type UpdateScopeResponse struct { - ContentType string - StatusCode int - RawResponse *http.Response - // Updated scope - UpdateScopeResponse *shared.UpdateScopeResponse -} diff --git a/pkg/models/operations/updatewallet.go b/pkg/models/operations/updatewallet.go index 73ff4b0f..db941558 100755 --- a/pkg/models/operations/updatewallet.go +++ b/pkg/models/operations/updatewallet.go @@ -12,15 +12,67 @@ type UpdateWalletRequestBody struct { Metadata map[string]string `json:"metadata"` } +func (o *UpdateWalletRequestBody) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + 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 { + // 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 } + +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/v2addmetadataontransaction.go b/pkg/models/operations/v2addmetadataontransaction.go new file mode 100755 index 00000000..abc98947 --- /dev/null +++ b/pkg/models/operations/v2addmetadataontransaction.go @@ -0,0 +1,108 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "net/http" +) + +type V2AddMetadataOnTransactionRequest struct { + // Use an idempotency key + IdempotencyKey *string `header:"style=simple,explode=false,name=Idempotency-Key"` + // metadata + RequestBody map[string]string `request:"mediaType=application/json"` + // Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. + DryRun *bool `queryParam:"style=form,explode=true,name=dryRun"` + // Transaction ID. + ID *big.Int `pathParam:"style=simple,explode=false,name=id"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (v V2AddMetadataOnTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2AddMetadataOnTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2AddMetadataOnTransactionRequest) GetIdempotencyKey() *string { + if o == nil { + return nil + } + return o.IdempotencyKey +} + +func (o *V2AddMetadataOnTransactionRequest) GetRequestBody() map[string]string { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2AddMetadataOnTransactionRequest) GetDryRun() *bool { + if o == nil { + return nil + } + return o.DryRun +} + +func (o *V2AddMetadataOnTransactionRequest) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2AddMetadataOnTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2AddMetadataOnTransactionResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2AddMetadataOnTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2AddMetadataOnTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2AddMetadataOnTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2AddMetadataOnTransactionResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2addmetadatatoaccount.go b/pkg/models/operations/v2addmetadatatoaccount.go new file mode 100755 index 00000000..504c826f --- /dev/null +++ b/pkg/models/operations/v2addmetadatatoaccount.go @@ -0,0 +1,99 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2AddMetadataToAccountRequest struct { + // Use an idempotency key + IdempotencyKey *string `header:"style=simple,explode=false,name=Idempotency-Key"` + // metadata + RequestBody map[string]string `request:"mediaType=application/json"` + // Exact address of the account. It must match the following regular expressions pattern: + // ``` + // ^\w+(:\w+)*$ + // ``` + // + Address string `pathParam:"style=simple,explode=false,name=address"` + // Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. + DryRun *bool `queryParam:"style=form,explode=true,name=dryRun"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2AddMetadataToAccountRequest) GetIdempotencyKey() *string { + if o == nil { + return nil + } + return o.IdempotencyKey +} + +func (o *V2AddMetadataToAccountRequest) GetRequestBody() map[string]string { + if o == nil { + return map[string]string{} + } + return o.RequestBody +} + +func (o *V2AddMetadataToAccountRequest) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *V2AddMetadataToAccountRequest) GetDryRun() *bool { + if o == nil { + return nil + } + return o.DryRun +} + +func (o *V2AddMetadataToAccountRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2AddMetadataToAccountResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2AddMetadataToAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2AddMetadataToAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2AddMetadataToAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2AddMetadataToAccountResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2cancelevent.go b/pkg/models/operations/v2cancelevent.go new file mode 100755 index 00000000..18213ec4 --- /dev/null +++ b/pkg/models/operations/v2cancelevent.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CancelEventRequest struct { + // The instance id + InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` +} + +func (o *V2CancelEventRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +type V2CancelEventResponse struct { + // 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 + // General error + V2Error *shared.V2Error +} + +func (o *V2CancelEventResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CancelEventResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CancelEventResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CancelEventResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/v2countaccounts.go b/pkg/models/operations/v2countaccounts.go new file mode 100755 index 00000000..8fd6fd1b --- /dev/null +++ b/pkg/models/operations/v2countaccounts.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2CountAccountsRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2CountAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2CountAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2CountAccountsRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2CountAccountsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2CountAccountsRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2CountAccountsResponse struct { + // HTTP response content type for this operation + ContentType string + Headers map[string][]string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2CountAccountsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CountAccountsResponse) GetHeaders() map[string][]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *V2CountAccountsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CountAccountsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CountAccountsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2counttransactions.go b/pkg/models/operations/v2counttransactions.go new file mode 100755 index 00000000..3bea20e3 --- /dev/null +++ b/pkg/models/operations/v2counttransactions.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2CountTransactionsRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2CountTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2CountTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2CountTransactionsRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2CountTransactionsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2CountTransactionsRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2CountTransactionsResponse struct { + // HTTP response content type for this operation + ContentType string + Headers map[string][]string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2CountTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CountTransactionsResponse) GetHeaders() map[string][]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *V2CountTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CountTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CountTransactionsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2createbulk.go b/pkg/models/operations/v2createbulk.go new file mode 100755 index 00000000..d08ffb3c --- /dev/null +++ b/pkg/models/operations/v2createbulk.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CreateBulkRequest struct { + RequestBody []shared.V2BulkElement `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2CreateBulkRequest) GetRequestBody() []shared.V2BulkElement { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2CreateBulkRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2CreateBulkResponse struct { + // 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 + // OK + V2BulkResponse *shared.V2BulkResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2CreateBulkResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CreateBulkResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CreateBulkResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CreateBulkResponse) GetV2BulkResponse() *shared.V2BulkResponse { + if o == nil { + return nil + } + return o.V2BulkResponse +} + +func (o *V2CreateBulkResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2createledger.go b/pkg/models/operations/v2createledger.go new file mode 100755 index 00000000..d84ad090 --- /dev/null +++ b/pkg/models/operations/v2createledger.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CreateLedgerRequest struct { + V2CreateLedgerRequest *shared.V2CreateLedgerRequest `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2CreateLedgerRequest) GetV2CreateLedgerRequest() *shared.V2CreateLedgerRequest { + if o == nil { + return nil + } + return o.V2CreateLedgerRequest +} + +func (o *V2CreateLedgerRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2CreateLedgerResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2CreateLedgerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CreateLedgerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CreateLedgerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CreateLedgerResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2createtransaction.go b/pkg/models/operations/v2createtransaction.go new file mode 100755 index 00000000..7c198e49 --- /dev/null +++ b/pkg/models/operations/v2createtransaction.go @@ -0,0 +1,98 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CreateTransactionRequest struct { + // Use an idempotency key + IdempotencyKey *string `header:"style=simple,explode=false,name=Idempotency-Key"` + // The request body must contain at least one of the following objects: + // - `postings`: suitable for simple transactions + // - `script`: enabling more complex transactions with Numscript + // + V2PostTransaction shared.V2PostTransaction `request:"mediaType=application/json"` + // Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker. + DryRun *bool `queryParam:"style=form,explode=true,name=dryRun"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2CreateTransactionRequest) GetIdempotencyKey() *string { + if o == nil { + return nil + } + return o.IdempotencyKey +} + +func (o *V2CreateTransactionRequest) GetV2PostTransaction() shared.V2PostTransaction { + if o == nil { + return shared.V2PostTransaction{} + } + return o.V2PostTransaction +} + +func (o *V2CreateTransactionRequest) GetDryRun() *bool { + if o == nil { + return nil + } + return o.DryRun +} + +func (o *V2CreateTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2CreateTransactionResponse struct { + // 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 + // OK + V2CreateTransactionResponse *shared.V2CreateTransactionResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2CreateTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CreateTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CreateTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CreateTransactionResponse) GetV2CreateTransactionResponse() *shared.V2CreateTransactionResponse { + if o == nil { + return nil + } + return o.V2CreateTransactionResponse +} + +func (o *V2CreateTransactionResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2createtrigger.go b/pkg/models/operations/v2createtrigger.go new file mode 100755 index 00000000..f3d18a6c --- /dev/null +++ b/pkg/models/operations/v2createtrigger.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CreateTriggerResponse struct { + // 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 + // Created trigger + V2CreateTriggerResponse *shared.V2CreateTriggerResponse + // General error + V2Error *shared.V2Error +} + +func (o *V2CreateTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CreateTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CreateTriggerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CreateTriggerResponse) GetV2CreateTriggerResponse() *shared.V2CreateTriggerResponse { + if o == nil { + return nil + } + return o.V2CreateTriggerResponse +} + +func (o *V2CreateTriggerResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/v2createworkflow.go b/pkg/models/operations/v2createworkflow.go new file mode 100755 index 00000000..68dd72f0 --- /dev/null +++ b/pkg/models/operations/v2createworkflow.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2CreateWorkflowResponse struct { + // 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 + // Created workflow + V2CreateWorkflowResponse *shared.V2CreateWorkflowResponse + // General error + V2Error *shared.V2Error +} + +func (o *V2CreateWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2CreateWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2CreateWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2CreateWorkflowResponse) GetV2CreateWorkflowResponse() *shared.V2CreateWorkflowResponse { + if o == nil { + return nil + } + return o.V2CreateWorkflowResponse +} + +func (o *V2CreateWorkflowResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/v2deleteaccountmetadata.go b/pkg/models/operations/v2deleteaccountmetadata.go new file mode 100755 index 00000000..458ad403 --- /dev/null +++ b/pkg/models/operations/v2deleteaccountmetadata.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type V2DeleteAccountMetadataRequest struct { + // Account address + Address string `pathParam:"style=simple,explode=false,name=address"` + // The key to remove. + Key string `pathParam:"style=simple,explode=false,name=key"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2DeleteAccountMetadataRequest) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *V2DeleteAccountMetadataRequest) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *V2DeleteAccountMetadataRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2DeleteAccountMetadataResponse struct { + // 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 *V2DeleteAccountMetadataResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2DeleteAccountMetadataResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2DeleteAccountMetadataResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/pkg/models/operations/v2deletetransactionmetadata.go b/pkg/models/operations/v2deletetransactionmetadata.go new file mode 100755 index 00000000..9ff1a225 --- /dev/null +++ b/pkg/models/operations/v2deletetransactionmetadata.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "net/http" +) + +type V2DeleteTransactionMetadataRequest struct { + // Transaction ID. + ID *big.Int `pathParam:"style=simple,explode=false,name=id"` + // The key to remove. + Key string `pathParam:"style=simple,explode=false,name=key"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (v V2DeleteTransactionMetadataRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2DeleteTransactionMetadataRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2DeleteTransactionMetadataRequest) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2DeleteTransactionMetadataRequest) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *V2DeleteTransactionMetadataRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2DeleteTransactionMetadataResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2DeleteTransactionMetadataResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2DeleteTransactionMetadataResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2DeleteTransactionMetadataResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2DeleteTransactionMetadataResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2deletetrigger.go b/pkg/models/operations/v2deletetrigger.go new file mode 100755 index 00000000..c62d25c8 --- /dev/null +++ b/pkg/models/operations/v2deletetrigger.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2DeleteTriggerRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *V2DeleteTriggerRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type V2DeleteTriggerResponse struct { + // 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 + // General error + V2Error *shared.V2Error +} + +func (o *V2DeleteTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2DeleteTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2DeleteTriggerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2DeleteTriggerResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/v2deleteworkflow.go b/pkg/models/operations/v2deleteworkflow.go new file mode 100755 index 00000000..c84c370a --- /dev/null +++ b/pkg/models/operations/v2deleteworkflow.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2DeleteWorkflowRequest struct { + // The flow id + FlowID string `pathParam:"style=simple,explode=false,name=flowId"` +} + +func (o *V2DeleteWorkflowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + +type V2DeleteWorkflowResponse struct { + // 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 + // General error + V2Error *shared.V2Error +} + +func (o *V2DeleteWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2DeleteWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2DeleteWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2DeleteWorkflowResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/v2getaccount.go b/pkg/models/operations/v2getaccount.go new file mode 100755 index 00000000..fdfbfe88 --- /dev/null +++ b/pkg/models/operations/v2getaccount.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2GetAccountRequest 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"` + Expand *string `queryParam:"style=form,explode=true,name=expand"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2GetAccountRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2GetAccountRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2GetAccountRequest) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *V2GetAccountRequest) GetExpand() *string { + if o == nil { + return nil + } + return o.Expand +} + +func (o *V2GetAccountRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2GetAccountRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2GetAccountResponse struct { + // 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 + // OK + V2AccountResponse *shared.V2AccountResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2GetAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetAccountResponse) GetV2AccountResponse() *shared.V2AccountResponse { + if o == nil { + return nil + } + return o.V2AccountResponse +} + +func (o *V2GetAccountResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2getbalancesaggregated.go b/pkg/models/operations/v2getbalancesaggregated.go new file mode 100755 index 00000000..5489a2d5 --- /dev/null +++ b/pkg/models/operations/v2getbalancesaggregated.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2GetBalancesAggregatedRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2GetBalancesAggregatedRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2GetBalancesAggregatedRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2GetBalancesAggregatedRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2GetBalancesAggregatedRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2GetBalancesAggregatedRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2GetBalancesAggregatedResponse struct { + // 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 + // OK + V2AggregateBalancesResponse *shared.V2AggregateBalancesResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2GetBalancesAggregatedResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetBalancesAggregatedResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetBalancesAggregatedResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetBalancesAggregatedResponse) GetV2AggregateBalancesResponse() *shared.V2AggregateBalancesResponse { + if o == nil { + return nil + } + return o.V2AggregateBalancesResponse +} + +func (o *V2GetBalancesAggregatedResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2getinfo.go b/pkg/models/operations/v2getinfo.go new file mode 100755 index 00000000..b38384cb --- /dev/null +++ b/pkg/models/operations/v2getinfo.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetInfoResponse struct { + // 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 + // OK + V2ConfigInfoResponse *shared.V2ConfigInfoResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2GetInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetInfoResponse) GetV2ConfigInfoResponse() *shared.V2ConfigInfoResponse { + if o == nil { + return nil + } + return o.V2ConfigInfoResponse +} + +func (o *V2GetInfoResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2getinstance.go b/pkg/models/operations/v2getinstance.go new file mode 100755 index 00000000..be3d51f1 --- /dev/null +++ b/pkg/models/operations/v2getinstance.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetInstanceRequest struct { + // The instance id + InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` +} + +func (o *V2GetInstanceRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +type V2GetInstanceResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // The workflow instance + V2GetWorkflowInstanceResponse *shared.V2GetWorkflowInstanceResponse +} + +func (o *V2GetInstanceResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetInstanceResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetInstanceResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetInstanceResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2GetInstanceResponse) GetV2GetWorkflowInstanceResponse() *shared.V2GetWorkflowInstanceResponse { + if o == nil { + return nil + } + return o.V2GetWorkflowInstanceResponse +} diff --git a/pkg/models/operations/v2getinstancehistory.go b/pkg/models/operations/v2getinstancehistory.go new file mode 100755 index 00000000..3c24fd94 --- /dev/null +++ b/pkg/models/operations/v2getinstancehistory.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetInstanceHistoryRequest struct { + // The instance id + InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` +} + +func (o *V2GetInstanceHistoryRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +type V2GetInstanceHistoryResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // The workflow instance history + V2GetWorkflowInstanceHistoryResponse *shared.V2GetWorkflowInstanceHistoryResponse +} + +func (o *V2GetInstanceHistoryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetInstanceHistoryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetInstanceHistoryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetInstanceHistoryResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2GetInstanceHistoryResponse) GetV2GetWorkflowInstanceHistoryResponse() *shared.V2GetWorkflowInstanceHistoryResponse { + if o == nil { + return nil + } + return o.V2GetWorkflowInstanceHistoryResponse +} diff --git a/pkg/models/operations/v2getinstancestagehistory.go b/pkg/models/operations/v2getinstancestagehistory.go new file mode 100755 index 00000000..7fc653e4 --- /dev/null +++ b/pkg/models/operations/v2getinstancestagehistory.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetInstanceStageHistoryRequest struct { + // The instance id + InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` + // The stage number + Number int64 `pathParam:"style=simple,explode=false,name=number"` +} + +func (o *V2GetInstanceStageHistoryRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +func (o *V2GetInstanceStageHistoryRequest) GetNumber() int64 { + if o == nil { + return 0 + } + return o.Number +} + +type V2GetInstanceStageHistoryResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // The workflow instance stage history + V2GetWorkflowInstanceHistoryStageResponse *shared.V2GetWorkflowInstanceHistoryStageResponse +} + +func (o *V2GetInstanceStageHistoryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetInstanceStageHistoryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetInstanceStageHistoryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetInstanceStageHistoryResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2GetInstanceStageHistoryResponse) GetV2GetWorkflowInstanceHistoryStageResponse() *shared.V2GetWorkflowInstanceHistoryStageResponse { + if o == nil { + return nil + } + return o.V2GetWorkflowInstanceHistoryStageResponse +} diff --git a/pkg/models/operations/v2getledger.go b/pkg/models/operations/v2getledger.go new file mode 100755 index 00000000..512ae6d2 --- /dev/null +++ b/pkg/models/operations/v2getledger.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetLedgerRequest struct { + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2GetLedgerRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2GetLedgerResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2Ledger *shared.V2Ledger +} + +func (o *V2GetLedgerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetLedgerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetLedgerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetLedgerResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2GetLedgerResponse) GetV2Ledger() *shared.V2Ledger { + if o == nil { + return nil + } + return o.V2Ledger +} diff --git a/pkg/models/operations/v2getledgerinfo.go b/pkg/models/operations/v2getledgerinfo.go new file mode 100755 index 00000000..0828b84d --- /dev/null +++ b/pkg/models/operations/v2getledgerinfo.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetLedgerInfoRequest struct { + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2GetLedgerInfoRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2GetLedgerInfoResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2LedgerInfoResponse *shared.V2LedgerInfoResponse +} + +func (o *V2GetLedgerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetLedgerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetLedgerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetLedgerInfoResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2GetLedgerInfoResponse) GetV2LedgerInfoResponse() *shared.V2LedgerInfoResponse { + if o == nil { + return nil + } + return o.V2LedgerInfoResponse +} diff --git a/pkg/models/operations/v2getserverinfo.go b/pkg/models/operations/v2getserverinfo.go new file mode 100755 index 00000000..16e420f0 --- /dev/null +++ b/pkg/models/operations/v2getserverinfo.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetServerInfoResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // Server information + V2ServerInfo *shared.V2ServerInfo +} + +func (o *V2GetServerInfoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetServerInfoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetServerInfoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetServerInfoResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2GetServerInfoResponse) GetV2ServerInfo() *shared.V2ServerInfo { + if o == nil { + return nil + } + return o.V2ServerInfo +} diff --git a/pkg/models/operations/v2gettransaction.go b/pkg/models/operations/v2gettransaction.go new file mode 100755 index 00000000..3bddc1b5 --- /dev/null +++ b/pkg/models/operations/v2gettransaction.go @@ -0,0 +1,107 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "net/http" + "time" +) + +type V2GetTransactionRequest struct { + Expand *string `queryParam:"style=form,explode=true,name=expand"` + // Transaction ID. + ID *big.Int `pathParam:"style=simple,explode=false,name=id"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2GetTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2GetTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2GetTransactionRequest) GetExpand() *string { + if o == nil { + return nil + } + return o.Expand +} + +func (o *V2GetTransactionRequest) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2GetTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2GetTransactionRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2GetTransactionResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2GetTransactionResponse *shared.V2GetTransactionResponse +} + +func (o *V2GetTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetTransactionResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2GetTransactionResponse) GetV2GetTransactionResponse() *shared.V2GetTransactionResponse { + if o == nil { + return nil + } + return o.V2GetTransactionResponse +} diff --git a/pkg/models/operations/v2getworkflow.go b/pkg/models/operations/v2getworkflow.go new file mode 100755 index 00000000..87523eb7 --- /dev/null +++ b/pkg/models/operations/v2getworkflow.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2GetWorkflowRequest struct { + // The flow id + FlowID string `pathParam:"style=simple,explode=false,name=flowId"` +} + +func (o *V2GetWorkflowRequest) GetFlowID() string { + if o == nil { + return "" + } + return o.FlowID +} + +type V2GetWorkflowResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // The workflow + V2GetWorkflowResponse *shared.V2GetWorkflowResponse +} + +func (o *V2GetWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2GetWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2GetWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2GetWorkflowResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2GetWorkflowResponse) GetV2GetWorkflowResponse() *shared.V2GetWorkflowResponse { + if o == nil { + return nil + } + return o.V2GetWorkflowResponse +} diff --git a/pkg/models/operations/v2listaccounts.go b/pkg/models/operations/v2listaccounts.go new file mode 100755 index 00000000..c8a80819 --- /dev/null +++ b/pkg/models/operations/v2listaccounts.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2ListAccountsRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // 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"` + Expand *string `queryParam:"style=form,explode=true,name=expand"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // The maximum number of results to return per page. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2ListAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2ListAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2ListAccountsRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2ListAccountsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *V2ListAccountsRequest) GetExpand() *string { + if o == nil { + return nil + } + return o.Expand +} + +func (o *V2ListAccountsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2ListAccountsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *V2ListAccountsRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2ListAccountsResponse struct { + // 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 + // OK + V2AccountsCursorResponse *shared.V2AccountsCursorResponse + // Error + V2ErrorResponse *shared.V2ErrorResponse +} + +func (o *V2ListAccountsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListAccountsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListAccountsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListAccountsResponse) GetV2AccountsCursorResponse() *shared.V2AccountsCursorResponse { + if o == nil { + return nil + } + return o.V2AccountsCursorResponse +} + +func (o *V2ListAccountsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} diff --git a/pkg/models/operations/v2listinstances.go b/pkg/models/operations/v2listinstances.go new file mode 100755 index 00000000..4b476f59 --- /dev/null +++ b/pkg/models/operations/v2listinstances.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ListInstancesRequest struct { + // Filter running instances + Running *bool `queryParam:"style=form,explode=true,name=running"` + // A workflow id + WorkflowID *string `queryParam:"style=form,explode=true,name=workflowID"` +} + +func (o *V2ListInstancesRequest) GetRunning() *bool { + if o == nil { + return nil + } + return o.Running +} + +func (o *V2ListInstancesRequest) GetWorkflowID() *string { + if o == nil { + return nil + } + return o.WorkflowID +} + +type V2ListInstancesResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // List of workflow instances + V2ListRunsResponse *shared.V2ListRunsResponse +} + +func (o *V2ListInstancesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListInstancesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListInstancesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListInstancesResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2ListInstancesResponse) GetV2ListRunsResponse() *shared.V2ListRunsResponse { + if o == nil { + return nil + } + return o.V2ListRunsResponse +} diff --git a/pkg/models/operations/v2listledgers.go b/pkg/models/operations/v2listledgers.go new file mode 100755 index 00000000..aa2377aa --- /dev/null +++ b/pkg/models/operations/v2listledgers.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ListLedgersRequest struct { + // 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 `queryParam:"style=form,explode=true,name=pageSize"` +} + +func (o *V2ListLedgersRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *V2ListLedgersRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +type V2ListLedgersResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2LedgerListResponse *shared.V2LedgerListResponse +} + +func (o *V2ListLedgersResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListLedgersResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListLedgersResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListLedgersResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2ListLedgersResponse) GetV2LedgerListResponse() *shared.V2LedgerListResponse { + if o == nil { + return nil + } + return o.V2LedgerListResponse +} diff --git a/pkg/models/operations/v2listlogs.go b/pkg/models/operations/v2listlogs.go new file mode 100755 index 00000000..6b909f10 --- /dev/null +++ b/pkg/models/operations/v2listlogs.go @@ -0,0 +1,120 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2ListLogsRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // 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"` + // The maximum number of results to return per page. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2ListLogsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2ListLogsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2ListLogsRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2ListLogsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *V2ListLogsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2ListLogsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *V2ListLogsRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2ListLogsResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2LogsCursorResponse *shared.V2LogsCursorResponse +} + +func (o *V2ListLogsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListLogsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListLogsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListLogsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2ListLogsResponse) GetV2LogsCursorResponse() *shared.V2LogsCursorResponse { + if o == nil { + return nil + } + return o.V2LogsCursorResponse +} diff --git a/pkg/models/operations/v2listtransactions.go b/pkg/models/operations/v2listtransactions.go new file mode 100755 index 00000000..c7f9a150 --- /dev/null +++ b/pkg/models/operations/v2listtransactions.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "net/http" + "time" +) + +type V2ListTransactionsRequest struct { + RequestBody map[string]interface{} `request:"mediaType=application/json"` + // 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"` + Expand *string `queryParam:"style=form,explode=true,name=expand"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` + // The maximum number of results to return per page. + // + PageSize *int64 `queryParam:"style=form,explode=true,name=pageSize"` + Pit *time.Time `queryParam:"style=form,explode=true,name=pit"` +} + +func (v V2ListTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2ListTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2ListTransactionsRequest) GetRequestBody() map[string]interface{} { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2ListTransactionsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *V2ListTransactionsRequest) GetExpand() *string { + if o == nil { + return nil + } + return o.Expand +} + +func (o *V2ListTransactionsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2ListTransactionsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *V2ListTransactionsRequest) GetPit() *time.Time { + if o == nil { + return nil + } + return o.Pit +} + +type V2ListTransactionsResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2TransactionsCursorResponse *shared.V2TransactionsCursorResponse +} + +func (o *V2ListTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListTransactionsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2ListTransactionsResponse) GetV2TransactionsCursorResponse() *shared.V2TransactionsCursorResponse { + if o == nil { + return nil + } + return o.V2TransactionsCursorResponse +} diff --git a/pkg/models/operations/v2listtriggers.go b/pkg/models/operations/v2listtriggers.go new file mode 100755 index 00000000..8eb31957 --- /dev/null +++ b/pkg/models/operations/v2listtriggers.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ListTriggersResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // List of triggers + V2ListTriggersResponse *shared.V2ListTriggersResponse +} + +func (o *V2ListTriggersResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListTriggersResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListTriggersResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListTriggersResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2ListTriggersResponse) GetV2ListTriggersResponse() *shared.V2ListTriggersResponse { + if o == nil { + return nil + } + return o.V2ListTriggersResponse +} diff --git a/pkg/models/operations/v2listtriggersoccurrences.go b/pkg/models/operations/v2listtriggersoccurrences.go new file mode 100755 index 00000000..f8ad61de --- /dev/null +++ b/pkg/models/operations/v2listtriggersoccurrences.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ListTriggersOccurrencesRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *V2ListTriggersOccurrencesRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type V2ListTriggersOccurrencesResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // List of triggers occurrences + V2ListTriggersOccurrencesResponse *shared.V2ListTriggersOccurrencesResponse +} + +func (o *V2ListTriggersOccurrencesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListTriggersOccurrencesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListTriggersOccurrencesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListTriggersOccurrencesResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2ListTriggersOccurrencesResponse) GetV2ListTriggersOccurrencesResponse() *shared.V2ListTriggersOccurrencesResponse { + if o == nil { + return nil + } + return o.V2ListTriggersOccurrencesResponse +} diff --git a/pkg/models/operations/v2listworkflows.go b/pkg/models/operations/v2listworkflows.go new file mode 100755 index 00000000..647eeb23 --- /dev/null +++ b/pkg/models/operations/v2listworkflows.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ListWorkflowsResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // List of workflows + V2ListWorkflowsResponse *shared.V2ListWorkflowsResponse +} + +func (o *V2ListWorkflowsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ListWorkflowsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ListWorkflowsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ListWorkflowsResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2ListWorkflowsResponse) GetV2ListWorkflowsResponse() *shared.V2ListWorkflowsResponse { + if o == nil { + return nil + } + return o.V2ListWorkflowsResponse +} diff --git a/pkg/models/operations/v2readstats.go b/pkg/models/operations/v2readstats.go new file mode 100755 index 00000000..30e4bf84 --- /dev/null +++ b/pkg/models/operations/v2readstats.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ReadStatsRequest struct { + // name of the ledger + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (o *V2ReadStatsRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2ReadStatsResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2StatsResponse *shared.V2StatsResponse +} + +func (o *V2ReadStatsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ReadStatsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ReadStatsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ReadStatsResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2ReadStatsResponse) GetV2StatsResponse() *shared.V2StatsResponse { + if o == nil { + return nil + } + return o.V2StatsResponse +} diff --git a/pkg/models/operations/v2readtrigger.go b/pkg/models/operations/v2readtrigger.go new file mode 100755 index 00000000..8433dcef --- /dev/null +++ b/pkg/models/operations/v2readtrigger.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2ReadTriggerRequest struct { + // The trigger id + TriggerID string `pathParam:"style=simple,explode=false,name=triggerID"` +} + +func (o *V2ReadTriggerRequest) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +type V2ReadTriggerResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // A specific trigger + V2ReadTriggerResponse *shared.V2ReadTriggerResponse +} + +func (o *V2ReadTriggerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2ReadTriggerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2ReadTriggerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2ReadTriggerResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2ReadTriggerResponse) GetV2ReadTriggerResponse() *shared.V2ReadTriggerResponse { + if o == nil { + return nil + } + return o.V2ReadTriggerResponse +} diff --git a/pkg/models/operations/v2reverttransaction.go b/pkg/models/operations/v2reverttransaction.go new file mode 100755 index 00000000..493f459f --- /dev/null +++ b/pkg/models/operations/v2reverttransaction.go @@ -0,0 +1,99 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "net/http" +) + +type V2RevertTransactionRequest struct { + // Force revert + Force *bool `queryParam:"style=form,explode=true,name=force"` + // Transaction ID. + ID *big.Int `pathParam:"style=simple,explode=false,name=id"` + // Name of the ledger. + Ledger string `pathParam:"style=simple,explode=false,name=ledger"` +} + +func (v V2RevertTransactionRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2RevertTransactionRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2RevertTransactionRequest) GetForce() *bool { + if o == nil { + return nil + } + return o.Force +} + +func (o *V2RevertTransactionRequest) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2RevertTransactionRequest) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +type V2RevertTransactionResponse struct { + // 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 + // Error + V2ErrorResponse *shared.V2ErrorResponse + // OK + V2RevertTransactionResponse *shared.V2RevertTransactionResponse +} + +func (o *V2RevertTransactionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2RevertTransactionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2RevertTransactionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2RevertTransactionResponse) GetV2ErrorResponse() *shared.V2ErrorResponse { + if o == nil { + return nil + } + return o.V2ErrorResponse +} + +func (o *V2RevertTransactionResponse) GetV2RevertTransactionResponse() *shared.V2RevertTransactionResponse { + if o == nil { + return nil + } + return o.V2RevertTransactionResponse +} diff --git a/pkg/models/operations/v2runworkflow.go b/pkg/models/operations/v2runworkflow.go new file mode 100755 index 00000000..8ed9ad0a --- /dev/null +++ b/pkg/models/operations/v2runworkflow.go @@ -0,0 +1,85 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2RunWorkflowRequest struct { + RequestBody map[string]string `request:"mediaType=application/json"` + // Wait end of the workflow before return + Wait *bool `queryParam:"style=form,explode=true,name=wait"` + // The flow id + WorkflowID string `pathParam:"style=simple,explode=false,name=workflowID"` +} + +func (o *V2RunWorkflowRequest) GetRequestBody() map[string]string { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2RunWorkflowRequest) GetWait() *bool { + if o == nil { + return nil + } + return o.Wait +} + +func (o *V2RunWorkflowRequest) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} + +type V2RunWorkflowResponse struct { + // 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 + // General error + V2Error *shared.V2Error + // The workflow instance + V2RunWorkflowResponse *shared.V2RunWorkflowResponse +} + +func (o *V2RunWorkflowResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2RunWorkflowResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2RunWorkflowResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2RunWorkflowResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} + +func (o *V2RunWorkflowResponse) GetV2RunWorkflowResponse() *shared.V2RunWorkflowResponse { + if o == nil { + return nil + } + return o.V2RunWorkflowResponse +} diff --git a/pkg/models/operations/v2sendevent.go b/pkg/models/operations/v2sendevent.go new file mode 100755 index 00000000..2d8aa7a6 --- /dev/null +++ b/pkg/models/operations/v2sendevent.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "net/http" +) + +type V2SendEventRequestBody struct { + Name string `json:"name"` +} + +func (o *V2SendEventRequestBody) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +type V2SendEventRequest struct { + RequestBody *V2SendEventRequestBody `request:"mediaType=application/json"` + // The instance id + InstanceID string `pathParam:"style=simple,explode=false,name=instanceID"` +} + +func (o *V2SendEventRequest) GetRequestBody() *V2SendEventRequestBody { + if o == nil { + return nil + } + return o.RequestBody +} + +func (o *V2SendEventRequest) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +type V2SendEventResponse struct { + // 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 + // General error + V2Error *shared.V2Error +} + +func (o *V2SendEventResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *V2SendEventResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *V2SendEventResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *V2SendEventResponse) GetV2Error() *shared.V2Error { + if o == nil { + return nil + } + return o.V2Error +} diff --git a/pkg/models/operations/voidhold.go b/pkg/models/operations/voidhold.go index 0b3b8fb1..550ccaf6 100755 --- a/pkg/models/operations/voidhold.go +++ b/pkg/models/operations/voidhold.go @@ -11,10 +11,48 @@ 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 { + // 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 } + +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 bd4ce6d2..b8e5d9b2 100755 --- a/pkg/models/operations/walletsgetserverinfo.go +++ b/pkg/models/operations/walletsgetserverinfo.go @@ -8,11 +8,49 @@ 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 } + +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 00000000..5c1affd3 --- /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 ba22321c..efda422b 100755 --- a/pkg/models/shared/account.go +++ b/pkg/models/shared/account.go @@ -7,3 +7,24 @@ type Account struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Type *string `json:"type,omitempty"` } + +func (o *Account) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *Account) GetMetadata() map[string]interface{} { + 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 7723b0bc..f49384a2 100755 --- a/pkg/models/shared/accountresponse.go +++ b/pkg/models/shared/accountresponse.go @@ -2,7 +2,13 @@ package shared -// AccountResponse - OK 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 deleted file mode 100755 index f1fff961..00000000 --- a/pkg/models/shared/accountscursor.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type AccountsCursorCursor struct { - Data []PaymentsAccount `json:"data"` - HasMore bool `json:"hasMore"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` -} - -// AccountsCursor - OK -type AccountsCursor struct { - Cursor AccountsCursorCursor `json:"cursor"` -} diff --git a/pkg/models/shared/accountscursorresponse.go b/pkg/models/shared/accountscursorresponse.go index 31e7e863..4e748b9c 100755 --- a/pkg/models/shared/accountscursorresponse.go +++ b/pkg/models/shared/accountscursorresponse.go @@ -10,7 +10,48 @@ type AccountsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// AccountsCursorResponse - OK +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 3021a5d3..f439cc02 100755 --- a/pkg/models/shared/accountwithvolumesandbalances.go +++ b/pkg/models/shared/accountwithvolumesandbalances.go @@ -3,13 +3,60 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) type AccountWithVolumesAndBalances struct { - Address string `json:"address"` - Balances map[string]*big.Int `json:"balances,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Type *string `json:"type,omitempty"` - Volumes map[string]map[string]*big.Int `json:"volumes,omitempty"` + Address string `json:"address"` + Balances map[string]*big.Int `json:"balances,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Type *string `json:"type,omitempty"` + Volumes map[string]Volume `json:"volumes,omitempty"` +} + +func (a AccountWithVolumesAndBalances) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountWithVolumesAndBalances) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountWithVolumesAndBalances) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *AccountWithVolumesAndBalances) GetBalances() map[string]*big.Int { + if o == nil { + return nil + } + return o.Balances +} + +func (o *AccountWithVolumesAndBalances) GetMetadata() map[string]interface{} { + 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]Volume { + if o == nil { + return nil + } + return o.Volumes } diff --git a/pkg/models/shared/activityconfirmhold.go b/pkg/models/shared/activityconfirmhold.go index 3315e7e8..50bd6b79 100755 --- a/pkg/models/shared/activityconfirmhold.go +++ b/pkg/models/shared/activityconfirmhold.go @@ -5,3 +5,10 @@ package shared type ActivityConfirmHold struct { ID string `json:"id"` } + +func (o *ActivityConfirmHold) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/activitycreatetransaction.go b/pkg/models/shared/activitycreatetransaction.go index c8a82652..0b8d5673 100755 --- a/pkg/models/shared/activitycreatetransaction.go +++ b/pkg/models/shared/activitycreatetransaction.go @@ -3,6 +3,20 @@ package shared type ActivityCreateTransaction struct { - Data *PostTransaction `json:"data,omitempty"` - Ledger *string `json:"ledger,omitempty"` + Data *OrchestrationPostTransaction `json:"data,omitempty"` + Ledger *string `json:"ledger,omitempty"` +} + +func (o *ActivityCreateTransaction) GetData() *OrchestrationPostTransaction { + if o == nil { + return nil + } + return o.Data +} + +func (o *ActivityCreateTransaction) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger } diff --git a/pkg/models/shared/activitycreatetransactionoutput.go b/pkg/models/shared/activitycreatetransactionoutput.go index 19b827af..4c94cc17 100755 --- a/pkg/models/shared/activitycreatetransactionoutput.go +++ b/pkg/models/shared/activitycreatetransactionoutput.go @@ -3,5 +3,12 @@ package shared type ActivityCreateTransactionOutput struct { - Data Transaction `json:"data"` + Data OrchestrationTransaction `json:"data"` +} + +func (o *ActivityCreateTransactionOutput) GetData() OrchestrationTransaction { + if o == nil { + return OrchestrationTransaction{} + } + return o.Data } diff --git a/pkg/models/shared/activitycreditwallet.go b/pkg/models/shared/activitycreditwallet.go index 3a7ef214..6194baef 100755 --- a/pkg/models/shared/activitycreditwallet.go +++ b/pkg/models/shared/activitycreditwallet.go @@ -6,3 +6,17 @@ type ActivityCreditWallet struct { Data *CreditWalletRequest `json:"data,omitempty"` ID *string `json:"id,omitempty"` } + +func (o *ActivityCreditWallet) GetData() *CreditWalletRequest { + if o == nil { + return nil + } + return o.Data +} + +func (o *ActivityCreditWallet) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/pkg/models/shared/activitydebitwallet.go b/pkg/models/shared/activitydebitwallet.go index 0a034ad9..ccb782d3 100755 --- a/pkg/models/shared/activitydebitwallet.go +++ b/pkg/models/shared/activitydebitwallet.go @@ -6,3 +6,17 @@ type ActivityDebitWallet struct { Data *DebitWalletRequest `json:"data,omitempty"` ID *string `json:"id,omitempty"` } + +func (o *ActivityDebitWallet) GetData() *DebitWalletRequest { + if o == nil { + return nil + } + return o.Data +} + +func (o *ActivityDebitWallet) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/pkg/models/shared/activitydebitwalletoutput.go b/pkg/models/shared/activitydebitwalletoutput.go index 8f6a9051..47c75ece 100755 --- a/pkg/models/shared/activitydebitwalletoutput.go +++ b/pkg/models/shared/activitydebitwalletoutput.go @@ -5,3 +5,10 @@ package shared type ActivityDebitWalletOutput struct { Data Hold `json:"data"` } + +func (o *ActivityDebitWalletOutput) GetData() Hold { + if o == nil { + return Hold{} + } + return o.Data +} diff --git a/pkg/models/shared/activitygetaccount.go b/pkg/models/shared/activitygetaccount.go index a790993a..99071270 100755 --- a/pkg/models/shared/activitygetaccount.go +++ b/pkg/models/shared/activitygetaccount.go @@ -6,3 +6,17 @@ type ActivityGetAccount struct { ID string `json:"id"` Ledger string `json:"ledger"` } + +func (o *ActivityGetAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ActivityGetAccount) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} diff --git a/pkg/models/shared/activitygetaccountoutput.go b/pkg/models/shared/activitygetaccountoutput.go index 75b60439..1c7b619c 100755 --- a/pkg/models/shared/activitygetaccountoutput.go +++ b/pkg/models/shared/activitygetaccountoutput.go @@ -3,5 +3,12 @@ package shared type ActivityGetAccountOutput struct { - Data AccountWithVolumesAndBalances `json:"data"` + Data OrchestrationAccount `json:"data"` +} + +func (o *ActivityGetAccountOutput) GetData() OrchestrationAccount { + if o == nil { + return OrchestrationAccount{} + } + return o.Data } diff --git a/pkg/models/shared/activitygetpayment.go b/pkg/models/shared/activitygetpayment.go index f290503c..26e41bb8 100755 --- a/pkg/models/shared/activitygetpayment.go +++ b/pkg/models/shared/activitygetpayment.go @@ -5,3 +5,10 @@ package shared type ActivityGetPayment struct { ID string `json:"id"` } + +func (o *ActivityGetPayment) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/activitygetpaymentoutput.go b/pkg/models/shared/activitygetpaymentoutput.go index b0384c01..30a17d03 100755 --- a/pkg/models/shared/activitygetpaymentoutput.go +++ b/pkg/models/shared/activitygetpaymentoutput.go @@ -5,3 +5,10 @@ package shared type ActivityGetPaymentOutput struct { Data Payment `json:"data"` } + +func (o *ActivityGetPaymentOutput) GetData() Payment { + if o == nil { + return Payment{} + } + return o.Data +} diff --git a/pkg/models/shared/activitygetwallet.go b/pkg/models/shared/activitygetwallet.go index ddd0f473..9fb5757a 100755 --- a/pkg/models/shared/activitygetwallet.go +++ b/pkg/models/shared/activitygetwallet.go @@ -5,3 +5,10 @@ package shared type ActivityGetWallet struct { ID string `json:"id"` } + +func (o *ActivityGetWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/activitygetwalletoutput.go b/pkg/models/shared/activitygetwalletoutput.go index 6059452c..5aa1b980 100755 --- a/pkg/models/shared/activitygetwalletoutput.go +++ b/pkg/models/shared/activitygetwalletoutput.go @@ -5,3 +5,10 @@ package shared type ActivityGetWalletOutput struct { Data WalletWithBalances `json:"data"` } + +func (o *ActivityGetWalletOutput) GetData() WalletWithBalances { + if o == nil { + return WalletWithBalances{} + } + return o.Data +} diff --git a/pkg/models/shared/activityreverttransaction.go b/pkg/models/shared/activityreverttransaction.go deleted file mode 100755 index 9e33a4cb..00000000 --- a/pkg/models/shared/activityreverttransaction.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type ActivityRevertTransaction struct { - ID string `json:"id"` - Ledger string `json:"ledger"` -} diff --git a/pkg/models/shared/activityreverttransactionoutput.go b/pkg/models/shared/activityreverttransactionoutput.go deleted file mode 100755 index e6b8490d..00000000 --- a/pkg/models/shared/activityreverttransactionoutput.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type ActivityRevertTransactionOutput struct { - Data Transaction `json:"data"` -} diff --git a/pkg/models/shared/activitystripetransfer.go b/pkg/models/shared/activitystripetransfer.go index df4bc6bd..8e622234 100755 --- a/pkg/models/shared/activitystripetransfer.go +++ b/pkg/models/shared/activitystripetransfer.go @@ -2,12 +2,77 @@ package shared +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +// ActivityStripeTransferMetadata - 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 ActivityStripeTransferMetadata struct { +} + type ActivityStripeTransfer struct { - Amount *int64 `json:"amount,omitempty"` - Asset *string `json:"asset,omitempty"` - Destination *string `json:"destination,omitempty"` + Amount *big.Int `json:"amount,omitempty"` + Asset *string `json:"asset,omitempty"` + ConnectorID *string `json:"connectorID,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 map[string]interface{} `json:"metadata,omitempty"` + Metadata *ActivityStripeTransferMetadata `json:"metadata,omitempty"` + WaitingValidation *bool `default:"false" json:"waitingValidation"` +} + +func (a ActivityStripeTransfer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ActivityStripeTransfer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ActivityStripeTransfer) GetAmount() *big.Int { + if o == nil { + return nil + } + return o.Amount +} + +func (o *ActivityStripeTransfer) GetAsset() *string { + if o == nil { + return nil + } + return o.Asset +} + +func (o *ActivityStripeTransfer) GetConnectorID() *string { + if o == nil { + return nil + } + return o.ConnectorID +} + +func (o *ActivityStripeTransfer) GetDestination() *string { + if o == nil { + return nil + } + return o.Destination +} + +func (o *ActivityStripeTransfer) GetMetadata() *ActivityStripeTransferMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ActivityStripeTransfer) GetWaitingValidation() *bool { + if o == nil { + return nil + } + return o.WaitingValidation } diff --git a/pkg/models/shared/activityvoidhold.go b/pkg/models/shared/activityvoidhold.go index 86ff620d..b020aa4f 100755 --- a/pkg/models/shared/activityvoidhold.go +++ b/pkg/models/shared/activityvoidhold.go @@ -5,3 +5,10 @@ package shared type ActivityVoidHold struct { ID string `json:"id"` } + +func (o *ActivityVoidHold) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/aggregatebalancesresponse.go b/pkg/models/shared/aggregatebalancesresponse.go index c46835a1..bddd515c 100755 --- a/pkg/models/shared/aggregatebalancesresponse.go +++ b/pkg/models/shared/aggregatebalancesresponse.go @@ -2,11 +2,13 @@ package shared -import ( - "math/big" -) - -// AggregateBalancesResponse - OK type AggregateBalancesResponse struct { - Data map[string]*big.Int `json:"data"` + 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 0757d927..a8107ee8 100755 --- a/pkg/models/shared/assetholder.go +++ b/pkg/models/shared/assetholder.go @@ -3,9 +3,28 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) type AssetHolder struct { Assets map[string]*big.Int `json:"assets"` } + +func (a AssetHolder) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AssetHolder) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AssetHolder) GetAssets() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.Assets +} diff --git a/pkg/models/shared/attempt.go b/pkg/models/shared/attempt.go index 5b6cff85..2e9edc90 100755 --- a/pkg/models/shared/attempt.go +++ b/pkg/models/shared/attempt.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -18,3 +19,84 @@ type Attempt struct { UpdatedAt time.Time `json:"updatedAt"` WebhookID string `json:"webhookID"` } + +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 WebhooksConfig{} + } + return o.Config +} + +func (o *Attempt) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Attempt) GetID() string { + if o == nil { + return "" + } + 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 "" + } + return o.Payload +} + +func (o *Attempt) GetRetryAttempt() int64 { + if o == nil { + return 0 + } + return o.RetryAttempt +} + +func (o *Attempt) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *Attempt) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *Attempt) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *Attempt) GetWebhookID() string { + if o == nil { + return "" + } + return o.WebhookID +} diff --git a/pkg/models/shared/attemptresponse.go b/pkg/models/shared/attemptresponse.go index d71249f2..3d1c8ee1 100755 --- a/pkg/models/shared/attemptresponse.go +++ b/pkg/models/shared/attemptresponse.go @@ -2,7 +2,13 @@ package shared -// AttemptResponse - OK type AttemptResponse struct { 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 a7319551..94c5e79b 100755 --- a/pkg/models/shared/balance.go +++ b/pkg/models/shared/balance.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" "time" ) @@ -12,3 +13,35 @@ type Balance struct { Name string `json:"name"` Priority *big.Int `json:"priority,omitempty"` } + +func (b Balance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *Balance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Balance) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} + +func (o *Balance) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Balance) GetPriority() *big.Int { + if o == nil { + return nil + } + return o.Priority +} diff --git a/pkg/models/shared/balancescursorresponse.go b/pkg/models/shared/balancescursorresponse.go index d66edc12..f88267a2 100755 --- a/pkg/models/shared/balancescursorresponse.go +++ b/pkg/models/shared/balancescursorresponse.go @@ -2,19 +2,56 @@ package shared -import ( - "math/big" -) - type BalancesCursorResponseCursor struct { - Data []map[string]map[string]*big.Int `json:"data"` - HasMore bool `json:"hasMore"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` + Data []map[string]map[string]int64 `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + 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 } -// BalancesCursorResponse - OK 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 c30e7f83..155dc934 100755 --- a/pkg/models/shared/balancewithassets.go +++ b/pkg/models/shared/balancewithassets.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" "time" ) @@ -13,3 +14,42 @@ type BalanceWithAssets struct { Name string `json:"name"` Priority *big.Int `json:"priority,omitempty"` } + +func (b BalanceWithAssets) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BalanceWithAssets) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + +func (o *BalanceWithAssets) GetAssets() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.Assets +} + +func (o *BalanceWithAssets) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} + +func (o *BalanceWithAssets) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *BalanceWithAssets) GetPriority() *big.Int { + if o == nil { + return nil + } + return o.Priority +} diff --git a/pkg/models/shared/bankingcircleconfig.go b/pkg/models/shared/bankingcircleconfig.go deleted file mode 100755 index 388dbc55..00000000 --- a/pkg/models/shared/bankingcircleconfig.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type BankingCircleConfig struct { - AuthorizationEndpoint string `json:"authorizationEndpoint"` - Endpoint string `json:"endpoint"` - Password string `json:"password"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` - UserCertificate string `json:"userCertificate"` - UserCertificateKey string `json:"userCertificateKey"` - Username string `json:"username"` -} diff --git a/pkg/models/shared/client.go b/pkg/models/shared/client.go index 3c22ab6e..54ddd372 100755 --- a/pkg/models/shared/client.go +++ b/pkg/models/shared/client.go @@ -14,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 a04c73aa..1d602c20 100755 --- a/pkg/models/shared/clientsecret.go +++ b/pkg/models/shared/clientsecret.go @@ -8,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 768593fd..ee902b80 100755 --- a/pkg/models/shared/config.go +++ b/pkg/models/shared/config.go @@ -5,3 +5,10 @@ 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 4d07b35d..c845a7ec 100755 --- a/pkg/models/shared/configchangesecret.go +++ b/pkg/models/shared/configchangesecret.go @@ -5,3 +5,10 @@ package shared type ConfigChangeSecret struct { Secret string `json:"secret"` } + +func (o *ConfigChangeSecret) GetSecret() string { + if o == nil { + return "" + } + return o.Secret +} diff --git a/pkg/models/shared/configinfo.go b/pkg/models/shared/configinfo.go index 1a63dada..3ea9452b 100755 --- a/pkg/models/shared/configinfo.go +++ b/pkg/models/shared/configinfo.go @@ -7,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 d16bd4a5..1ffc24a4 100755 --- a/pkg/models/shared/configinforesponse.go +++ b/pkg/models/shared/configinforesponse.go @@ -2,7 +2,13 @@ package shared -// ConfigInfoResponse - OK 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 94eb4d33..3be0a42a 100755 --- a/pkg/models/shared/configresponse.go +++ b/pkg/models/shared/configresponse.go @@ -2,7 +2,13 @@ package shared -// ConfigResponse - Config created successfully. type ConfigResponse struct { 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 7d76b76a..f56a90e4 100755 --- a/pkg/models/shared/configsresponse.go +++ b/pkg/models/shared/configsresponse.go @@ -7,7 +7,27 @@ type ConfigsResponseCursor struct { HasMore bool `json:"hasMore"` } -// ConfigsResponse - OK +func (o *ConfigsResponseCursor) GetData() []WebhooksConfig { + if o == nil { + return []WebhooksConfig{} + } + return o.Data +} + +func (o *ConfigsResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + 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 383c314d..8f37fd37 100755 --- a/pkg/models/shared/configuser.go +++ b/pkg/models/shared/configuser.go @@ -7,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 3e7f167d..46e891e1 100755 --- a/pkg/models/shared/confirmholdrequest.go +++ b/pkg/models/shared/confirmholdrequest.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -12,3 +13,28 @@ type ConfirmHoldRequest struct { // Define a final confirmation. Remaining funds will be returned to the wallet. Final *bool `json:"final,omitempty"` } + +func (c ConfirmHoldRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ConfirmHoldRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ConfirmHoldRequest) GetAmount() *big.Int { + 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 index c17bccbc..77dd560b 100755 --- a/pkg/models/shared/connector.go +++ b/pkg/models/shared/connector.go @@ -7,7 +7,6 @@ import ( "fmt" ) -// Connector - The name of the connector. type Connector string const ( diff --git a/pkg/models/shared/connectorconfigresponse.go b/pkg/models/shared/connectorconfigresponse.go deleted file mode 100755 index 469180f6..00000000 --- a/pkg/models/shared/connectorconfigresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// ConnectorConfigResponse - OK -type ConnectorConfigResponse struct { - Data interface{} `json:"data"` -} diff --git a/pkg/models/shared/connectorsconfigsresponse.go b/pkg/models/shared/connectorsconfigsresponse.go deleted file mode 100755 index 8c33db5d..00000000 --- a/pkg/models/shared/connectorsconfigsresponse.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type ConnectorsConfigsResponseDataConnectorKey struct { - DataType string `json:"dataType"` - Required bool `json:"required"` -} - -type ConnectorsConfigsResponseDataConnector struct { - Key ConnectorsConfigsResponseDataConnectorKey `json:"key"` -} - -type ConnectorsConfigsResponseData struct { - Connector ConnectorsConfigsResponseDataConnector `json:"connector"` -} - -// ConnectorsConfigsResponse - OK -type ConnectorsConfigsResponse struct { - Data ConnectorsConfigsResponseData `json:"data"` -} diff --git a/pkg/models/shared/connectorsresponse.go b/pkg/models/shared/connectorsresponse.go deleted file mode 100755 index b194fa73..00000000 --- a/pkg/models/shared/connectorsresponse.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type ConnectorsResponseData struct { - Enabled *bool `json:"enabled,omitempty"` - Provider *Connector `json:"provider,omitempty"` -} - -// ConnectorsResponse - OK -type ConnectorsResponse struct { - Data []ConnectorsResponseData `json:"data"` -} diff --git a/pkg/models/shared/contract.go b/pkg/models/shared/contract.go index f1e18ddf..1166b483 100755 --- a/pkg/models/shared/contract.go +++ b/pkg/models/shared/contract.go @@ -2,7 +2,24 @@ 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 3b022fab..463f40ac 100755 --- a/pkg/models/shared/createbalancerequest.go +++ b/pkg/models/shared/createbalancerequest.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" "time" ) @@ -12,3 +13,35 @@ type CreateBalanceRequest struct { Name string `json:"name"` Priority *big.Int `json:"priority,omitempty"` } + +func (c CreateBalanceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateBalanceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateBalanceRequest) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} + +func (o *CreateBalanceRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *CreateBalanceRequest) GetPriority() *big.Int { + if o == nil { + return nil + } + return o.Priority +} diff --git a/pkg/models/shared/createbalanceresponse.go b/pkg/models/shared/createbalanceresponse.go index 5bbf647c..197672b8 100755 --- a/pkg/models/shared/createbalanceresponse.go +++ b/pkg/models/shared/createbalanceresponse.go @@ -2,7 +2,13 @@ package shared -// CreateBalanceResponse - Created balance 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 ddcac279..19d3d1ce 100755 --- a/pkg/models/shared/createclientrequest.go +++ b/pkg/models/shared/createclientrequest.go @@ -9,5 +9,62 @@ type CreateClientRequest struct { PostLogoutRedirectUris []string `json:"postLogoutRedirectUris,omitempty"` Public *bool `json:"public,omitempty"` RedirectUris []string `json:"redirectUris,omitempty"` + Scopes []string `json:"scopes,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) GetScopes() []string { + if o == nil { + return nil + } + return o.Scopes +} + +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 aa703628..9b2ead4a 100755 --- a/pkg/models/shared/createclientresponse.go +++ b/pkg/models/shared/createclientresponse.go @@ -2,7 +2,13 @@ package shared -// CreateClientResponse - Client created 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 deleted file mode 100755 index a8ebdda5..00000000 --- a/pkg/models/shared/createscoperequest.go +++ /dev/null @@ -1,8 +0,0 @@ -// 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"` -} diff --git a/pkg/models/shared/createscoperesponse.go b/pkg/models/shared/createscoperesponse.go deleted file mode 100755 index b4ce536e..00000000 --- a/pkg/models/shared/createscoperesponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// CreateScopeResponse - Created scope -type CreateScopeResponse struct { - Data *Scope `json:"data,omitempty"` -} diff --git a/pkg/models/shared/createsecretrequest.go b/pkg/models/shared/createsecretrequest.go index b1029b92..bb92766f 100755 --- a/pkg/models/shared/createsecretrequest.go +++ b/pkg/models/shared/createsecretrequest.go @@ -6,3 +6,17 @@ 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 d9c4a676..b663b5a3 100755 --- a/pkg/models/shared/createsecretresponse.go +++ b/pkg/models/shared/createsecretresponse.go @@ -2,7 +2,13 @@ package shared -// CreateSecretResponse - Created secret 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/createtriggerresponse.go b/pkg/models/shared/createtriggerresponse.go new file mode 100755 index 00000000..634e89e9 --- /dev/null +++ b/pkg/models/shared/createtriggerresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type CreateTriggerResponse struct { + Data Trigger `json:"data"` +} + +func (o *CreateTriggerResponse) GetData() Trigger { + if o == nil { + return Trigger{} + } + return o.Data +} diff --git a/pkg/models/shared/createwalletrequest.go b/pkg/models/shared/createwalletrequest.go index 5e6f0adb..6e3568ea 100755 --- a/pkg/models/shared/createwalletrequest.go +++ b/pkg/models/shared/createwalletrequest.go @@ -7,3 +7,17 @@ type CreateWalletRequest struct { Metadata map[string]string `json:"metadata"` Name string `json:"name"` } + +func (o *CreateWalletRequest) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + 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 683ce179..e7ac9d5d 100755 --- a/pkg/models/shared/createwalletresponse.go +++ b/pkg/models/shared/createwalletresponse.go @@ -2,7 +2,13 @@ package shared -// CreateWalletResponse - Wallet created 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 3bc52c23..534e25c2 100755 --- a/pkg/models/shared/createworkflowrequest.go +++ b/pkg/models/shared/createworkflowrequest.go @@ -6,3 +6,17 @@ type CreateWorkflowRequest struct { Name *string `json:"name,omitempty"` Stages []map[string]interface{} `json:"stages"` } + +func (o *CreateWorkflowRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +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 daf11063..6a075a6d 100755 --- a/pkg/models/shared/createworkflowresponse.go +++ b/pkg/models/shared/createworkflowresponse.go @@ -2,7 +2,13 @@ package shared -// CreateWorkflowResponse - Created workflow 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 05393957..24411bbe 100755 --- a/pkg/models/shared/creditwalletrequest.go +++ b/pkg/models/shared/creditwalletrequest.go @@ -11,3 +11,38 @@ type CreditWalletRequest struct { Reference *string `json:"reference,omitempty"` 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]string { + if o == nil { + return map[string]string{} + } + 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 deleted file mode 100755 index 2c06759d..00000000 --- a/pkg/models/shared/currencycloudconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type CurrencyCloudConfig struct { - 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"` -} diff --git a/pkg/models/shared/debitwalletrequest.go b/pkg/models/shared/debitwalletrequest.go index 47f4648f..418ae257 100755 --- a/pkg/models/shared/debitwalletrequest.go +++ b/pkg/models/shared/debitwalletrequest.go @@ -12,3 +12,59 @@ type DebitWalletRequest struct { // 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]string { + if o == nil { + return map[string]string{} + } + 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 0de39218..1b9a8a5a 100755 --- a/pkg/models/shared/debitwalletresponse.go +++ b/pkg/models/shared/debitwalletresponse.go @@ -2,7 +2,13 @@ package shared -// DebitWalletResponse - Wallet successfully debited as a pending hold 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 deleted file mode 100755 index 991804d7..00000000 --- a/pkg/models/shared/dummypayconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type DummyPayConfig struct { - Directory string `json:"directory"` - // The frequency at which the connector will create new payment objects in the directory - FileGenerationPeriod *string `json:"fileGenerationPeriod,omitempty"` - // The frequency at which the connector will try to fetch new payment objects from the directory - FilePollingPeriod *string `json:"filePollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/error.go b/pkg/models/shared/error.go index fdb9c52d..b7565396 100755 --- a/pkg/models/shared/error.go +++ b/pkg/models/shared/error.go @@ -34,8 +34,21 @@ func (e *ErrorErrorCode) UnmarshalJSON(data []byte) error { } } -// Error - General error 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 { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/errorresponse.go b/pkg/models/shared/errorresponse.go index 632826fe..9757598f 100755 --- a/pkg/models/shared/errorresponse.go +++ b/pkg/models/shared/errorresponse.go @@ -2,9 +2,29 @@ package shared -// ErrorResponse - Error type ErrorResponse struct { - Details *string `json:"details,omitempty"` - ErrorCode *ErrorsEnum `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` + Details *string `json:"details,omitempty"` + ErrorCode ErrorsEnum `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *ErrorResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *ErrorResponse) GetErrorCode() ErrorsEnum { + if o == nil { + return ErrorsEnum("") + } + return o.ErrorCode +} + +func (o *ErrorResponse) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage } diff --git a/pkg/models/shared/expandeddebithold.go b/pkg/models/shared/expandeddebithold.go index 9e8b71f7..65623a63 100755 --- a/pkg/models/shared/expandeddebithold.go +++ b/pkg/models/shared/expandeddebithold.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -20,3 +21,77 @@ type ExpandedDebitHold struct { // The ID of the wallet the hold is associated with. WalletID string `json:"walletID"` } + +func (e ExpandedDebitHold) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *ExpandedDebitHold) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + +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]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *ExpandedDebitHold) GetOriginalAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.OriginalAmount +} + +func (o *ExpandedDebitHold) GetRemaining() *big.Int { + if o == nil { + return big.NewInt(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 981ff4c9..18ed0b06 100755 --- a/pkg/models/shared/getbalanceresponse.go +++ b/pkg/models/shared/getbalanceresponse.go @@ -2,7 +2,13 @@ package shared -// GetBalanceResponse - Balance summary 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 9f1fc1b0..1d486ebb 100755 --- a/pkg/models/shared/getholdresponse.go +++ b/pkg/models/shared/getholdresponse.go @@ -2,7 +2,13 @@ package shared -// GetHoldResponse - Holds 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 f657c8fe..ba112917 100755 --- a/pkg/models/shared/getholdsresponse.go +++ b/pkg/models/shared/getholdsresponse.go @@ -10,7 +10,48 @@ type GetHoldsResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// GetHoldsResponse - Holds +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 f4739039..68a06ed2 100755 --- a/pkg/models/shared/gettransactionsresponse.go +++ b/pkg/models/shared/gettransactionsresponse.go @@ -10,7 +10,48 @@ type GetTransactionsResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// GetTransactionsResponse - OK +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/getversionsresponse.go b/pkg/models/shared/getversionsresponse.go index f9504f66..092e9bbe 100755 --- a/pkg/models/shared/getversionsresponse.go +++ b/pkg/models/shared/getversionsresponse.go @@ -2,9 +2,29 @@ package shared -// GetVersionsResponse - OK type GetVersionsResponse struct { Env string `json:"env"` Region string `json:"region"` Versions []Version `json:"versions"` } + +func (o *GetVersionsResponse) GetEnv() string { + if o == nil { + return "" + } + return o.Env +} + +func (o *GetVersionsResponse) GetRegion() string { + if o == nil { + return "" + } + return o.Region +} + +func (o *GetVersionsResponse) GetVersions() []Version { + if o == nil { + return []Version{} + } + return o.Versions +} diff --git a/pkg/models/shared/getwalletresponse.go b/pkg/models/shared/getwalletresponse.go index f9bcc6ca..9af9f254 100755 --- a/pkg/models/shared/getwalletresponse.go +++ b/pkg/models/shared/getwalletresponse.go @@ -2,7 +2,13 @@ package shared -// GetWalletResponse - Wallet 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/getwalletsummaryresponse.go b/pkg/models/shared/getwalletsummaryresponse.go index 192cd227..95ee15da 100755 --- a/pkg/models/shared/getwalletsummaryresponse.go +++ b/pkg/models/shared/getwalletsummaryresponse.go @@ -3,10 +3,10 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) -// GetWalletSummaryResponse - Wallet summary type GetWalletSummaryResponse struct { AvailableFunds map[string]*big.Int `json:"availableFunds"` Balances []BalanceWithAssets `json:"balances"` @@ -14,3 +14,49 @@ type GetWalletSummaryResponse struct { ExpiredFunds map[string]*big.Int `json:"expiredFunds"` HoldFunds map[string]*big.Int `json:"holdFunds"` } + +func (g GetWalletSummaryResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetWalletSummaryResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetWalletSummaryResponse) GetAvailableFunds() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.AvailableFunds +} + +func (o *GetWalletSummaryResponse) GetBalances() []BalanceWithAssets { + if o == nil { + return []BalanceWithAssets{} + } + return o.Balances +} + +func (o *GetWalletSummaryResponse) GetExpirableFunds() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.ExpirableFunds +} + +func (o *GetWalletSummaryResponse) GetExpiredFunds() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.ExpiredFunds +} + +func (o *GetWalletSummaryResponse) GetHoldFunds() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.HoldFunds +} diff --git a/pkg/models/shared/getworkflowinstancehistoryresponse.go b/pkg/models/shared/getworkflowinstancehistoryresponse.go index 10dea6ac..2bb86ed5 100755 --- a/pkg/models/shared/getworkflowinstancehistoryresponse.go +++ b/pkg/models/shared/getworkflowinstancehistoryresponse.go @@ -2,7 +2,13 @@ package shared -// GetWorkflowInstanceHistoryResponse - The workflow instance history type GetWorkflowInstanceHistoryResponse struct { Data []WorkflowInstanceHistory `json:"data"` } + +func (o *GetWorkflowInstanceHistoryResponse) GetData() []WorkflowInstanceHistory { + if o == nil { + return []WorkflowInstanceHistory{} + } + return o.Data +} diff --git a/pkg/models/shared/getworkflowinstancehistorystageresponse.go b/pkg/models/shared/getworkflowinstancehistorystageresponse.go index e8953d3a..a19733cb 100755 --- a/pkg/models/shared/getworkflowinstancehistorystageresponse.go +++ b/pkg/models/shared/getworkflowinstancehistorystageresponse.go @@ -2,7 +2,13 @@ package shared -// GetWorkflowInstanceHistoryStageResponse - The workflow instance stage history type GetWorkflowInstanceHistoryStageResponse struct { Data []WorkflowInstanceHistoryStage `json:"data"` } + +func (o *GetWorkflowInstanceHistoryStageResponse) GetData() []WorkflowInstanceHistoryStage { + if o == nil { + return []WorkflowInstanceHistoryStage{} + } + return o.Data +} diff --git a/pkg/models/shared/getworkflowinstanceresponse.go b/pkg/models/shared/getworkflowinstanceresponse.go index 6e2f1817..17458f52 100755 --- a/pkg/models/shared/getworkflowinstanceresponse.go +++ b/pkg/models/shared/getworkflowinstanceresponse.go @@ -2,7 +2,13 @@ package shared -// GetWorkflowInstanceResponse - The workflow instance type GetWorkflowInstanceResponse struct { Data WorkflowInstance `json:"data"` } + +func (o *GetWorkflowInstanceResponse) GetData() WorkflowInstance { + if o == nil { + return WorkflowInstance{} + } + return o.Data +} diff --git a/pkg/models/shared/getworkflowresponse.go b/pkg/models/shared/getworkflowresponse.go index 62b4b531..8ac80bdc 100755 --- a/pkg/models/shared/getworkflowresponse.go +++ b/pkg/models/shared/getworkflowresponse.go @@ -2,7 +2,13 @@ package shared -// GetWorkflowResponse - The workflow 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 774794dd..c25a609d 100755 --- a/pkg/models/shared/hold.go +++ b/pkg/models/shared/hold.go @@ -12,3 +12,52 @@ type Hold struct { // 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]string { + if o == nil { + return map[string]string{} + } + 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 index 5d13cb99..cb2b6b1e 100755 --- a/pkg/models/shared/ledgeraccountsubject.go +++ b/pkg/models/shared/ledgeraccountsubject.go @@ -6,3 +6,17 @@ 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 index 4e0d0e4a..8b4958df 100755 --- a/pkg/models/shared/ledgerinfo.go +++ b/pkg/models/shared/ledgerinfo.go @@ -6,7 +6,28 @@ 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 index aebb4853..d78039bd 100755 --- a/pkg/models/shared/ledgerinforesponse.go +++ b/pkg/models/shared/ledgerinforesponse.go @@ -2,7 +2,13 @@ package shared -// LedgerInfoResponse - OK 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 6b2d163f..fbe10480 100755 --- a/pkg/models/shared/ledgerstorage.go +++ b/pkg/models/shared/ledgerstorage.go @@ -6,3 +6,17 @@ 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 901f5934..000e5064 100755 --- a/pkg/models/shared/listbalancesresponse.go +++ b/pkg/models/shared/listbalancesresponse.go @@ -10,7 +10,48 @@ type ListBalancesResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// ListBalancesResponse - Balances list +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 4907497a..fb770bda 100755 --- a/pkg/models/shared/listclientsresponse.go +++ b/pkg/models/shared/listclientsresponse.go @@ -2,7 +2,13 @@ package shared -// ListClientsResponse - List of clients 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 index 9557c8a0..1fb9c893 100755 --- a/pkg/models/shared/listrunsresponse.go +++ b/pkg/models/shared/listrunsresponse.go @@ -2,7 +2,13 @@ package shared -// ListRunsResponse - List of workflow instances type ListRunsResponse struct { Data []WorkflowInstance `json:"data"` } + +func (o *ListRunsResponse) GetData() []WorkflowInstance { + if o == nil { + return []WorkflowInstance{} + } + return o.Data +} diff --git a/pkg/models/shared/listscopesresponse.go b/pkg/models/shared/listscopesresponse.go deleted file mode 100755 index 25a54791..00000000 --- a/pkg/models/shared/listscopesresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// ListScopesResponse - List of scopes -type ListScopesResponse struct { - Data []Scope `json:"data,omitempty"` -} diff --git a/pkg/models/shared/listtriggersoccurrencesresponse.go b/pkg/models/shared/listtriggersoccurrencesresponse.go new file mode 100755 index 00000000..6216a4ce --- /dev/null +++ b/pkg/models/shared/listtriggersoccurrencesresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ListTriggersOccurrencesResponse struct { + Data []TriggerOccurrence `json:"data"` +} + +func (o *ListTriggersOccurrencesResponse) GetData() []TriggerOccurrence { + if o == nil { + return []TriggerOccurrence{} + } + return o.Data +} diff --git a/pkg/models/shared/listtriggersresponse.go b/pkg/models/shared/listtriggersresponse.go new file mode 100755 index 00000000..f2e5bd88 --- /dev/null +++ b/pkg/models/shared/listtriggersresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ListTriggersResponse struct { + Data []Trigger `json:"data"` +} + +func (o *ListTriggersResponse) GetData() []Trigger { + if o == nil { + return []Trigger{} + } + return o.Data +} diff --git a/pkg/models/shared/listusersresponse.go b/pkg/models/shared/listusersresponse.go index 17efd265..39f5dfa0 100755 --- a/pkg/models/shared/listusersresponse.go +++ b/pkg/models/shared/listusersresponse.go @@ -2,7 +2,13 @@ package shared -// ListUsersResponse - List of users 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 e574e833..e2dfb3d3 100755 --- a/pkg/models/shared/listwalletsresponse.go +++ b/pkg/models/shared/listwalletsresponse.go @@ -10,7 +10,48 @@ type ListWalletsResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// ListWalletsResponse - OK +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 7a644c8b..fb3642df 100755 --- a/pkg/models/shared/listworkflowsresponse.go +++ b/pkg/models/shared/listworkflowsresponse.go @@ -2,7 +2,13 @@ package shared -// ListWorkflowsResponse - List of workflows 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 cabd05a0..e6f64cc9 100755 --- a/pkg/models/shared/log.go +++ b/pkg/models/shared/log.go @@ -5,6 +5,7 @@ package shared import ( "encoding/json" "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -42,3 +43,49 @@ type Log struct { 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() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + 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 8fd1f9fc..af9a1221 100755 --- a/pkg/models/shared/logscursorresponse.go +++ b/pkg/models/shared/logscursorresponse.go @@ -10,7 +10,48 @@ type LogsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// LogsCursorResponse - OK +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/mangopayconfig.go b/pkg/models/shared/mangopayconfig.go deleted file mode 100755 index 13e36868..00000000 --- a/pkg/models/shared/mangopayconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type MangoPayConfig struct { - APIKey string `json:"apiKey"` - ClientID string `json:"clientID"` - Endpoint string `json:"endpoint"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/mapping.go b/pkg/models/shared/mapping.go index 14c271d1..75dfd6f9 100755 --- a/pkg/models/shared/mapping.go +++ b/pkg/models/shared/mapping.go @@ -5,3 +5,10 @@ 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 54aa968c..38093912 100755 --- a/pkg/models/shared/mappingresponse.go +++ b/pkg/models/shared/mappingresponse.go @@ -2,7 +2,13 @@ package shared -// MappingResponse - OK 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 index 3eb7526d..23d52c7c 100755 --- a/pkg/models/shared/migrationinfo.go +++ b/pkg/models/shared/migrationinfo.go @@ -5,6 +5,7 @@ package shared import ( "encoding/json" "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -41,3 +42,42 @@ type MigrationInfo struct { 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 deleted file mode 100755 index ad875650..00000000 --- a/pkg/models/shared/modulrconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type ModulrConfig struct { - APIKey string `json:"apiKey"` - APISecret string `json:"apiSecret"` - Endpoint *string `json:"endpoint,omitempty"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/monetary.go b/pkg/models/shared/monetary.go index 037af2b2..243d27b0 100755 --- a/pkg/models/shared/monetary.go +++ b/pkg/models/shared/monetary.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -12,3 +13,28 @@ type Monetary struct { // The asset of the monetary value. Asset string `json:"asset"` } + +func (m Monetary) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Monetary) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Monetary) GetAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Amount +} + +func (o *Monetary) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} diff --git a/pkg/models/shared/moneycorpconfig.go b/pkg/models/shared/moneycorpconfig.go deleted file mode 100755 index 4da7a653..00000000 --- a/pkg/models/shared/moneycorpconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type MoneycorpConfig struct { - APIKey string `json:"apiKey"` - ClientID string `json:"clientID"` - Endpoint string `json:"endpoint"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/orchestrationaccount.go b/pkg/models/shared/orchestrationaccount.go new file mode 100755 index 00000000..06fb1d34 --- /dev/null +++ b/pkg/models/shared/orchestrationaccount.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type OrchestrationAccount struct { + Address string `json:"address"` + EffectiveVolumes map[string]Volume `json:"effectiveVolumes,omitempty"` + Metadata map[string]string `json:"metadata"` + Volumes map[string]Volume `json:"volumes,omitempty"` +} + +func (o *OrchestrationAccount) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *OrchestrationAccount) GetEffectiveVolumes() map[string]Volume { + if o == nil { + return nil + } + return o.EffectiveVolumes +} + +func (o *OrchestrationAccount) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *OrchestrationAccount) GetVolumes() map[string]Volume { + if o == nil { + return nil + } + return o.Volumes +} diff --git a/pkg/models/shared/orchestrationposttransaction.go b/pkg/models/shared/orchestrationposttransaction.go new file mode 100755 index 00000000..77334e8c --- /dev/null +++ b/pkg/models/shared/orchestrationposttransaction.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type OrchestrationPostTransactionScript struct { + Plain string `json:"plain"` + Vars map[string]interface{} `json:"vars,omitempty"` +} + +func (o *OrchestrationPostTransactionScript) GetPlain() string { + if o == nil { + return "" + } + return o.Plain +} + +func (o *OrchestrationPostTransactionScript) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +type OrchestrationPostTransaction struct { + Metadata map[string]string `json:"metadata"` + Postings []Posting `json:"postings,omitempty"` + Reference *string `json:"reference,omitempty"` + Script *OrchestrationPostTransactionScript `json:"script,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +func (o OrchestrationPostTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OrchestrationPostTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { + return err + } + return nil +} + +func (o *OrchestrationPostTransaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *OrchestrationPostTransaction) GetPostings() []Posting { + if o == nil { + return nil + } + return o.Postings +} + +func (o *OrchestrationPostTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *OrchestrationPostTransaction) GetScript() *OrchestrationPostTransactionScript { + if o == nil { + return nil + } + return o.Script +} + +func (o *OrchestrationPostTransaction) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} diff --git a/pkg/models/shared/orchestrationtransaction.go b/pkg/models/shared/orchestrationtransaction.go new file mode 100755 index 00000000..0e81ec49 --- /dev/null +++ b/pkg/models/shared/orchestrationtransaction.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type OrchestrationTransaction struct { + ID *big.Int `json:"id"` + Metadata map[string]string `json:"metadata"` + Postings []Posting `json:"postings"` + Reference *string `json:"reference,omitempty"` + Timestamp time.Time `json:"timestamp"` +} + +func (o OrchestrationTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OrchestrationTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { + return err + } + return nil +} + +func (o *OrchestrationTransaction) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *OrchestrationTransaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *OrchestrationTransaction) GetPostings() []Posting { + if o == nil { + return []Posting{} + } + return o.Postings +} + +func (o *OrchestrationTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *OrchestrationTransaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} diff --git a/pkg/models/shared/orchestrationv2transaction.go b/pkg/models/shared/orchestrationv2transaction.go new file mode 100755 index 00000000..d29d08b3 --- /dev/null +++ b/pkg/models/shared/orchestrationv2transaction.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type OrchestrationV2Transaction struct { + ID *big.Int `json:"id"` + Metadata map[string]string `json:"metadata"` + Postings []V2Posting `json:"postings"` + Reference *string `json:"reference,omitempty"` + Timestamp time.Time `json:"timestamp"` +} + +func (o OrchestrationV2Transaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OrchestrationV2Transaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { + return err + } + return nil +} + +func (o *OrchestrationV2Transaction) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *OrchestrationV2Transaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *OrchestrationV2Transaction) GetPostings() []V2Posting { + if o == nil { + return []V2Posting{} + } + return o.Postings +} + +func (o *OrchestrationV2Transaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *OrchestrationV2Transaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} diff --git a/pkg/models/shared/payment.go b/pkg/models/shared/payment.go index e88f73e5..dee99805 100755 --- a/pkg/models/shared/payment.go +++ b/pkg/models/shared/payment.go @@ -5,9 +5,14 @@ package shared import ( "encoding/json" "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "time" ) +type PaymentRaw struct { +} + type PaymentScheme string const ( @@ -117,17 +122,135 @@ func (e *PaymentType) UnmarshalJSON(data []byte) error { } 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 Connector `json:"provider"` - Raw map[string]interface{} `json:"raw"` - Reference string `json:"reference"` - Scheme PaymentScheme `json:"scheme"` - Status PaymentStatus `json:"status"` - Type PaymentType `json:"type"` + Adjustments []PaymentAdjustment `json:"adjustments"` + Asset string `json:"asset"` + ConnectorID string `json:"connectorID"` + CreatedAt time.Time `json:"createdAt"` + DestinationAccountID string `json:"destinationAccountID"` + ID string `json:"id"` + InitialAmount *big.Int `json:"initialAmount"` + Metadata *PaymentMetadata `json:"metadata"` + Provider *Connector `json:"provider,omitempty"` + Raw *PaymentRaw `json:"raw"` + Reference string `json:"reference"` + Scheme PaymentScheme `json:"scheme"` + SourceAccountID string `json:"sourceAccountID"` + 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) 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) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *Payment) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Payment) GetDestinationAccountID() string { + if o == nil { + return "" + } + return o.DestinationAccountID +} + +func (o *Payment) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Payment) GetInitialAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.InitialAmount +} + +func (o *Payment) GetMetadata() *PaymentMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Payment) GetProvider() *Connector { + if o == nil { + return nil + } + return o.Provider +} + +func (o *Payment) GetRaw() *PaymentRaw { + if o == nil { + return nil + } + 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) GetSourceAccountID() string { + if o == nil { + return "" + } + return o.SourceAccountID +} + +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 4069d6ae..23b231ef 100755 --- a/pkg/models/shared/paymentadjustment.go +++ b/pkg/models/shared/paymentadjustment.go @@ -3,13 +3,64 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "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 PaymentStatus `json:"status"` + Absolute bool `json:"absolute"` + Amount *big.Int `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() *big.Int { + if o == nil { + return big.NewInt(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 2ded57cf..e36d3a13 100755 --- a/pkg/models/shared/paymentmetadata.go +++ b/pkg/models/shared/paymentmetadata.go @@ -5,3 +5,10 @@ package shared type PaymentMetadata struct { Key *string `json:"key,omitempty"` } + +func (o *PaymentMetadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} diff --git a/pkg/models/shared/paymentresponse.go b/pkg/models/shared/paymentresponse.go deleted file mode 100755 index fef42c4e..00000000 --- a/pkg/models/shared/paymentresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// PaymentResponse - OK -type PaymentResponse struct { - Data Payment `json:"data"` -} diff --git a/pkg/models/shared/paymentsaccount.go b/pkg/models/shared/paymentsaccount.go deleted file mode 100755 index a2019040..00000000 --- a/pkg/models/shared/paymentsaccount.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "encoding/json" - "fmt" - "time" -) - -type PaymentsAccountType string - -const ( - 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 Connector `json:"provider"` - Reference string `json:"reference"` - Type PaymentsAccountType `json:"type"` -} diff --git a/pkg/models/shared/paymentscursor.go b/pkg/models/shared/paymentscursor.go deleted file mode 100755 index e371365a..00000000 --- a/pkg/models/shared/paymentscursor.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type PaymentsCursorCursor struct { - Data []Payment `json:"data"` - HasMore bool `json:"hasMore"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` -} - -// PaymentsCursor - OK -type PaymentsCursor struct { - Cursor PaymentsCursorCursor `json:"cursor"` -} diff --git a/pkg/models/shared/policiescursorresponse.go b/pkg/models/shared/policiescursorresponse.go new file mode 100755 index 00000000..c0c5f228 --- /dev/null +++ b/pkg/models/shared/policiescursorresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PoliciesCursorResponseCursor struct { + Data []Policy `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *PoliciesCursorResponseCursor) GetData() []Policy { + if o == nil { + return []Policy{} + } + return o.Data +} + +func (o *PoliciesCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PoliciesCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *PoliciesCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *PoliciesCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type PoliciesCursorResponse struct { + Cursor PoliciesCursorResponseCursor `json:"cursor"` +} + +func (o *PoliciesCursorResponse) GetCursor() PoliciesCursorResponseCursor { + if o == nil { + return PoliciesCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/policy.go b/pkg/models/shared/policy.go new file mode 100755 index 00000000..8251b0c5 --- /dev/null +++ b/pkg/models/shared/policy.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type Policy struct { + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + LedgerName string `json:"ledgerName"` + LedgerQuery string `json:"ledgerQuery"` + Name string `json:"name"` + PaymentsPoolID string `json:"paymentsPoolID"` +} + +func (p Policy) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Policy) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Policy) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Policy) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Policy) GetLedgerName() string { + if o == nil { + return "" + } + return o.LedgerName +} + +func (o *Policy) GetLedgerQuery() string { + if o == nil { + return "" + } + return o.LedgerQuery +} + +func (o *Policy) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Policy) GetPaymentsPoolID() string { + if o == nil { + return "" + } + return o.PaymentsPoolID +} diff --git a/pkg/models/shared/policyrequest.go b/pkg/models/shared/policyrequest.go new file mode 100755 index 00000000..ab88883d --- /dev/null +++ b/pkg/models/shared/policyrequest.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PolicyRequest struct { + LedgerName string `json:"ledgerName"` + LedgerQuery string `json:"ledgerQuery"` + Name string `json:"name"` + PaymentsPoolID string `json:"paymentsPoolID"` +} + +func (o *PolicyRequest) GetLedgerName() string { + if o == nil { + return "" + } + return o.LedgerName +} + +func (o *PolicyRequest) GetLedgerQuery() string { + if o == nil { + return "" + } + return o.LedgerQuery +} + +func (o *PolicyRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PolicyRequest) GetPaymentsPoolID() string { + if o == nil { + return "" + } + return o.PaymentsPoolID +} diff --git a/pkg/models/shared/policyresponse.go b/pkg/models/shared/policyresponse.go new file mode 100755 index 00000000..e40e174e --- /dev/null +++ b/pkg/models/shared/policyresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PolicyResponse struct { + Policy *Policy `json:"policy,omitempty"` +} + +func (o *PolicyResponse) GetPolicy() *Policy { + if o == nil { + return nil + } + return o.Policy +} diff --git a/pkg/models/shared/posting.go b/pkg/models/shared/posting.go index 3173dd3c..79e69f0d 100755 --- a/pkg/models/shared/posting.go +++ b/pkg/models/shared/posting.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -12,3 +13,42 @@ type Posting struct { Destination string `json:"destination"` Source string `json:"source"` } + +func (p Posting) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Posting) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Posting) GetAmount() *big.Int { + if o == nil { + return big.NewInt(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 d0617857..f645c2c5 100755 --- a/pkg/models/shared/posttransaction.go +++ b/pkg/models/shared/posttransaction.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -11,9 +12,20 @@ type PostTransactionScript struct { Vars map[string]interface{} `json:"vars,omitempty"` } -// PostTransaction - The request body must contain at least one of the following objects: -// - `postings`: suitable for simple transactions -// - `script`: enabling more complex transactions with Numscript +func (o *PostTransactionScript) GetPlain() string { + if o == nil { + return "" + } + return o.Plain +} + +func (o *PostTransactionScript) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + type PostTransaction struct { Metadata map[string]interface{} `json:"metadata,omitempty"` Postings []Posting `json:"postings,omitempty"` @@ -21,3 +33,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 9847ecc5..54b3df7f 100755 --- a/pkg/models/shared/query.go +++ b/pkg/models/shared/query.go @@ -2,14 +2,80 @@ package shared +type QueryRaw struct { +} + type Query struct { - After []string `json:"after,omitempty"` - Cursor *string `json:"cursor,omitempty"` - Ledgers []string `json:"ledgers,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - Policy *string `json:"policy,omitempty"` - Raw map[string]interface{} `json:"raw,omitempty"` - Sort *string `json:"sort,omitempty"` - Target *string `json:"target,omitempty"` - Terms []string `json:"terms,omitempty"` + After []string `json:"after,omitempty"` + Cursor *string `json:"cursor,omitempty"` + Ledgers []string `json:"ledgers,omitempty"` + PageSize *int64 `json:"pageSize,omitempty"` + Policy *string `json:"policy,omitempty"` + Raw *QueryRaw `json:"raw,omitempty"` + Sort *string `json:"sort,omitempty"` + 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) GetRaw() *QueryRaw { + if o == nil { + return nil + } + return o.Raw +} + +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 4a317151..78e7ca6f 100755 --- a/pkg/models/shared/readclientresponse.go +++ b/pkg/models/shared/readclientresponse.go @@ -2,7 +2,13 @@ package shared -// ReadClientResponse - Retrieved client 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 deleted file mode 100755 index 2e527804..00000000 --- a/pkg/models/shared/readscoperesponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// ReadScopeResponse - Retrieved scope -type ReadScopeResponse struct { - Data *Scope `json:"data,omitempty"` -} diff --git a/pkg/models/shared/readtriggerresponse.go b/pkg/models/shared/readtriggerresponse.go new file mode 100755 index 00000000..c80011a0 --- /dev/null +++ b/pkg/models/shared/readtriggerresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ReadTriggerResponse struct { + Data Trigger `json:"data"` +} + +func (o *ReadTriggerResponse) GetData() Trigger { + if o == nil { + return Trigger{} + } + return o.Data +} diff --git a/pkg/models/shared/readuserresponse.go b/pkg/models/shared/readuserresponse.go index 6aaf559f..fb511a28 100755 --- a/pkg/models/shared/readuserresponse.go +++ b/pkg/models/shared/readuserresponse.go @@ -2,7 +2,13 @@ package shared -// ReadUserResponse - Retrieved user 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/reconciliation.go b/pkg/models/shared/reconciliation.go new file mode 100755 index 00000000..615fb770 --- /dev/null +++ b/pkg/models/shared/reconciliation.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type Reconciliation struct { + CreatedAt time.Time `json:"createdAt"` + DriftBalances map[string]*big.Int `json:"driftBalances"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + LedgerBalances map[string]*big.Int `json:"ledgerBalances"` + PaymentsBalances map[string]*big.Int `json:"paymentsBalances"` + PolicyID string `json:"policyID"` + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `json:"reconciledAtPayments"` + Status string `json:"status"` +} + +func (r Reconciliation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *Reconciliation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Reconciliation) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Reconciliation) GetDriftBalances() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.DriftBalances +} + +func (o *Reconciliation) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *Reconciliation) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Reconciliation) GetLedgerBalances() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.LedgerBalances +} + +func (o *Reconciliation) GetPaymentsBalances() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.PaymentsBalances +} + +func (o *Reconciliation) GetPolicyID() string { + if o == nil { + return "" + } + return o.PolicyID +} + +func (o *Reconciliation) GetReconciledAtLedger() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtLedger +} + +func (o *Reconciliation) GetReconciledAtPayments() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtPayments +} + +func (o *Reconciliation) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} diff --git a/pkg/models/shared/reconciliationerrorresponse.go b/pkg/models/shared/reconciliationerrorresponse.go new file mode 100755 index 00000000..05a6ffbe --- /dev/null +++ b/pkg/models/shared/reconciliationerrorresponse.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ReconciliationErrorResponse struct { + Details *string `json:"details,omitempty"` + ErrorCode string `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *ReconciliationErrorResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *ReconciliationErrorResponse) GetErrorCode() string { + if o == nil { + return "" + } + return o.ErrorCode +} + +func (o *ReconciliationErrorResponse) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/reconciliationrequest.go b/pkg/models/shared/reconciliationrequest.go new file mode 100755 index 00000000..dd15456a --- /dev/null +++ b/pkg/models/shared/reconciliationrequest.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type ReconciliationRequest struct { + ReconciledAtLedger time.Time `json:"reconciledAtLedger"` + ReconciledAtPayments time.Time `json:"reconciledAtPayments"` +} + +func (r ReconciliationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReconciliationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ReconciliationRequest) GetReconciledAtLedger() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtLedger +} + +func (o *ReconciliationRequest) GetReconciledAtPayments() time.Time { + if o == nil { + return time.Time{} + } + return o.ReconciledAtPayments +} diff --git a/pkg/models/shared/reconciliationresponse.go b/pkg/models/shared/reconciliationresponse.go new file mode 100755 index 00000000..366fef95 --- /dev/null +++ b/pkg/models/shared/reconciliationresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ReconciliationResponse struct { + Reconciliation *Reconciliation `json:"reconciliation,omitempty"` +} + +func (o *ReconciliationResponse) GetReconciliation() *Reconciliation { + if o == nil { + return nil + } + return o.Reconciliation +} diff --git a/pkg/models/shared/reconciliationscursorresponse.go b/pkg/models/shared/reconciliationscursorresponse.go new file mode 100755 index 00000000..af471829 --- /dev/null +++ b/pkg/models/shared/reconciliationscursorresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ReconciliationsCursorResponseCursor struct { + Data []Reconciliation `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *ReconciliationsCursorResponseCursor) GetData() []Reconciliation { + if o == nil { + return []Reconciliation{} + } + return o.Data +} + +func (o *ReconciliationsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *ReconciliationsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ReconciliationsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ReconciliationsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type ReconciliationsCursorResponse struct { + Cursor ReconciliationsCursorResponseCursor `json:"cursor"` +} + +func (o *ReconciliationsCursorResponse) GetCursor() ReconciliationsCursorResponseCursor { + if o == nil { + return ReconciliationsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/response.go b/pkg/models/shared/response.go index eae3a124..60f11e18 100755 --- a/pkg/models/shared/response.go +++ b/pkg/models/shared/response.go @@ -7,6 +7,20 @@ type ResponseCursorTotal struct { 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"` @@ -16,9 +30,64 @@ type ResponseCursor struct { Total *ResponseCursorTotal `json:"total,omitempty"` } -// Response - Success +func (o *ResponseCursor) GetData() []map[string]interface{} { + 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 +} + type Response struct { Cursor *ResponseCursor `json:"cursor,omitempty"` // The payload Data map[string]interface{} `json:"data,omitempty"` } + +func (o *Response) GetCursor() *ResponseCursor { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *Response) GetData() map[string]interface{} { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/runworkflowresponse.go b/pkg/models/shared/runworkflowresponse.go index 39dd39c7..f4af2a52 100755 --- a/pkg/models/shared/runworkflowresponse.go +++ b/pkg/models/shared/runworkflowresponse.go @@ -2,7 +2,13 @@ package shared -// RunWorkflowResponse - The workflow instance type RunWorkflowResponse struct { Data WorkflowInstance `json:"data"` } + +func (o *RunWorkflowResponse) GetData() WorkflowInstance { + if o == nil { + return WorkflowInstance{} + } + return o.Data +} diff --git a/pkg/models/shared/scope.go b/pkg/models/shared/scope.go deleted file mode 100755 index 7eececb2..00000000 --- a/pkg/models/shared/scope.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type Scope struct { - ID string `json:"id"` - Label string `json:"label"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Transient []string `json:"transient,omitempty"` -} diff --git a/pkg/models/shared/script.go b/pkg/models/shared/script.go index 5ff6224e..049473ac 100755 --- a/pkg/models/shared/script.go +++ b/pkg/models/shared/script.go @@ -9,3 +9,31 @@ type Script struct { Reference *string `json:"reference,omitempty"` Vars map[string]interface{} `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() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} diff --git a/pkg/models/shared/scriptresponse.go b/pkg/models/shared/scriptresponse.go index 2c5af0d8..caa8c823 100755 --- a/pkg/models/shared/scriptresponse.go +++ b/pkg/models/shared/scriptresponse.go @@ -2,15 +2,37 @@ package shared -// ScriptResponse - 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. type ScriptResponse struct { 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 d6d1b0be..ed84caf1 100755 --- a/pkg/models/shared/secret.go +++ b/pkg/models/shared/secret.go @@ -9,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 deleted file mode 100755 index dafdaa95..00000000 --- a/pkg/models/shared/security.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type Security struct { - Authorization string `security:"scheme,type=oauth2,name=Authorization"` -} diff --git a/pkg/models/shared/serverinfo.go b/pkg/models/shared/serverinfo.go index 37b5eb77..2ce1c106 100755 --- a/pkg/models/shared/serverinfo.go +++ b/pkg/models/shared/serverinfo.go @@ -2,7 +2,13 @@ package shared -// ServerInfo - Server information 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/stage.go b/pkg/models/shared/stage.go new file mode 100755 index 00000000..0ec8a5d4 --- /dev/null +++ b/pkg/models/shared/stage.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "errors" + "github.com/formancehq/formance-sdk-go/pkg/utils" +) + +type StageType string + +const ( + StageTypeStageSend StageType = "StageSend" + StageTypeStageDelay StageType = "StageDelay" + StageTypeStageWaitEvent StageType = "StageWaitEvent" +) + +type Stage struct { + StageSend *StageSend + StageDelay *StageDelay + StageWaitEvent *StageWaitEvent + + Type StageType +} + +func CreateStageStageSend(stageSend StageSend) Stage { + typ := StageTypeStageSend + + return Stage{ + StageSend: &stageSend, + Type: typ, + } +} + +func CreateStageStageDelay(stageDelay StageDelay) Stage { + typ := StageTypeStageDelay + + return Stage{ + StageDelay: &stageDelay, + Type: typ, + } +} + +func CreateStageStageWaitEvent(stageWaitEvent StageWaitEvent) Stage { + typ := StageTypeStageWaitEvent + + return Stage{ + StageWaitEvent: &stageWaitEvent, + Type: typ, + } +} + +func (u *Stage) UnmarshalJSON(data []byte) error { + + stageWaitEvent := StageWaitEvent{} + if err := utils.UnmarshalJSON(data, &stageWaitEvent, "", true, true); err == nil { + u.StageWaitEvent = &stageWaitEvent + u.Type = StageTypeStageWaitEvent + return nil + } + + stageDelay := StageDelay{} + if err := utils.UnmarshalJSON(data, &stageDelay, "", true, true); err == nil { + u.StageDelay = &stageDelay + u.Type = StageTypeStageDelay + return nil + } + + stageSend := StageSend{} + if err := utils.UnmarshalJSON(data, &stageSend, "", true, true); err == nil { + u.StageSend = &stageSend + u.Type = StageTypeStageSend + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u Stage) MarshalJSON() ([]byte, error) { + if u.StageSend != nil { + return utils.MarshalJSON(u.StageSend, "", true) + } + + if u.StageDelay != nil { + return utils.MarshalJSON(u.StageDelay, "", true) + } + + if u.StageWaitEvent != nil { + return utils.MarshalJSON(u.StageWaitEvent, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/stagedelay.go b/pkg/models/shared/stagedelay.go index 3f71ba0c..a76b2567 100755 --- a/pkg/models/shared/stagedelay.go +++ b/pkg/models/shared/stagedelay.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -10,3 +11,28 @@ type StageDelay struct { Duration *string `json:"duration,omitempty"` Until *time.Time `json:"until,omitempty"` } + +func (s StageDelay) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StageDelay) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil { + return err + } + return nil +} + +func (o *StageDelay) GetDuration() *string { + if o == nil { + return nil + } + return o.Duration +} + +func (o *StageDelay) GetUntil() *time.Time { + if o == nil { + return nil + } + return o.Until +} diff --git a/pkg/models/shared/stagesend.go b/pkg/models/shared/stagesend.go index 1724ad3c..f4720578 100755 --- a/pkg/models/shared/stagesend.go +++ b/pkg/models/shared/stagesend.go @@ -7,3 +7,24 @@ type StageSend struct { Destination *StageSendDestination `json:"destination,omitempty"` Source *StageSendSource `json:"source,omitempty"` } + +func (o *StageSend) GetAmount() *Monetary { + if o == nil { + return nil + } + return o.Amount +} + +func (o *StageSend) GetDestination() *StageSendDestination { + if o == nil { + return nil + } + return o.Destination +} + +func (o *StageSend) GetSource() *StageSendSource { + if o == nil { + return nil + } + return o.Source +} diff --git a/pkg/models/shared/stagesenddestination.go b/pkg/models/shared/stagesenddestination.go index f950d056..1b1231b5 100755 --- a/pkg/models/shared/stagesenddestination.go +++ b/pkg/models/shared/stagesenddestination.go @@ -7,3 +7,24 @@ type StageSendDestination struct { Payment *StageSendDestinationPayment `json:"payment,omitempty"` Wallet *StageSendDestinationWallet `json:"wallet,omitempty"` } + +func (o *StageSendDestination) GetAccount() *StageSendDestinationAccount { + if o == nil { + return nil + } + return o.Account +} + +func (o *StageSendDestination) GetPayment() *StageSendDestinationPayment { + if o == nil { + return nil + } + return o.Payment +} + +func (o *StageSendDestination) GetWallet() *StageSendDestinationWallet { + if o == nil { + return nil + } + return o.Wallet +} diff --git a/pkg/models/shared/stagesenddestinationaccount.go b/pkg/models/shared/stagesenddestinationaccount.go index 2798a94d..e2eafcbe 100755 --- a/pkg/models/shared/stagesenddestinationaccount.go +++ b/pkg/models/shared/stagesenddestinationaccount.go @@ -6,3 +6,17 @@ type StageSendDestinationAccount struct { ID string `json:"id"` Ledger *string `json:"ledger,omitempty"` } + +func (o *StageSendDestinationAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *StageSendDestinationAccount) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} diff --git a/pkg/models/shared/stagesenddestinationpayment.go b/pkg/models/shared/stagesenddestinationpayment.go index da2eb7f8..0b5ee0e0 100755 --- a/pkg/models/shared/stagesenddestinationpayment.go +++ b/pkg/models/shared/stagesenddestinationpayment.go @@ -5,3 +5,10 @@ package shared type StageSendDestinationPayment struct { Psp string `json:"psp"` } + +func (o *StageSendDestinationPayment) GetPsp() string { + if o == nil { + return "" + } + return o.Psp +} diff --git a/pkg/models/shared/stagesenddestinationwallet.go b/pkg/models/shared/stagesenddestinationwallet.go index 403ab9f2..c239f6f0 100755 --- a/pkg/models/shared/stagesenddestinationwallet.go +++ b/pkg/models/shared/stagesenddestinationwallet.go @@ -6,3 +6,17 @@ type StageSendDestinationWallet struct { Balance *string `json:"balance,omitempty"` ID string `json:"id"` } + +func (o *StageSendDestinationWallet) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *StageSendDestinationWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/stagesendsource.go b/pkg/models/shared/stagesendsource.go index 07e5c66c..1b3556e7 100755 --- a/pkg/models/shared/stagesendsource.go +++ b/pkg/models/shared/stagesendsource.go @@ -7,3 +7,24 @@ type StageSendSource struct { Payment *StageSendSourcePayment `json:"payment,omitempty"` Wallet *StageSendSourceWallet `json:"wallet,omitempty"` } + +func (o *StageSendSource) GetAccount() *StageSendSourceAccount { + if o == nil { + return nil + } + return o.Account +} + +func (o *StageSendSource) GetPayment() *StageSendSourcePayment { + if o == nil { + return nil + } + return o.Payment +} + +func (o *StageSendSource) GetWallet() *StageSendSourceWallet { + if o == nil { + return nil + } + return o.Wallet +} diff --git a/pkg/models/shared/stagesendsourceaccount.go b/pkg/models/shared/stagesendsourceaccount.go index b79eea4a..b6db1d8e 100755 --- a/pkg/models/shared/stagesendsourceaccount.go +++ b/pkg/models/shared/stagesendsourceaccount.go @@ -6,3 +6,17 @@ type StageSendSourceAccount struct { ID string `json:"id"` Ledger *string `json:"ledger,omitempty"` } + +func (o *StageSendSourceAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *StageSendSourceAccount) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} diff --git a/pkg/models/shared/stagesendsourcepayment.go b/pkg/models/shared/stagesendsourcepayment.go index dbeb774b..02b19acb 100755 --- a/pkg/models/shared/stagesendsourcepayment.go +++ b/pkg/models/shared/stagesendsourcepayment.go @@ -5,3 +5,10 @@ package shared type StageSendSourcePayment struct { ID string `json:"id"` } + +func (o *StageSendSourcePayment) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/stagesendsourcewallet.go b/pkg/models/shared/stagesendsourcewallet.go index 75622f0a..6c704bf9 100755 --- a/pkg/models/shared/stagesendsourcewallet.go +++ b/pkg/models/shared/stagesendsourcewallet.go @@ -6,3 +6,17 @@ type StageSendSourceWallet struct { Balance *string `json:"balance,omitempty"` ID string `json:"id"` } + +func (o *StageSendSourceWallet) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *StageSendSourceWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/stagestatus.go b/pkg/models/shared/stagestatus.go index 284d9a71..a740b903 100755 --- a/pkg/models/shared/stagestatus.go +++ b/pkg/models/shared/stagestatus.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -13,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) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +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/stagewaitevent.go b/pkg/models/shared/stagewaitevent.go index 2325f5b3..4c056971 100755 --- a/pkg/models/shared/stagewaitevent.go +++ b/pkg/models/shared/stagewaitevent.go @@ -5,3 +5,10 @@ package shared type StageWaitEvent struct { Event string `json:"event"` } + +func (o *StageWaitEvent) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} diff --git a/pkg/models/shared/stats.go b/pkg/models/shared/stats.go index 621f3f6a..700e2407 100755 --- a/pkg/models/shared/stats.go +++ b/pkg/models/shared/stats.go @@ -6,3 +6,17 @@ 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 6af78d2e..55a24a68 100755 --- a/pkg/models/shared/statsresponse.go +++ b/pkg/models/shared/statsresponse.go @@ -2,7 +2,13 @@ package shared -// StatsResponse - OK 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 deleted file mode 100755 index 6dab0feb..00000000 --- a/pkg/models/shared/stripeconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type StripeConfig struct { - APIKey string `json:"apiKey"` - // Number of BalanceTransaction to fetch at each polling interval. - // - PageSize *int64 `json:"pageSize,omitempty"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/stripetransferrequest.go b/pkg/models/shared/stripetransferrequest.go deleted file mode 100755 index 0796f9fd..00000000 --- a/pkg/models/shared/stripetransferrequest.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type StripeTransferRequest struct { - 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 map[string]interface{} `json:"metadata,omitempty"` -} diff --git a/pkg/models/shared/subject.go b/pkg/models/shared/subject.go index 1a71da19..19f4de5f 100755 --- a/pkg/models/shared/subject.go +++ b/pkg/models/shared/subject.go @@ -3,10 +3,10 @@ package shared import ( - "bytes" "encoding/json" "errors" "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" ) type SubjectType string @@ -46,7 +46,6 @@ func CreateSubjectWallet(wallet WalletSubject) Subject { } func (u *Subject) UnmarshalJSON(data []byte) error { - var d *json.Decoder type discriminator struct { Type string @@ -59,10 +58,8 @@ func (u *Subject) UnmarshalJSON(data []byte) error { switch dis.Type { case "ACCOUNT": - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() ledgerAccountSubject := new(LedgerAccountSubject) - if err := d.Decode(&ledgerAccountSubject); err != nil { + if err := utils.UnmarshalJSON(data, &ledgerAccountSubject, "", true, true); err != nil { return fmt.Errorf("could not unmarshal expected type: %w", err) } @@ -70,10 +67,8 @@ func (u *Subject) UnmarshalJSON(data []byte) error { u.Type = SubjectTypeAccount return nil case "WALLET": - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() walletSubject := new(WalletSubject) - if err := d.Decode(&walletSubject); err != nil { + if err := utils.UnmarshalJSON(data, &walletSubject, "", true, true); err != nil { return fmt.Errorf("could not unmarshal expected type: %w", err) } @@ -87,12 +82,12 @@ func (u *Subject) UnmarshalJSON(data []byte) error { func (u Subject) MarshalJSON() ([]byte, error) { if u.LedgerAccountSubject != nil { - return json.Marshal(u.LedgerAccountSubject) + return utils.MarshalJSON(u.LedgerAccountSubject, "", true) } if u.WalletSubject != nil { - return json.Marshal(u.WalletSubject) + return utils.MarshalJSON(u.WalletSubject, "", true) } - return nil, nil + 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 deleted file mode 100755 index b2228543..00000000 --- a/pkg/models/shared/taskbankingcircle.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskBankingCircleDescriptor struct { - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskcurrencycloud.go b/pkg/models/shared/taskcurrencycloud.go deleted file mode 100755 index e95c758a..00000000 --- a/pkg/models/shared/taskcurrencycloud.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskCurrencyCloudDescriptor struct { - Name *string `json:"name,omitempty"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskdummypay.go b/pkg/models/shared/taskdummypay.go deleted file mode 100755 index efe3b5cf..00000000 --- a/pkg/models/shared/taskdummypay.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskDummyPayDescriptor struct { - FileName *string `json:"fileName,omitempty"` - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskmangopay.go b/pkg/models/shared/taskmangopay.go deleted file mode 100755 index c2ef8632..00000000 --- a/pkg/models/shared/taskmangopay.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskMangoPayDescriptor struct { - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` - UserID *string `json:"userID,omitempty"` -} - -type TaskMangoPay struct { - ConnectorID string `json:"connectorId"` - CreatedAt time.Time `json:"createdAt"` - Descriptor TaskMangoPayDescriptor `json:"descriptor"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskmodulr.go b/pkg/models/shared/taskmodulr.go deleted file mode 100755 index 983290ea..00000000 --- a/pkg/models/shared/taskmodulr.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskModulrDescriptor struct { - AccountID *string `json:"accountID,omitempty"` - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskmoneycorp.go b/pkg/models/shared/taskmoneycorp.go deleted file mode 100755 index 4dcc5c5b..00000000 --- a/pkg/models/shared/taskmoneycorp.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskMoneycorpDescriptor struct { - AccountID *string `json:"accountID,omitempty"` - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` -} - -type TaskMoneycorp struct { - ConnectorID string `json:"connectorId"` - CreatedAt time.Time `json:"createdAt"` - Descriptor TaskMoneycorpDescriptor `json:"descriptor"` - Error *string `json:"error,omitempty"` - ID string `json:"id"` - State map[string]interface{} `json:"state"` - Status PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskresponse.go b/pkg/models/shared/taskresponse.go deleted file mode 100755 index 221ce2f3..00000000 --- a/pkg/models/shared/taskresponse.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "bytes" - "encoding/json" - "errors" -) - -type TaskResponseDataType string - -const ( - TaskResponseDataTypeTaskStripe TaskResponseDataType = "TaskStripe" - TaskResponseDataTypeTaskWise TaskResponseDataType = "TaskWise" - TaskResponseDataTypeTaskCurrencyCloud TaskResponseDataType = "TaskCurrencyCloud" - TaskResponseDataTypeTaskDummyPay TaskResponseDataType = "TaskDummyPay" - TaskResponseDataTypeTaskModulr TaskResponseDataType = "TaskModulr" - TaskResponseDataTypeTaskBankingCircle TaskResponseDataType = "TaskBankingCircle" - TaskResponseDataTypeTaskMangoPay TaskResponseDataType = "TaskMangoPay" - TaskResponseDataTypeTaskMoneycorp TaskResponseDataType = "TaskMoneycorp" -) - -type TaskResponseData struct { - TaskStripe *TaskStripe - TaskWise *TaskWise - TaskCurrencyCloud *TaskCurrencyCloud - TaskDummyPay *TaskDummyPay - TaskModulr *TaskModulr - TaskBankingCircle *TaskBankingCircle - TaskMangoPay *TaskMangoPay - TaskMoneycorp *TaskMoneycorp - - 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 CreateTaskResponseDataTaskMangoPay(taskMangoPay TaskMangoPay) TaskResponseData { - typ := TaskResponseDataTypeTaskMangoPay - - return TaskResponseData{ - TaskMangoPay: &taskMangoPay, - Type: typ, - } -} - -func CreateTaskResponseDataTaskMoneycorp(taskMoneycorp TaskMoneycorp) TaskResponseData { - typ := TaskResponseDataTypeTaskMoneycorp - - return TaskResponseData{ - TaskMoneycorp: &taskMoneycorp, - Type: typ, - } -} - -func (u *TaskResponseData) UnmarshalJSON(data []byte) error { - var d *json.Decoder - - taskStripe := new(TaskStripe) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskStripe); err == nil { - u.TaskStripe = taskStripe - u.Type = TaskResponseDataTypeTaskStripe - return nil - } - - taskWise := new(TaskWise) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskWise); err == nil { - u.TaskWise = taskWise - u.Type = TaskResponseDataTypeTaskWise - return nil - } - - taskCurrencyCloud := new(TaskCurrencyCloud) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskCurrencyCloud); err == nil { - u.TaskCurrencyCloud = taskCurrencyCloud - u.Type = TaskResponseDataTypeTaskCurrencyCloud - return nil - } - - taskDummyPay := new(TaskDummyPay) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskDummyPay); err == nil { - u.TaskDummyPay = taskDummyPay - u.Type = TaskResponseDataTypeTaskDummyPay - return nil - } - - taskModulr := new(TaskModulr) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskModulr); err == nil { - u.TaskModulr = taskModulr - u.Type = TaskResponseDataTypeTaskModulr - return nil - } - - taskBankingCircle := new(TaskBankingCircle) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskBankingCircle); err == nil { - u.TaskBankingCircle = taskBankingCircle - u.Type = TaskResponseDataTypeTaskBankingCircle - return nil - } - - taskMangoPay := new(TaskMangoPay) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskMangoPay); err == nil { - u.TaskMangoPay = taskMangoPay - u.Type = TaskResponseDataTypeTaskMangoPay - return nil - } - - taskMoneycorp := new(TaskMoneycorp) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskMoneycorp); err == nil { - u.TaskMoneycorp = taskMoneycorp - u.Type = TaskResponseDataTypeTaskMoneycorp - return nil - } - - return errors.New("could not unmarshal into supported union types") -} - -func (u TaskResponseData) MarshalJSON() ([]byte, error) { - if u.TaskStripe != nil { - return json.Marshal(u.TaskStripe) - } - - if u.TaskWise != nil { - return json.Marshal(u.TaskWise) - } - - if u.TaskCurrencyCloud != nil { - return json.Marshal(u.TaskCurrencyCloud) - } - - if u.TaskDummyPay != nil { - return json.Marshal(u.TaskDummyPay) - } - - if u.TaskModulr != nil { - return json.Marshal(u.TaskModulr) - } - - if u.TaskBankingCircle != nil { - return json.Marshal(u.TaskBankingCircle) - } - - if u.TaskMangoPay != nil { - return json.Marshal(u.TaskMangoPay) - } - - if u.TaskMoneycorp != nil { - return json.Marshal(u.TaskMoneycorp) - } - - return nil, nil -} - -// TaskResponse - OK -type TaskResponse struct { - Data TaskResponseData `json:"data"` -} diff --git a/pkg/models/shared/taskscursor.go b/pkg/models/shared/taskscursor.go deleted file mode 100755 index 87db9d81..00000000 --- a/pkg/models/shared/taskscursor.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "bytes" - "encoding/json" - "errors" -) - -type TasksCursorCursorDataType string - -const ( - TasksCursorCursorDataTypeTaskStripe TasksCursorCursorDataType = "TaskStripe" - TasksCursorCursorDataTypeTaskWise TasksCursorCursorDataType = "TaskWise" - TasksCursorCursorDataTypeTaskCurrencyCloud TasksCursorCursorDataType = "TaskCurrencyCloud" - TasksCursorCursorDataTypeTaskDummyPay TasksCursorCursorDataType = "TaskDummyPay" - TasksCursorCursorDataTypeTaskModulr TasksCursorCursorDataType = "TaskModulr" - TasksCursorCursorDataTypeTaskBankingCircle TasksCursorCursorDataType = "TaskBankingCircle" - TasksCursorCursorDataTypeTaskMangoPay TasksCursorCursorDataType = "TaskMangoPay" - TasksCursorCursorDataTypeTaskMoneycorp TasksCursorCursorDataType = "TaskMoneycorp" -) - -type TasksCursorCursorData struct { - TaskStripe *TaskStripe - TaskWise *TaskWise - TaskCurrencyCloud *TaskCurrencyCloud - TaskDummyPay *TaskDummyPay - TaskModulr *TaskModulr - TaskBankingCircle *TaskBankingCircle - TaskMangoPay *TaskMangoPay - TaskMoneycorp *TaskMoneycorp - - 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 CreateTasksCursorCursorDataTaskMangoPay(taskMangoPay TaskMangoPay) TasksCursorCursorData { - typ := TasksCursorCursorDataTypeTaskMangoPay - - return TasksCursorCursorData{ - TaskMangoPay: &taskMangoPay, - Type: typ, - } -} - -func CreateTasksCursorCursorDataTaskMoneycorp(taskMoneycorp TaskMoneycorp) TasksCursorCursorData { - typ := TasksCursorCursorDataTypeTaskMoneycorp - - return TasksCursorCursorData{ - TaskMoneycorp: &taskMoneycorp, - Type: typ, - } -} - -func (u *TasksCursorCursorData) UnmarshalJSON(data []byte) error { - var d *json.Decoder - - taskStripe := new(TaskStripe) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskStripe); err == nil { - u.TaskStripe = taskStripe - u.Type = TasksCursorCursorDataTypeTaskStripe - return nil - } - - taskWise := new(TaskWise) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskWise); err == nil { - u.TaskWise = taskWise - u.Type = TasksCursorCursorDataTypeTaskWise - return nil - } - - taskCurrencyCloud := new(TaskCurrencyCloud) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskCurrencyCloud); err == nil { - u.TaskCurrencyCloud = taskCurrencyCloud - u.Type = TasksCursorCursorDataTypeTaskCurrencyCloud - return nil - } - - taskDummyPay := new(TaskDummyPay) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskDummyPay); err == nil { - u.TaskDummyPay = taskDummyPay - u.Type = TasksCursorCursorDataTypeTaskDummyPay - return nil - } - - taskModulr := new(TaskModulr) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskModulr); err == nil { - u.TaskModulr = taskModulr - u.Type = TasksCursorCursorDataTypeTaskModulr - return nil - } - - taskBankingCircle := new(TaskBankingCircle) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskBankingCircle); err == nil { - u.TaskBankingCircle = taskBankingCircle - u.Type = TasksCursorCursorDataTypeTaskBankingCircle - return nil - } - - taskMangoPay := new(TaskMangoPay) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskMangoPay); err == nil { - u.TaskMangoPay = taskMangoPay - u.Type = TasksCursorCursorDataTypeTaskMangoPay - return nil - } - - taskMoneycorp := new(TaskMoneycorp) - d = json.NewDecoder(bytes.NewReader(data)) - d.DisallowUnknownFields() - if err := d.Decode(&taskMoneycorp); err == nil { - u.TaskMoneycorp = taskMoneycorp - u.Type = TasksCursorCursorDataTypeTaskMoneycorp - return nil - } - - return errors.New("could not unmarshal into supported union types") -} - -func (u TasksCursorCursorData) MarshalJSON() ([]byte, error) { - if u.TaskStripe != nil { - return json.Marshal(u.TaskStripe) - } - - if u.TaskWise != nil { - return json.Marshal(u.TaskWise) - } - - if u.TaskCurrencyCloud != nil { - return json.Marshal(u.TaskCurrencyCloud) - } - - if u.TaskDummyPay != nil { - return json.Marshal(u.TaskDummyPay) - } - - if u.TaskModulr != nil { - return json.Marshal(u.TaskModulr) - } - - if u.TaskBankingCircle != nil { - return json.Marshal(u.TaskBankingCircle) - } - - if u.TaskMangoPay != nil { - return json.Marshal(u.TaskMangoPay) - } - - if u.TaskMoneycorp != nil { - return json.Marshal(u.TaskMoneycorp) - } - - return nil, nil -} - -type TasksCursorCursor struct { - Data []TasksCursorCursorData `json:"data"` - HasMore bool `json:"hasMore"` - Next *string `json:"next,omitempty"` - PageSize int64 `json:"pageSize"` - Previous *string `json:"previous,omitempty"` -} - -// TasksCursor - OK -type TasksCursor struct { - Cursor TasksCursorCursor `json:"cursor"` -} diff --git a/pkg/models/shared/taskstripe.go b/pkg/models/shared/taskstripe.go deleted file mode 100755 index 26d4ed30..00000000 --- a/pkg/models/shared/taskstripe.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskStripeDescriptor struct { - Account string `json:"account"` - Main *bool `json:"main,omitempty"` - Name string `json:"name"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/taskwise.go b/pkg/models/shared/taskwise.go deleted file mode 100755 index 7fdd7dff..00000000 --- a/pkg/models/shared/taskwise.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "time" -) - -type TaskWiseDescriptor struct { - Key *string `json:"key,omitempty"` - Name *string `json:"name,omitempty"` - ProfileID *int64 `json:"profileID,omitempty"` -} - -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 PaymentStatus `json:"status"` - UpdatedAt time.Time `json:"updatedAt"` -} diff --git a/pkg/models/shared/transaction.go b/pkg/models/shared/transaction.go index 875c4b30..2b7d0cdc 100755 --- a/pkg/models/shared/transaction.go +++ b/pkg/models/shared/transaction.go @@ -3,6 +3,8 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" "time" ) @@ -13,5 +15,65 @@ type Transaction struct { PreCommitVolumes map[string]map[string]Volume `json:"preCommitVolumes,omitempty"` Reference *string `json:"reference,omitempty"` Timestamp time.Time `json:"timestamp"` - Txid int64 `json:"txid"` + Txid *big.Int `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() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Txid } diff --git a/pkg/models/shared/transactiondata.go b/pkg/models/shared/transactiondata.go index ac7ef89d..efb16f3c 100755 --- a/pkg/models/shared/transactiondata.go +++ b/pkg/models/shared/transactiondata.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -12,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 b8e5f700..9d2ab66c 100755 --- a/pkg/models/shared/transactionresponse.go +++ b/pkg/models/shared/transactionresponse.go @@ -2,7 +2,13 @@ package shared -// TransactionResponse - OK 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 b656037a..4fe48e40 100755 --- a/pkg/models/shared/transactions.go +++ b/pkg/models/shared/transactions.go @@ -5,3 +5,10 @@ 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 3632334a..e9256bd1 100755 --- a/pkg/models/shared/transactionscursorresponse.go +++ b/pkg/models/shared/transactionscursorresponse.go @@ -10,7 +10,48 @@ type TransactionsCursorResponseCursor struct { Previous *string `json:"previous,omitempty"` } -// TransactionsCursorResponse - OK +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 20c23ecc..8fc288d0 100755 --- a/pkg/models/shared/transactionsresponse.go +++ b/pkg/models/shared/transactionsresponse.go @@ -2,7 +2,13 @@ package shared -// TransactionsResponse - OK 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/transferrequest.go b/pkg/models/shared/transferrequest.go deleted file mode 100755 index d8498fdc..00000000 --- a/pkg/models/shared/transferrequest.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type TransferRequest struct { - Amount int64 `json:"amount"` - Asset string `json:"asset"` - Destination string `json:"destination"` - Source *string `json:"source,omitempty"` -} diff --git a/pkg/models/shared/transferresponse.go b/pkg/models/shared/transferresponse.go deleted file mode 100755 index 690ac80e..00000000 --- a/pkg/models/shared/transferresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// TransferResponse - OK -type TransferResponse struct { - ID *string `json:"id,omitempty"` -} diff --git a/pkg/models/shared/transfersresponse.go b/pkg/models/shared/transfersresponse.go deleted file mode 100755 index 7d37d903..00000000 --- a/pkg/models/shared/transfersresponse.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type TransfersResponseData struct { - Amount *int64 `json:"amount,omitempty"` - Asset *string `json:"asset,omitempty"` - Currency *string `json:"currency,omitempty"` - Destination *string `json:"destination,omitempty"` - Error *string `json:"error,omitempty"` - ID *string `json:"id,omitempty"` - Source *string `json:"source,omitempty"` - Status *string `json:"status,omitempty"` -} - -// TransfersResponse - OK -type TransfersResponse struct { - Data []TransfersResponseData `json:"data,omitempty"` -} diff --git a/pkg/models/shared/trigger.go b/pkg/models/shared/trigger.go new file mode 100755 index 00000000..7fb5e74d --- /dev/null +++ b/pkg/models/shared/trigger.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type Trigger struct { + CreatedAt time.Time `json:"createdAt"` + Event string `json:"event"` + Filter *string `json:"filter,omitempty"` + ID string `json:"id"` + Vars map[string]interface{} `json:"vars,omitempty"` + WorkflowID string `json:"workflowID"` +} + +func (t Trigger) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *Trigger) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Trigger) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *Trigger) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} + +func (o *Trigger) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +func (o *Trigger) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Trigger) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +func (o *Trigger) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/triggerdata.go b/pkg/models/shared/triggerdata.go new file mode 100755 index 00000000..854416f7 --- /dev/null +++ b/pkg/models/shared/triggerdata.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type TriggerData struct { + Event string `json:"event"` + Filter *string `json:"filter,omitempty"` + Vars map[string]interface{} `json:"vars,omitempty"` + WorkflowID string `json:"workflowID"` +} + +func (o *TriggerData) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} + +func (o *TriggerData) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +func (o *TriggerData) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +func (o *TriggerData) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/triggeroccurrence.go b/pkg/models/shared/triggeroccurrence.go new file mode 100755 index 00000000..8cc9f5fa --- /dev/null +++ b/pkg/models/shared/triggeroccurrence.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type TriggerOccurrence struct { + Date time.Time `json:"date"` + Event map[string]interface{} `json:"event"` + TriggerID string `json:"triggerID"` + WorkflowInstanceID string `json:"workflowInstanceID"` +} + +func (t TriggerOccurrence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TriggerOccurrence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TriggerOccurrence) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *TriggerOccurrence) GetEvent() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Event +} + +func (o *TriggerOccurrence) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +func (o *TriggerOccurrence) GetWorkflowInstanceID() string { + if o == nil { + return "" + } + return o.WorkflowInstanceID +} diff --git a/pkg/models/shared/updateclientrequest.go b/pkg/models/shared/updateclientrequest.go index 71cda709..ea5b3b2c 100755 --- a/pkg/models/shared/updateclientrequest.go +++ b/pkg/models/shared/updateclientrequest.go @@ -9,5 +9,62 @@ type UpdateClientRequest struct { PostLogoutRedirectUris []string `json:"postLogoutRedirectUris,omitempty"` Public *bool `json:"public,omitempty"` RedirectUris []string `json:"redirectUris,omitempty"` + Scopes []string `json:"scopes,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) GetScopes() []string { + if o == nil { + return nil + } + return o.Scopes +} + +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 63cc55f6..b7c449c7 100755 --- a/pkg/models/shared/updateclientresponse.go +++ b/pkg/models/shared/updateclientresponse.go @@ -2,7 +2,13 @@ package shared -// UpdateClientResponse - Updated client 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 deleted file mode 100755 index f4e9cb68..00000000 --- a/pkg/models/shared/updatescoperequest.go +++ /dev/null @@ -1,8 +0,0 @@ -// 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"` -} diff --git a/pkg/models/shared/updatescoperesponse.go b/pkg/models/shared/updatescoperesponse.go deleted file mode 100755 index dfc84505..00000000 --- a/pkg/models/shared/updatescoperesponse.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -// UpdateScopeResponse - Updated scope -type UpdateScopeResponse struct { - Data *Scope `json:"data,omitempty"` -} diff --git a/pkg/models/shared/user.go b/pkg/models/shared/user.go index 944bfc22..d09b227c 100755 --- a/pkg/models/shared/user.go +++ b/pkg/models/shared/user.go @@ -7,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/v2account.go b/pkg/models/shared/v2account.go new file mode 100755 index 00000000..f2c43716 --- /dev/null +++ b/pkg/models/shared/v2account.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2Account struct { + Address string `json:"address"` + EffectiveVolumes map[string]V2Volume `json:"effectiveVolumes,omitempty"` + Metadata map[string]string `json:"metadata"` + Volumes map[string]V2Volume `json:"volumes,omitempty"` +} + +func (o *V2Account) GetAddress() string { + if o == nil { + return "" + } + return o.Address +} + +func (o *V2Account) GetEffectiveVolumes() map[string]V2Volume { + if o == nil { + return nil + } + return o.EffectiveVolumes +} + +func (o *V2Account) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2Account) GetVolumes() map[string]V2Volume { + if o == nil { + return nil + } + return o.Volumes +} diff --git a/pkg/models/shared/v2accountresponse.go b/pkg/models/shared/v2accountresponse.go new file mode 100755 index 00000000..9e1fc7fa --- /dev/null +++ b/pkg/models/shared/v2accountresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2AccountResponse struct { + Data V2Account `json:"data"` +} + +func (o *V2AccountResponse) GetData() V2Account { + if o == nil { + return V2Account{} + } + return o.Data +} diff --git a/pkg/models/shared/v2accountscursorresponse.go b/pkg/models/shared/v2accountscursorresponse.go new file mode 100755 index 00000000..4a87349e --- /dev/null +++ b/pkg/models/shared/v2accountscursorresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2AccountsCursorResponseCursor struct { + Data []V2Account `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2AccountsCursorResponseCursor) GetData() []V2Account { + if o == nil { + return []V2Account{} + } + return o.Data +} + +func (o *V2AccountsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2AccountsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2AccountsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2AccountsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2AccountsCursorResponse struct { + Cursor V2AccountsCursorResponseCursor `json:"cursor"` +} + +func (o *V2AccountsCursorResponse) GetCursor() V2AccountsCursorResponseCursor { + if o == nil { + return V2AccountsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2activityconfirmhold.go b/pkg/models/shared/v2activityconfirmhold.go new file mode 100755 index 00000000..50954107 --- /dev/null +++ b/pkg/models/shared/v2activityconfirmhold.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityConfirmHold struct { + ID string `json:"id"` +} + +func (o *V2ActivityConfirmHold) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2activitycreatetransaction.go b/pkg/models/shared/v2activitycreatetransaction.go new file mode 100755 index 00000000..097433cb --- /dev/null +++ b/pkg/models/shared/v2activitycreatetransaction.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityCreateTransaction struct { + Data *V2PostTransaction `json:"data,omitempty"` + Ledger *string `json:"ledger,omitempty"` +} + +func (o *V2ActivityCreateTransaction) GetData() *V2PostTransaction { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2ActivityCreateTransaction) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} diff --git a/pkg/models/shared/v2activitycreatetransactionoutput.go b/pkg/models/shared/v2activitycreatetransactionoutput.go new file mode 100755 index 00000000..63a7a96d --- /dev/null +++ b/pkg/models/shared/v2activitycreatetransactionoutput.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityCreateTransactionOutput struct { + Data OrchestrationV2Transaction `json:"data"` +} + +func (o *V2ActivityCreateTransactionOutput) GetData() OrchestrationV2Transaction { + if o == nil { + return OrchestrationV2Transaction{} + } + return o.Data +} diff --git a/pkg/models/shared/v2activitycreditwallet.go b/pkg/models/shared/v2activitycreditwallet.go new file mode 100755 index 00000000..52b2a1ad --- /dev/null +++ b/pkg/models/shared/v2activitycreditwallet.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityCreditWallet struct { + Data *V2CreditWalletRequest `json:"data,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (o *V2ActivityCreditWallet) GetData() *V2CreditWalletRequest { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2ActivityCreditWallet) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/pkg/models/shared/v2activitydebitwallet.go b/pkg/models/shared/v2activitydebitwallet.go new file mode 100755 index 00000000..35262cb2 --- /dev/null +++ b/pkg/models/shared/v2activitydebitwallet.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityDebitWallet struct { + Data *V2DebitWalletRequest `json:"data,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (o *V2ActivityDebitWallet) GetData() *V2DebitWalletRequest { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2ActivityDebitWallet) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/pkg/models/shared/v2activitydebitwalletoutput.go b/pkg/models/shared/v2activitydebitwalletoutput.go new file mode 100755 index 00000000..023fd459 --- /dev/null +++ b/pkg/models/shared/v2activitydebitwalletoutput.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityDebitWalletOutput struct { + Data V2Hold `json:"data"` +} + +func (o *V2ActivityDebitWalletOutput) GetData() V2Hold { + if o == nil { + return V2Hold{} + } + return o.Data +} diff --git a/pkg/models/shared/v2activitygetaccount.go b/pkg/models/shared/v2activitygetaccount.go new file mode 100755 index 00000000..89f10c22 --- /dev/null +++ b/pkg/models/shared/v2activitygetaccount.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetAccount struct { + ID string `json:"id"` + Ledger string `json:"ledger"` +} + +func (o *V2ActivityGetAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2ActivityGetAccount) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} diff --git a/pkg/models/shared/v2activitygetaccountoutput.go b/pkg/models/shared/v2activitygetaccountoutput.go new file mode 100755 index 00000000..9047bfab --- /dev/null +++ b/pkg/models/shared/v2activitygetaccountoutput.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetAccountOutput struct { + Data V2Account `json:"data"` +} + +func (o *V2ActivityGetAccountOutput) GetData() V2Account { + if o == nil { + return V2Account{} + } + return o.Data +} diff --git a/pkg/models/shared/v2activitygetpayment.go b/pkg/models/shared/v2activitygetpayment.go new file mode 100755 index 00000000..38b65781 --- /dev/null +++ b/pkg/models/shared/v2activitygetpayment.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetPayment struct { + ID string `json:"id"` +} + +func (o *V2ActivityGetPayment) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2activitygetpaymentoutput.go b/pkg/models/shared/v2activitygetpaymentoutput.go new file mode 100755 index 00000000..d5e48da4 --- /dev/null +++ b/pkg/models/shared/v2activitygetpaymentoutput.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetPaymentOutput struct { + Data V2Payment `json:"data"` +} + +func (o *V2ActivityGetPaymentOutput) GetData() V2Payment { + if o == nil { + return V2Payment{} + } + return o.Data +} diff --git a/pkg/models/shared/v2activitygetwallet.go b/pkg/models/shared/v2activitygetwallet.go new file mode 100755 index 00000000..c5f70fcd --- /dev/null +++ b/pkg/models/shared/v2activitygetwallet.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetWallet struct { + ID string `json:"id"` +} + +func (o *V2ActivityGetWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2activitygetwalletoutput.go b/pkg/models/shared/v2activitygetwalletoutput.go new file mode 100755 index 00000000..2d6ac809 --- /dev/null +++ b/pkg/models/shared/v2activitygetwalletoutput.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityGetWalletOutput struct { + Data V2WalletWithBalances `json:"data"` +} + +func (o *V2ActivityGetWalletOutput) GetData() V2WalletWithBalances { + if o == nil { + return V2WalletWithBalances{} + } + return o.Data +} diff --git a/pkg/models/shared/v2activitystripetransfer.go b/pkg/models/shared/v2activitystripetransfer.go new file mode 100755 index 00000000..251331f9 --- /dev/null +++ b/pkg/models/shared/v2activitystripetransfer.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +// V2ActivityStripeTransferMetadata - 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 V2ActivityStripeTransferMetadata struct { +} + +type V2ActivityStripeTransfer struct { + Amount *big.Int `json:"amount,omitempty"` + Asset *string `json:"asset,omitempty"` + ConnectorID *string `json:"connectorID,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 *V2ActivityStripeTransferMetadata `json:"metadata,omitempty"` + WaitingValidation *bool `default:"false" json:"waitingValidation"` +} + +func (v V2ActivityStripeTransfer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2ActivityStripeTransfer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2ActivityStripeTransfer) GetAmount() *big.Int { + if o == nil { + return nil + } + return o.Amount +} + +func (o *V2ActivityStripeTransfer) GetAsset() *string { + if o == nil { + return nil + } + return o.Asset +} + +func (o *V2ActivityStripeTransfer) GetConnectorID() *string { + if o == nil { + return nil + } + return o.ConnectorID +} + +func (o *V2ActivityStripeTransfer) GetDestination() *string { + if o == nil { + return nil + } + return o.Destination +} + +func (o *V2ActivityStripeTransfer) GetMetadata() *V2ActivityStripeTransferMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *V2ActivityStripeTransfer) GetWaitingValidation() *bool { + if o == nil { + return nil + } + return o.WaitingValidation +} diff --git a/pkg/models/shared/v2activityvoidhold.go b/pkg/models/shared/v2activityvoidhold.go new file mode 100755 index 00000000..8779dfe9 --- /dev/null +++ b/pkg/models/shared/v2activityvoidhold.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ActivityVoidHold struct { + ID string `json:"id"` +} + +func (o *V2ActivityVoidHold) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2aggregatebalancesresponse.go b/pkg/models/shared/v2aggregatebalancesresponse.go new file mode 100755 index 00000000..858aca94 --- /dev/null +++ b/pkg/models/shared/v2aggregatebalancesresponse.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2AggregateBalancesResponse struct { + Data map[string]*big.Int `json:"data"` +} + +func (v V2AggregateBalancesResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2AggregateBalancesResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2AggregateBalancesResponse) GetData() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.Data +} diff --git a/pkg/models/shared/v2assetholder.go b/pkg/models/shared/v2assetholder.go new file mode 100755 index 00000000..66e9f93a --- /dev/null +++ b/pkg/models/shared/v2assetholder.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2AssetHolder struct { + Assets map[string]*big.Int `json:"assets"` +} + +func (v V2AssetHolder) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2AssetHolder) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2AssetHolder) GetAssets() map[string]*big.Int { + if o == nil { + return map[string]*big.Int{} + } + return o.Assets +} diff --git a/pkg/models/shared/v2bulkelement.go b/pkg/models/shared/v2bulkelement.go new file mode 100755 index 00000000..586ef863 --- /dev/null +++ b/pkg/models/shared/v2bulkelement.go @@ -0,0 +1,338 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2BulkElementV2BulkElementDeleteMetadataData struct { + Key string `json:"key"` + TargetID V2TargetID `json:"targetId"` + TargetType V2TargetType `json:"targetType"` +} + +func (o *V2BulkElementV2BulkElementDeleteMetadataData) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *V2BulkElementV2BulkElementDeleteMetadataData) GetTargetID() V2TargetID { + if o == nil { + return V2TargetID{} + } + return o.TargetID +} + +func (o *V2BulkElementV2BulkElementDeleteMetadataData) GetTargetType() V2TargetType { + if o == nil { + return V2TargetType("") + } + return o.TargetType +} + +type V2BulkElementV2BulkElementDeleteMetadata struct { + Action string `json:"action"` + Data *V2BulkElementV2BulkElementDeleteMetadataData `json:"data,omitempty"` + Ik *string `json:"ik,omitempty"` +} + +func (o *V2BulkElementV2BulkElementDeleteMetadata) GetAction() string { + if o == nil { + return "" + } + return o.Action +} + +func (o *V2BulkElementV2BulkElementDeleteMetadata) GetData() *V2BulkElementV2BulkElementDeleteMetadataData { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2BulkElementV2BulkElementDeleteMetadata) GetIk() *string { + if o == nil { + return nil + } + return o.Ik +} + +type V2BulkElementV2BulkElementRevertTransactionData struct { + Force *bool `json:"force,omitempty"` + ID *big.Int `json:"id"` +} + +func (v V2BulkElementV2BulkElementRevertTransactionData) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2BulkElementV2BulkElementRevertTransactionData) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2BulkElementV2BulkElementRevertTransactionData) GetForce() *bool { + if o == nil { + return nil + } + return o.Force +} + +func (o *V2BulkElementV2BulkElementRevertTransactionData) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +type V2BulkElementV2BulkElementRevertTransaction struct { + Action string `json:"action"` + Data *V2BulkElementV2BulkElementRevertTransactionData `json:"data,omitempty"` + Ik *string `json:"ik,omitempty"` +} + +func (o *V2BulkElementV2BulkElementRevertTransaction) GetAction() string { + if o == nil { + return "" + } + return o.Action +} + +func (o *V2BulkElementV2BulkElementRevertTransaction) GetData() *V2BulkElementV2BulkElementRevertTransactionData { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2BulkElementV2BulkElementRevertTransaction) GetIk() *string { + if o == nil { + return nil + } + return o.Ik +} + +type V2BulkElementV2BulkElementAddMetadataData struct { + Metadata map[string]string `json:"metadata"` + TargetID V2TargetID `json:"targetId"` + TargetType V2TargetType `json:"targetType"` +} + +func (o *V2BulkElementV2BulkElementAddMetadataData) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2BulkElementV2BulkElementAddMetadataData) GetTargetID() V2TargetID { + if o == nil { + return V2TargetID{} + } + return o.TargetID +} + +func (o *V2BulkElementV2BulkElementAddMetadataData) GetTargetType() V2TargetType { + if o == nil { + return V2TargetType("") + } + return o.TargetType +} + +type V2BulkElementV2BulkElementAddMetadata struct { + Action string `json:"action"` + Data *V2BulkElementV2BulkElementAddMetadataData `json:"data,omitempty"` + Ik *string `json:"ik,omitempty"` +} + +func (o *V2BulkElementV2BulkElementAddMetadata) GetAction() string { + if o == nil { + return "" + } + return o.Action +} + +func (o *V2BulkElementV2BulkElementAddMetadata) GetData() *V2BulkElementV2BulkElementAddMetadataData { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2BulkElementV2BulkElementAddMetadata) GetIk() *string { + if o == nil { + return nil + } + return o.Ik +} + +type V2BulkElementV2BulkElementCreateTransaction struct { + Action string `json:"action"` + Data *V2PostTransaction `json:"data,omitempty"` + Ik *string `json:"ik,omitempty"` +} + +func (o *V2BulkElementV2BulkElementCreateTransaction) GetAction() string { + if o == nil { + return "" + } + return o.Action +} + +func (o *V2BulkElementV2BulkElementCreateTransaction) GetData() *V2PostTransaction { + if o == nil { + return nil + } + return o.Data +} + +func (o *V2BulkElementV2BulkElementCreateTransaction) GetIk() *string { + if o == nil { + return nil + } + return o.Ik +} + +type V2BulkElementType string + +const ( + V2BulkElementTypeAddMetadata V2BulkElementType = "ADD_METADATA" + V2BulkElementTypeCreateTransaction V2BulkElementType = "CREATE_TRANSACTION" + V2BulkElementTypeDeleteMetadata V2BulkElementType = "DELETE_METADATA" + V2BulkElementTypeRevertTransaction V2BulkElementType = "REVERT_TRANSACTION" +) + +type V2BulkElement struct { + V2BulkElementV2BulkElementCreateTransaction *V2BulkElementV2BulkElementCreateTransaction + V2BulkElementV2BulkElementAddMetadata *V2BulkElementV2BulkElementAddMetadata + V2BulkElementV2BulkElementRevertTransaction *V2BulkElementV2BulkElementRevertTransaction + V2BulkElementV2BulkElementDeleteMetadata *V2BulkElementV2BulkElementDeleteMetadata + + Type V2BulkElementType +} + +func CreateV2BulkElementAddMetadata(addMetadata V2BulkElementV2BulkElementAddMetadata) V2BulkElement { + typ := V2BulkElementTypeAddMetadata + typStr := string(typ) + addMetadata.Action = typStr + + return V2BulkElement{ + V2BulkElementV2BulkElementAddMetadata: &addMetadata, + Type: typ, + } +} + +func CreateV2BulkElementCreateTransaction(createTransaction V2BulkElementV2BulkElementCreateTransaction) V2BulkElement { + typ := V2BulkElementTypeCreateTransaction + typStr := string(typ) + createTransaction.Action = typStr + + return V2BulkElement{ + V2BulkElementV2BulkElementCreateTransaction: &createTransaction, + Type: typ, + } +} + +func CreateV2BulkElementDeleteMetadata(deleteMetadata V2BulkElementV2BulkElementDeleteMetadata) V2BulkElement { + typ := V2BulkElementTypeDeleteMetadata + typStr := string(typ) + deleteMetadata.Action = typStr + + return V2BulkElement{ + V2BulkElementV2BulkElementDeleteMetadata: &deleteMetadata, + Type: typ, + } +} + +func CreateV2BulkElementRevertTransaction(revertTransaction V2BulkElementV2BulkElementRevertTransaction) V2BulkElement { + typ := V2BulkElementTypeRevertTransaction + typStr := string(typ) + revertTransaction.Action = typStr + + return V2BulkElement{ + V2BulkElementV2BulkElementRevertTransaction: &revertTransaction, + Type: typ, + } +} + +func (u *V2BulkElement) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Action string + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Action { + case "ADD_METADATA": + v2BulkElementV2BulkElementAddMetadata := new(V2BulkElementV2BulkElementAddMetadata) + if err := utils.UnmarshalJSON(data, &v2BulkElementV2BulkElementAddMetadata, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementV2BulkElementAddMetadata = v2BulkElementV2BulkElementAddMetadata + u.Type = V2BulkElementTypeAddMetadata + return nil + case "CREATE_TRANSACTION": + v2BulkElementV2BulkElementCreateTransaction := new(V2BulkElementV2BulkElementCreateTransaction) + if err := utils.UnmarshalJSON(data, &v2BulkElementV2BulkElementCreateTransaction, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementV2BulkElementCreateTransaction = v2BulkElementV2BulkElementCreateTransaction + u.Type = V2BulkElementTypeCreateTransaction + return nil + case "DELETE_METADATA": + v2BulkElementV2BulkElementDeleteMetadata := new(V2BulkElementV2BulkElementDeleteMetadata) + if err := utils.UnmarshalJSON(data, &v2BulkElementV2BulkElementDeleteMetadata, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementV2BulkElementDeleteMetadata = v2BulkElementV2BulkElementDeleteMetadata + u.Type = V2BulkElementTypeDeleteMetadata + return nil + case "REVERT_TRANSACTION": + v2BulkElementV2BulkElementRevertTransaction := new(V2BulkElementV2BulkElementRevertTransaction) + if err := utils.UnmarshalJSON(data, &v2BulkElementV2BulkElementRevertTransaction, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementV2BulkElementRevertTransaction = v2BulkElementV2BulkElementRevertTransaction + u.Type = V2BulkElementTypeRevertTransaction + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u V2BulkElement) MarshalJSON() ([]byte, error) { + if u.V2BulkElementV2BulkElementCreateTransaction != nil { + return utils.MarshalJSON(u.V2BulkElementV2BulkElementCreateTransaction, "", true) + } + + if u.V2BulkElementV2BulkElementAddMetadata != nil { + return utils.MarshalJSON(u.V2BulkElementV2BulkElementAddMetadata, "", true) + } + + if u.V2BulkElementV2BulkElementRevertTransaction != nil { + return utils.MarshalJSON(u.V2BulkElementV2BulkElementRevertTransaction, "", true) + } + + if u.V2BulkElementV2BulkElementDeleteMetadata != nil { + return utils.MarshalJSON(u.V2BulkElementV2BulkElementDeleteMetadata, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/v2bulkelementresult.go b/pkg/models/shared/v2bulkelementresult.go new file mode 100755 index 00000000..9380cac9 --- /dev/null +++ b/pkg/models/shared/v2bulkelementresult.go @@ -0,0 +1,266 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" +) + +type V2BulkElementResultV2BulkElementResultError struct { + ErrorCode string `json:"errorCode"` + ErrorDescription string `json:"errorDescription"` + ErrorDetails *string `json:"errorDetails,omitempty"` + ResponseType string `json:"responseType"` +} + +func (o *V2BulkElementResultV2BulkElementResultError) GetErrorCode() string { + if o == nil { + return "" + } + return o.ErrorCode +} + +func (o *V2BulkElementResultV2BulkElementResultError) GetErrorDescription() string { + if o == nil { + return "" + } + return o.ErrorDescription +} + +func (o *V2BulkElementResultV2BulkElementResultError) GetErrorDetails() *string { + if o == nil { + return nil + } + return o.ErrorDetails +} + +func (o *V2BulkElementResultV2BulkElementResultError) GetResponseType() string { + if o == nil { + return "" + } + return o.ResponseType +} + +type V2BulkElementResultV2BulkElementResultDeleteMetadata struct { + ResponseType string `json:"responseType"` +} + +func (o *V2BulkElementResultV2BulkElementResultDeleteMetadata) GetResponseType() string { + if o == nil { + return "" + } + return o.ResponseType +} + +type V2BulkElementResultV2BulkElementResultRevertTransaction struct { + Data V2Transaction `json:"data"` + ResponseType string `json:"responseType"` +} + +func (o *V2BulkElementResultV2BulkElementResultRevertTransaction) GetData() V2Transaction { + if o == nil { + return V2Transaction{} + } + return o.Data +} + +func (o *V2BulkElementResultV2BulkElementResultRevertTransaction) GetResponseType() string { + if o == nil { + return "" + } + return o.ResponseType +} + +type V2BulkElementResultV2BulkElementResultAddMetadata struct { + ResponseType string `json:"responseType"` +} + +func (o *V2BulkElementResultV2BulkElementResultAddMetadata) GetResponseType() string { + if o == nil { + return "" + } + return o.ResponseType +} + +type V2BulkElementResultV2BulkElementResultCreateTransaction struct { + Data V2Transaction `json:"data"` + ResponseType string `json:"responseType"` +} + +func (o *V2BulkElementResultV2BulkElementResultCreateTransaction) GetData() V2Transaction { + if o == nil { + return V2Transaction{} + } + return o.Data +} + +func (o *V2BulkElementResultV2BulkElementResultCreateTransaction) GetResponseType() string { + if o == nil { + return "" + } + return o.ResponseType +} + +type V2BulkElementResultType string + +const ( + V2BulkElementResultTypeAddMetadata V2BulkElementResultType = "ADD_METADATA" + V2BulkElementResultTypeCreateTransaction V2BulkElementResultType = "CREATE_TRANSACTION" + V2BulkElementResultTypeDeleteMetadata V2BulkElementResultType = "DELETE_METADATA" + V2BulkElementResultTypeError V2BulkElementResultType = "ERROR" + V2BulkElementResultTypeRevertTransaction V2BulkElementResultType = "REVERT_TRANSACTION" +) + +type V2BulkElementResult struct { + V2BulkElementResultV2BulkElementResultCreateTransaction *V2BulkElementResultV2BulkElementResultCreateTransaction + V2BulkElementResultV2BulkElementResultAddMetadata *V2BulkElementResultV2BulkElementResultAddMetadata + V2BulkElementResultV2BulkElementResultRevertTransaction *V2BulkElementResultV2BulkElementResultRevertTransaction + V2BulkElementResultV2BulkElementResultDeleteMetadata *V2BulkElementResultV2BulkElementResultDeleteMetadata + V2BulkElementResultV2BulkElementResultError *V2BulkElementResultV2BulkElementResultError + + Type V2BulkElementResultType +} + +func CreateV2BulkElementResultAddMetadata(addMetadata V2BulkElementResultV2BulkElementResultAddMetadata) V2BulkElementResult { + typ := V2BulkElementResultTypeAddMetadata + typStr := string(typ) + addMetadata.ResponseType = typStr + + return V2BulkElementResult{ + V2BulkElementResultV2BulkElementResultAddMetadata: &addMetadata, + Type: typ, + } +} + +func CreateV2BulkElementResultCreateTransaction(createTransaction V2BulkElementResultV2BulkElementResultCreateTransaction) V2BulkElementResult { + typ := V2BulkElementResultTypeCreateTransaction + typStr := string(typ) + createTransaction.ResponseType = typStr + + return V2BulkElementResult{ + V2BulkElementResultV2BulkElementResultCreateTransaction: &createTransaction, + Type: typ, + } +} + +func CreateV2BulkElementResultDeleteMetadata(deleteMetadata V2BulkElementResultV2BulkElementResultDeleteMetadata) V2BulkElementResult { + typ := V2BulkElementResultTypeDeleteMetadata + typStr := string(typ) + deleteMetadata.ResponseType = typStr + + return V2BulkElementResult{ + V2BulkElementResultV2BulkElementResultDeleteMetadata: &deleteMetadata, + Type: typ, + } +} + +func CreateV2BulkElementResultError(error V2BulkElementResultV2BulkElementResultError) V2BulkElementResult { + typ := V2BulkElementResultTypeError + typStr := string(typ) + error.ResponseType = typStr + + return V2BulkElementResult{ + V2BulkElementResultV2BulkElementResultError: &error, + Type: typ, + } +} + +func CreateV2BulkElementResultRevertTransaction(revertTransaction V2BulkElementResultV2BulkElementResultRevertTransaction) V2BulkElementResult { + typ := V2BulkElementResultTypeRevertTransaction + typStr := string(typ) + revertTransaction.ResponseType = typStr + + return V2BulkElementResult{ + V2BulkElementResultV2BulkElementResultRevertTransaction: &revertTransaction, + Type: typ, + } +} + +func (u *V2BulkElementResult) UnmarshalJSON(data []byte) error { + + type discriminator struct { + ResponseType string + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.ResponseType { + case "ADD_METADATA": + v2BulkElementResultV2BulkElementResultAddMetadata := new(V2BulkElementResultV2BulkElementResultAddMetadata) + if err := utils.UnmarshalJSON(data, &v2BulkElementResultV2BulkElementResultAddMetadata, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementResultV2BulkElementResultAddMetadata = v2BulkElementResultV2BulkElementResultAddMetadata + u.Type = V2BulkElementResultTypeAddMetadata + return nil + case "CREATE_TRANSACTION": + v2BulkElementResultV2BulkElementResultCreateTransaction := new(V2BulkElementResultV2BulkElementResultCreateTransaction) + if err := utils.UnmarshalJSON(data, &v2BulkElementResultV2BulkElementResultCreateTransaction, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementResultV2BulkElementResultCreateTransaction = v2BulkElementResultV2BulkElementResultCreateTransaction + u.Type = V2BulkElementResultTypeCreateTransaction + return nil + case "DELETE_METADATA": + v2BulkElementResultV2BulkElementResultDeleteMetadata := new(V2BulkElementResultV2BulkElementResultDeleteMetadata) + if err := utils.UnmarshalJSON(data, &v2BulkElementResultV2BulkElementResultDeleteMetadata, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementResultV2BulkElementResultDeleteMetadata = v2BulkElementResultV2BulkElementResultDeleteMetadata + u.Type = V2BulkElementResultTypeDeleteMetadata + return nil + case "ERROR": + v2BulkElementResultV2BulkElementResultError := new(V2BulkElementResultV2BulkElementResultError) + if err := utils.UnmarshalJSON(data, &v2BulkElementResultV2BulkElementResultError, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementResultV2BulkElementResultError = v2BulkElementResultV2BulkElementResultError + u.Type = V2BulkElementResultTypeError + return nil + case "REVERT_TRANSACTION": + v2BulkElementResultV2BulkElementResultRevertTransaction := new(V2BulkElementResultV2BulkElementResultRevertTransaction) + if err := utils.UnmarshalJSON(data, &v2BulkElementResultV2BulkElementResultRevertTransaction, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2BulkElementResultV2BulkElementResultRevertTransaction = v2BulkElementResultV2BulkElementResultRevertTransaction + u.Type = V2BulkElementResultTypeRevertTransaction + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u V2BulkElementResult) MarshalJSON() ([]byte, error) { + if u.V2BulkElementResultV2BulkElementResultCreateTransaction != nil { + return utils.MarshalJSON(u.V2BulkElementResultV2BulkElementResultCreateTransaction, "", true) + } + + if u.V2BulkElementResultV2BulkElementResultAddMetadata != nil { + return utils.MarshalJSON(u.V2BulkElementResultV2BulkElementResultAddMetadata, "", true) + } + + if u.V2BulkElementResultV2BulkElementResultRevertTransaction != nil { + return utils.MarshalJSON(u.V2BulkElementResultV2BulkElementResultRevertTransaction, "", true) + } + + if u.V2BulkElementResultV2BulkElementResultDeleteMetadata != nil { + return utils.MarshalJSON(u.V2BulkElementResultV2BulkElementResultDeleteMetadata, "", true) + } + + if u.V2BulkElementResultV2BulkElementResultError != nil { + return utils.MarshalJSON(u.V2BulkElementResultV2BulkElementResultError, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/v2bulkresponse.go b/pkg/models/shared/v2bulkresponse.go new file mode 100755 index 00000000..d00a5669 --- /dev/null +++ b/pkg/models/shared/v2bulkresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2BulkResponse struct { + Data []V2BulkElementResult `json:"data"` +} + +func (o *V2BulkResponse) GetData() []V2BulkElementResult { + if o == nil { + return []V2BulkElementResult{} + } + return o.Data +} diff --git a/pkg/models/shared/v2configinforesponse.go b/pkg/models/shared/v2configinforesponse.go new file mode 100755 index 00000000..ae0172c5 --- /dev/null +++ b/pkg/models/shared/v2configinforesponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ConfigInfoResponse struct { + Server string `json:"server"` + Version string `json:"version"` +} + +func (o *V2ConfigInfoResponse) GetServer() string { + if o == nil { + return "" + } + return o.Server +} + +func (o *V2ConfigInfoResponse) GetVersion() string { + if o == nil { + return "" + } + return o.Version +} diff --git a/pkg/models/shared/v2connector.go b/pkg/models/shared/v2connector.go new file mode 100755 index 00000000..fafdb974 --- /dev/null +++ b/pkg/models/shared/v2connector.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type V2Connector string + +const ( + V2ConnectorStripe V2Connector = "STRIPE" + V2ConnectorDummyPay V2Connector = "DUMMY-PAY" + V2ConnectorWise V2Connector = "WISE" + V2ConnectorModulr V2Connector = "MODULR" + V2ConnectorCurrencyCloud V2Connector = "CURRENCY-CLOUD" + V2ConnectorBankingCircle V2Connector = "BANKING-CIRCLE" + V2ConnectorMangopay V2Connector = "MANGOPAY" + V2ConnectorMoneycorp V2Connector = "MONEYCORP" +) + +func (e V2Connector) ToPointer() *V2Connector { + return &e +} + +func (e *V2Connector) 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": + fallthrough + case "MANGOPAY": + fallthrough + case "MONEYCORP": + *e = V2Connector(v) + return nil + default: + return fmt.Errorf("invalid value for V2Connector: %v", v) + } +} diff --git a/pkg/models/shared/v2createledgerrequest.go b/pkg/models/shared/v2createledgerrequest.go new file mode 100755 index 00000000..092cb9ec --- /dev/null +++ b/pkg/models/shared/v2createledgerrequest.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreateLedgerRequest struct { + Bucket *string `json:"bucket,omitempty"` +} + +func (o *V2CreateLedgerRequest) GetBucket() *string { + if o == nil { + return nil + } + return o.Bucket +} diff --git a/pkg/models/shared/v2createtransactionresponse.go b/pkg/models/shared/v2createtransactionresponse.go new file mode 100755 index 00000000..3c5cbc46 --- /dev/null +++ b/pkg/models/shared/v2createtransactionresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreateTransactionResponse struct { + Data V2Transaction `json:"data"` +} + +func (o *V2CreateTransactionResponse) GetData() V2Transaction { + if o == nil { + return V2Transaction{} + } + return o.Data +} diff --git a/pkg/models/shared/v2createtriggerresponse.go b/pkg/models/shared/v2createtriggerresponse.go new file mode 100755 index 00000000..2537d04a --- /dev/null +++ b/pkg/models/shared/v2createtriggerresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreateTriggerResponse struct { + Data V2Trigger `json:"data"` +} + +func (o *V2CreateTriggerResponse) GetData() V2Trigger { + if o == nil { + return V2Trigger{} + } + return o.Data +} diff --git a/pkg/models/shared/v2createworkflowrequest.go b/pkg/models/shared/v2createworkflowrequest.go new file mode 100755 index 00000000..f95db764 --- /dev/null +++ b/pkg/models/shared/v2createworkflowrequest.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreateWorkflowRequest struct { + Name *string `json:"name,omitempty"` + Stages []map[string]interface{} `json:"stages"` +} + +func (o *V2CreateWorkflowRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *V2CreateWorkflowRequest) GetStages() []map[string]interface{} { + if o == nil { + return []map[string]interface{}{} + } + return o.Stages +} diff --git a/pkg/models/shared/v2createworkflowresponse.go b/pkg/models/shared/v2createworkflowresponse.go new file mode 100755 index 00000000..13f77353 --- /dev/null +++ b/pkg/models/shared/v2createworkflowresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreateWorkflowResponse struct { + Data V2Workflow `json:"data"` +} + +func (o *V2CreateWorkflowResponse) GetData() V2Workflow { + if o == nil { + return V2Workflow{} + } + return o.Data +} diff --git a/pkg/models/shared/v2creditwalletrequest.go b/pkg/models/shared/v2creditwalletrequest.go new file mode 100755 index 00000000..d254b7a3 --- /dev/null +++ b/pkg/models/shared/v2creditwalletrequest.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2CreditWalletRequest struct { + Amount V2Monetary `json:"amount"` + // The balance to credit + Balance *string `json:"balance,omitempty"` + // Metadata associated with the wallet. + Metadata map[string]string `json:"metadata"` + Reference *string `json:"reference,omitempty"` + Sources []V2Subject `json:"sources"` +} + +func (o *V2CreditWalletRequest) GetAmount() V2Monetary { + if o == nil { + return V2Monetary{} + } + return o.Amount +} + +func (o *V2CreditWalletRequest) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *V2CreditWalletRequest) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2CreditWalletRequest) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *V2CreditWalletRequest) GetSources() []V2Subject { + if o == nil { + return []V2Subject{} + } + return o.Sources +} diff --git a/pkg/models/shared/v2debitwalletrequest.go b/pkg/models/shared/v2debitwalletrequest.go new file mode 100755 index 00000000..120f833d --- /dev/null +++ b/pkg/models/shared/v2debitwalletrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2DebitWalletRequest struct { + Amount V2Monetary `json:"amount"` + Balances []string `json:"balances,omitempty"` + Description *string `json:"description,omitempty"` + Destination *V2Subject `json:"destination,omitempty"` + // Metadata associated with the wallet. + Metadata map[string]string `json:"metadata"` + // Set to true to create a pending hold. If false, the wallet will be debited immediately. + Pending *bool `json:"pending,omitempty"` +} + +func (o *V2DebitWalletRequest) GetAmount() V2Monetary { + if o == nil { + return V2Monetary{} + } + return o.Amount +} + +func (o *V2DebitWalletRequest) GetBalances() []string { + if o == nil { + return nil + } + return o.Balances +} + +func (o *V2DebitWalletRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *V2DebitWalletRequest) GetDestination() *V2Subject { + if o == nil { + return nil + } + return o.Destination +} + +func (o *V2DebitWalletRequest) GetDestinationAccount() *V2LedgerAccountSubject { + if v := o.GetDestination(); v != nil { + return v.V2LedgerAccountSubject + } + return nil +} + +func (o *V2DebitWalletRequest) GetDestinationWallet() *V2WalletSubject { + if v := o.GetDestination(); v != nil { + return v.V2WalletSubject + } + return nil +} + +func (o *V2DebitWalletRequest) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2DebitWalletRequest) GetPending() *bool { + if o == nil { + return nil + } + return o.Pending +} diff --git a/pkg/models/shared/v2error.go b/pkg/models/shared/v2error.go new file mode 100755 index 00000000..ab1d7980 --- /dev/null +++ b/pkg/models/shared/v2error.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type V2ErrorErrorCode string + +const ( + V2ErrorErrorCodeValidation V2ErrorErrorCode = "VALIDATION" + V2ErrorErrorCodeNotFound V2ErrorErrorCode = "NOT_FOUND" +) + +func (e V2ErrorErrorCode) ToPointer() *V2ErrorErrorCode { + return &e +} + +func (e *V2ErrorErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "VALIDATION": + fallthrough + case "NOT_FOUND": + *e = V2ErrorErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for V2ErrorErrorCode: %v", v) + } +} + +type V2Error struct { + ErrorCode V2ErrorErrorCode `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *V2Error) GetErrorCode() V2ErrorErrorCode { + if o == nil { + return V2ErrorErrorCode("") + } + return o.ErrorCode +} + +func (o *V2Error) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/v2errorresponse.go b/pkg/models/shared/v2errorresponse.go new file mode 100755 index 00000000..c4e4a181 --- /dev/null +++ b/pkg/models/shared/v2errorresponse.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ErrorResponse struct { + Details *string `json:"details,omitempty"` + ErrorCode V2ErrorsEnum `json:"errorCode"` + ErrorMessage string `json:"errorMessage"` +} + +func (o *V2ErrorResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *V2ErrorResponse) GetErrorCode() V2ErrorsEnum { + if o == nil { + return V2ErrorsEnum("") + } + return o.ErrorCode +} + +func (o *V2ErrorResponse) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/v2errorsenum.go b/pkg/models/shared/v2errorsenum.go new file mode 100755 index 00000000..0d9d268b --- /dev/null +++ b/pkg/models/shared/v2errorsenum.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type V2ErrorsEnum string + +const ( + V2ErrorsEnumInternal V2ErrorsEnum = "INTERNAL" + V2ErrorsEnumInsufficientFund V2ErrorsEnum = "INSUFFICIENT_FUND" + V2ErrorsEnumValidation V2ErrorsEnum = "VALIDATION" + V2ErrorsEnumConflict V2ErrorsEnum = "CONFLICT" + V2ErrorsEnumCompilationFailed V2ErrorsEnum = "COMPILATION_FAILED" + V2ErrorsEnumMetadataOverride V2ErrorsEnum = "METADATA_OVERRIDE" + V2ErrorsEnumNotFound V2ErrorsEnum = "NOT_FOUND" + V2ErrorsEnumRevertOccurring V2ErrorsEnum = "REVERT_OCCURRING" + V2ErrorsEnumAlreadyRevert V2ErrorsEnum = "ALREADY_REVERT" + V2ErrorsEnumNoPostings V2ErrorsEnum = "NO_POSTINGS" +) + +func (e V2ErrorsEnum) ToPointer() *V2ErrorsEnum { + return &e +} + +func (e *V2ErrorsEnum) 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 "COMPILATION_FAILED": + fallthrough + case "METADATA_OVERRIDE": + fallthrough + case "NOT_FOUND": + fallthrough + case "REVERT_OCCURRING": + fallthrough + case "ALREADY_REVERT": + fallthrough + case "NO_POSTINGS": + *e = V2ErrorsEnum(v) + return nil + default: + return fmt.Errorf("invalid value for V2ErrorsEnum: %v", v) + } +} diff --git a/pkg/models/shared/v2expandedtransaction.go b/pkg/models/shared/v2expandedtransaction.go new file mode 100755 index 00000000..264f32c8 --- /dev/null +++ b/pkg/models/shared/v2expandedtransaction.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type V2ExpandedTransaction struct { + ID *big.Int `json:"id"` + Metadata map[string]string `json:"metadata"` + PostCommitVolumes map[string]map[string]V2Volume `json:"postCommitVolumes,omitempty"` + Postings []V2Posting `json:"postings"` + PreCommitVolumes map[string]map[string]V2Volume `json:"preCommitVolumes,omitempty"` + Reference *string `json:"reference,omitempty"` + Reverted bool `json:"reverted"` + Timestamp time.Time `json:"timestamp"` +} + +func (v V2ExpandedTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2ExpandedTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2ExpandedTransaction) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2ExpandedTransaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2ExpandedTransaction) GetPostCommitVolumes() map[string]map[string]V2Volume { + if o == nil { + return nil + } + return o.PostCommitVolumes +} + +func (o *V2ExpandedTransaction) GetPostings() []V2Posting { + if o == nil { + return []V2Posting{} + } + return o.Postings +} + +func (o *V2ExpandedTransaction) GetPreCommitVolumes() map[string]map[string]V2Volume { + if o == nil { + return nil + } + return o.PreCommitVolumes +} + +func (o *V2ExpandedTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *V2ExpandedTransaction) GetReverted() bool { + if o == nil { + return false + } + return o.Reverted +} + +func (o *V2ExpandedTransaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} diff --git a/pkg/models/shared/v2gettransactionresponse.go b/pkg/models/shared/v2gettransactionresponse.go new file mode 100755 index 00000000..59caf12d --- /dev/null +++ b/pkg/models/shared/v2gettransactionresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2GetTransactionResponse struct { + Data V2ExpandedTransaction `json:"data"` +} + +func (o *V2GetTransactionResponse) GetData() V2ExpandedTransaction { + if o == nil { + return V2ExpandedTransaction{} + } + return o.Data +} diff --git a/pkg/models/shared/v2getworkflowinstancehistoryresponse.go b/pkg/models/shared/v2getworkflowinstancehistoryresponse.go new file mode 100755 index 00000000..e9080776 --- /dev/null +++ b/pkg/models/shared/v2getworkflowinstancehistoryresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2GetWorkflowInstanceHistoryResponse struct { + Data []V2WorkflowInstanceHistory `json:"data"` +} + +func (o *V2GetWorkflowInstanceHistoryResponse) GetData() []V2WorkflowInstanceHistory { + if o == nil { + return []V2WorkflowInstanceHistory{} + } + return o.Data +} diff --git a/pkg/models/shared/v2getworkflowinstancehistorystageresponse.go b/pkg/models/shared/v2getworkflowinstancehistorystageresponse.go new file mode 100755 index 00000000..f99ff019 --- /dev/null +++ b/pkg/models/shared/v2getworkflowinstancehistorystageresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2GetWorkflowInstanceHistoryStageResponse struct { + Data []V2WorkflowInstanceHistoryStage `json:"data"` +} + +func (o *V2GetWorkflowInstanceHistoryStageResponse) GetData() []V2WorkflowInstanceHistoryStage { + if o == nil { + return []V2WorkflowInstanceHistoryStage{} + } + return o.Data +} diff --git a/pkg/models/shared/v2getworkflowinstanceresponse.go b/pkg/models/shared/v2getworkflowinstanceresponse.go new file mode 100755 index 00000000..202b1c3d --- /dev/null +++ b/pkg/models/shared/v2getworkflowinstanceresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2GetWorkflowInstanceResponse struct { + Data V2WorkflowInstance `json:"data"` +} + +func (o *V2GetWorkflowInstanceResponse) GetData() V2WorkflowInstance { + if o == nil { + return V2WorkflowInstance{} + } + return o.Data +} diff --git a/pkg/models/shared/v2getworkflowresponse.go b/pkg/models/shared/v2getworkflowresponse.go new file mode 100755 index 00000000..db876006 --- /dev/null +++ b/pkg/models/shared/v2getworkflowresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2GetWorkflowResponse struct { + Data V2Workflow `json:"data"` +} + +func (o *V2GetWorkflowResponse) GetData() V2Workflow { + if o == nil { + return V2Workflow{} + } + return o.Data +} diff --git a/pkg/models/shared/v2hold.go b/pkg/models/shared/v2hold.go new file mode 100755 index 00000000..a7df2e39 --- /dev/null +++ b/pkg/models/shared/v2hold.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2Hold struct { + Description string `json:"description"` + Destination *V2Subject `json:"destination,omitempty"` + // The unique ID of the hold. + ID string `json:"id"` + // Metadata associated with the hold. + Metadata map[string]string `json:"metadata"` + // The ID of the wallet the hold is associated with. + WalletID string `json:"walletID"` +} + +func (o *V2Hold) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *V2Hold) GetDestination() *V2Subject { + if o == nil { + return nil + } + return o.Destination +} + +func (o *V2Hold) GetDestinationAccount() *V2LedgerAccountSubject { + if v := o.GetDestination(); v != nil { + return v.V2LedgerAccountSubject + } + return nil +} + +func (o *V2Hold) GetDestinationWallet() *V2WalletSubject { + if v := o.GetDestination(); v != nil { + return v.V2WalletSubject + } + return nil +} + +func (o *V2Hold) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2Hold) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2Hold) GetWalletID() string { + if o == nil { + return "" + } + return o.WalletID +} diff --git a/pkg/models/shared/v2ledger.go b/pkg/models/shared/v2ledger.go new file mode 100755 index 00000000..5750eedf --- /dev/null +++ b/pkg/models/shared/v2ledger.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2Ledger struct { + AddedAt time.Time `json:"addedAt"` + Bucket string `json:"bucket"` + Name string `json:"name"` +} + +func (v V2Ledger) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Ledger) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Ledger) GetAddedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.AddedAt +} + +func (o *V2Ledger) GetBucket() string { + if o == nil { + return "" + } + return o.Bucket +} + +func (o *V2Ledger) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/v2ledgeraccountsubject.go b/pkg/models/shared/v2ledgeraccountsubject.go new file mode 100755 index 00000000..379a01fe --- /dev/null +++ b/pkg/models/shared/v2ledgeraccountsubject.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2LedgerAccountSubject struct { + Identifier string `json:"identifier"` + Type string `json:"type"` +} + +func (o *V2LedgerAccountSubject) GetIdentifier() string { + if o == nil { + return "" + } + return o.Identifier +} + +func (o *V2LedgerAccountSubject) GetType() string { + if o == nil { + return "" + } + return o.Type +} diff --git a/pkg/models/shared/v2ledgerinfo.go b/pkg/models/shared/v2ledgerinfo.go new file mode 100755 index 00000000..4bef5f15 --- /dev/null +++ b/pkg/models/shared/v2ledgerinfo.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2LedgerInfoStorage struct { + Migrations []V2MigrationInfo `json:"migrations,omitempty"` +} + +func (o *V2LedgerInfoStorage) GetMigrations() []V2MigrationInfo { + if o == nil { + return nil + } + return o.Migrations +} + +type V2LedgerInfo struct { + Name *string `json:"name,omitempty"` + Storage *V2LedgerInfoStorage `json:"storage,omitempty"` +} + +func (o *V2LedgerInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *V2LedgerInfo) GetStorage() *V2LedgerInfoStorage { + if o == nil { + return nil + } + return o.Storage +} diff --git a/pkg/models/shared/v2ledgerinforesponse.go b/pkg/models/shared/v2ledgerinforesponse.go new file mode 100755 index 00000000..5335eb4b --- /dev/null +++ b/pkg/models/shared/v2ledgerinforesponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2LedgerInfoResponse struct { + Data *V2LedgerInfo `json:"data,omitempty"` +} + +func (o *V2LedgerInfoResponse) GetData() *V2LedgerInfo { + if o == nil { + return nil + } + return o.Data +} diff --git a/pkg/models/shared/v2ledgerlistresponse.go b/pkg/models/shared/v2ledgerlistresponse.go new file mode 100755 index 00000000..7f416a31 --- /dev/null +++ b/pkg/models/shared/v2ledgerlistresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2LedgerListResponseCursor struct { + Data []V2Ledger `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2LedgerListResponseCursor) GetData() []V2Ledger { + if o == nil { + return []V2Ledger{} + } + return o.Data +} + +func (o *V2LedgerListResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2LedgerListResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2LedgerListResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2LedgerListResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2LedgerListResponse struct { + Cursor V2LedgerListResponseCursor `json:"cursor"` +} + +func (o *V2LedgerListResponse) GetCursor() V2LedgerListResponseCursor { + if o == nil { + return V2LedgerListResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2listrunsresponse.go b/pkg/models/shared/v2listrunsresponse.go new file mode 100755 index 00000000..bf529611 --- /dev/null +++ b/pkg/models/shared/v2listrunsresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ListRunsResponseCursor struct { + Data []V2WorkflowInstance `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2ListRunsResponseCursor) GetData() []V2WorkflowInstance { + if o == nil { + return []V2WorkflowInstance{} + } + return o.Data +} + +func (o *V2ListRunsResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2ListRunsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2ListRunsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2ListRunsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2ListRunsResponse struct { + Cursor V2ListRunsResponseCursor `json:"cursor"` +} + +func (o *V2ListRunsResponse) GetCursor() V2ListRunsResponseCursor { + if o == nil { + return V2ListRunsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2listtriggersoccurrencesresponse.go b/pkg/models/shared/v2listtriggersoccurrencesresponse.go new file mode 100755 index 00000000..3dcba0ce --- /dev/null +++ b/pkg/models/shared/v2listtriggersoccurrencesresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ListTriggersOccurrencesResponseCursor struct { + Data []V2TriggerOccurrence `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2ListTriggersOccurrencesResponseCursor) GetData() []V2TriggerOccurrence { + if o == nil { + return []V2TriggerOccurrence{} + } + return o.Data +} + +func (o *V2ListTriggersOccurrencesResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2ListTriggersOccurrencesResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2ListTriggersOccurrencesResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2ListTriggersOccurrencesResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2ListTriggersOccurrencesResponse struct { + Cursor V2ListTriggersOccurrencesResponseCursor `json:"cursor"` +} + +func (o *V2ListTriggersOccurrencesResponse) GetCursor() V2ListTriggersOccurrencesResponseCursor { + if o == nil { + return V2ListTriggersOccurrencesResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2listtriggersresponse.go b/pkg/models/shared/v2listtriggersresponse.go new file mode 100755 index 00000000..78504366 --- /dev/null +++ b/pkg/models/shared/v2listtriggersresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ListTriggersResponseCursor struct { + Data []V2Trigger `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2ListTriggersResponseCursor) GetData() []V2Trigger { + if o == nil { + return []V2Trigger{} + } + return o.Data +} + +func (o *V2ListTriggersResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2ListTriggersResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2ListTriggersResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2ListTriggersResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2ListTriggersResponse struct { + Cursor V2ListTriggersResponseCursor `json:"cursor"` +} + +func (o *V2ListTriggersResponse) GetCursor() V2ListTriggersResponseCursor { + if o == nil { + return V2ListTriggersResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2listworkflowsresponse.go b/pkg/models/shared/v2listworkflowsresponse.go new file mode 100755 index 00000000..7c0f4fd9 --- /dev/null +++ b/pkg/models/shared/v2listworkflowsresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ListWorkflowsResponseCursor struct { + Data []V2Workflow `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2ListWorkflowsResponseCursor) GetData() []V2Workflow { + if o == nil { + return []V2Workflow{} + } + return o.Data +} + +func (o *V2ListWorkflowsResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2ListWorkflowsResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2ListWorkflowsResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2ListWorkflowsResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2ListWorkflowsResponse struct { + Cursor V2ListWorkflowsResponseCursor `json:"cursor"` +} + +func (o *V2ListWorkflowsResponse) GetCursor() V2ListWorkflowsResponseCursor { + if o == nil { + return V2ListWorkflowsResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2log.go b/pkg/models/shared/v2log.go new file mode 100755 index 00000000..877f39db --- /dev/null +++ b/pkg/models/shared/v2log.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type V2LogType string + +const ( + V2LogTypeNewTransaction V2LogType = "NEW_TRANSACTION" + V2LogTypeSetMetadata V2LogType = "SET_METADATA" + V2LogTypeRevertedTransaction V2LogType = "REVERTED_TRANSACTION" +) + +func (e V2LogType) ToPointer() *V2LogType { + return &e +} + +func (e *V2LogType) 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": + fallthrough + case "REVERTED_TRANSACTION": + *e = V2LogType(v) + return nil + default: + return fmt.Errorf("invalid value for V2LogType: %v", v) + } +} + +type V2Log struct { + Data map[string]interface{} `json:"data"` + Date time.Time `json:"date"` + Hash string `json:"hash"` + ID *big.Int `json:"id"` + Type V2LogType `json:"type"` +} + +func (v V2Log) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Log) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Log) GetData() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Data +} + +func (o *V2Log) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *V2Log) GetHash() string { + if o == nil { + return "" + } + return o.Hash +} + +func (o *V2Log) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2Log) GetType() V2LogType { + if o == nil { + return V2LogType("") + } + return o.Type +} diff --git a/pkg/models/shared/v2logscursorresponse.go b/pkg/models/shared/v2logscursorresponse.go new file mode 100755 index 00000000..daa4ba55 --- /dev/null +++ b/pkg/models/shared/v2logscursorresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2LogsCursorResponseCursor struct { + Data []V2Log `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2LogsCursorResponseCursor) GetData() []V2Log { + if o == nil { + return []V2Log{} + } + return o.Data +} + +func (o *V2LogsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2LogsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2LogsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2LogsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2LogsCursorResponse struct { + Cursor V2LogsCursorResponseCursor `json:"cursor"` +} + +func (o *V2LogsCursorResponse) GetCursor() V2LogsCursorResponseCursor { + if o == nil { + return V2LogsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2migrationinfo.go b/pkg/models/shared/v2migrationinfo.go new file mode 100755 index 00000000..5e7a74df --- /dev/null +++ b/pkg/models/shared/v2migrationinfo.go @@ -0,0 +1,83 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2MigrationInfoState string + +const ( + V2MigrationInfoStateToDo V2MigrationInfoState = "to do" + V2MigrationInfoStateDone V2MigrationInfoState = "done" +) + +func (e V2MigrationInfoState) ToPointer() *V2MigrationInfoState { + return &e +} + +func (e *V2MigrationInfoState) 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 = V2MigrationInfoState(v) + return nil + default: + return fmt.Errorf("invalid value for V2MigrationInfoState: %v", v) + } +} + +type V2MigrationInfo struct { + Date *time.Time `json:"date,omitempty"` + Name *string `json:"name,omitempty"` + State *V2MigrationInfoState `json:"state,omitempty"` + Version *int64 `json:"version,omitempty"` +} + +func (v V2MigrationInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2MigrationInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2MigrationInfo) GetDate() *time.Time { + if o == nil { + return nil + } + return o.Date +} + +func (o *V2MigrationInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *V2MigrationInfo) GetState() *V2MigrationInfoState { + if o == nil { + return nil + } + return o.State +} + +func (o *V2MigrationInfo) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} diff --git a/pkg/models/shared/v2monetary.go b/pkg/models/shared/v2monetary.go new file mode 100755 index 00000000..bda215b4 --- /dev/null +++ b/pkg/models/shared/v2monetary.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2Monetary struct { + // The amount of the monetary value. + Amount *big.Int `json:"amount"` + // The asset of the monetary value. + Asset string `json:"asset"` +} + +func (v V2Monetary) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Monetary) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Monetary) GetAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Amount +} + +func (o *V2Monetary) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} diff --git a/pkg/models/shared/v2payment.go b/pkg/models/shared/v2payment.go new file mode 100755 index 00000000..bc830d26 --- /dev/null +++ b/pkg/models/shared/v2payment.go @@ -0,0 +1,256 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type V2PaymentRaw struct { +} + +type V2PaymentScheme string + +const ( + V2PaymentSchemeVisa V2PaymentScheme = "visa" + V2PaymentSchemeMastercard V2PaymentScheme = "mastercard" + V2PaymentSchemeAmex V2PaymentScheme = "amex" + V2PaymentSchemeDiners V2PaymentScheme = "diners" + V2PaymentSchemeDiscover V2PaymentScheme = "discover" + V2PaymentSchemeJcb V2PaymentScheme = "jcb" + V2PaymentSchemeUnionpay V2PaymentScheme = "unionpay" + V2PaymentSchemeSepaDebit V2PaymentScheme = "sepa debit" + V2PaymentSchemeSepaCredit V2PaymentScheme = "sepa credit" + V2PaymentSchemeSepa V2PaymentScheme = "sepa" + V2PaymentSchemeApplePay V2PaymentScheme = "apple pay" + V2PaymentSchemeGooglePay V2PaymentScheme = "google pay" + V2PaymentSchemeA2a V2PaymentScheme = "a2a" + V2PaymentSchemeAchDebit V2PaymentScheme = "ach debit" + V2PaymentSchemeAch V2PaymentScheme = "ach" + V2PaymentSchemeRtp V2PaymentScheme = "rtp" + V2PaymentSchemeUnknown V2PaymentScheme = "unknown" + V2PaymentSchemeOther V2PaymentScheme = "other" +) + +func (e V2PaymentScheme) ToPointer() *V2PaymentScheme { + return &e +} + +func (e *V2PaymentScheme) 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 = V2PaymentScheme(v) + return nil + default: + return fmt.Errorf("invalid value for V2PaymentScheme: %v", v) + } +} + +type V2PaymentType string + +const ( + V2PaymentTypePayIn V2PaymentType = "PAY-IN" + V2PaymentTypePayout V2PaymentType = "PAYOUT" + V2PaymentTypeTransfer V2PaymentType = "TRANSFER" + V2PaymentTypeOther V2PaymentType = "OTHER" +) + +func (e V2PaymentType) ToPointer() *V2PaymentType { + return &e +} + +func (e *V2PaymentType) 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 = V2PaymentType(v) + return nil + default: + return fmt.Errorf("invalid value for V2PaymentType: %v", v) + } +} + +type V2Payment struct { + Adjustments []V2PaymentAdjustment `json:"adjustments"` + Asset string `json:"asset"` + ConnectorID string `json:"connectorID"` + CreatedAt time.Time `json:"createdAt"` + DestinationAccountID string `json:"destinationAccountID"` + ID string `json:"id"` + InitialAmount *big.Int `json:"initialAmount"` + Metadata *V2PaymentMetadata `json:"metadata"` + Provider *V2Connector `json:"provider,omitempty"` + Raw *V2PaymentRaw `json:"raw"` + Reference string `json:"reference"` + Scheme V2PaymentScheme `json:"scheme"` + SourceAccountID string `json:"sourceAccountID"` + Status V2PaymentStatus `json:"status"` + Type V2PaymentType `json:"type"` +} + +func (v V2Payment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Payment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Payment) GetAdjustments() []V2PaymentAdjustment { + if o == nil { + return []V2PaymentAdjustment{} + } + return o.Adjustments +} + +func (o *V2Payment) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} + +func (o *V2Payment) GetConnectorID() string { + if o == nil { + return "" + } + return o.ConnectorID +} + +func (o *V2Payment) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *V2Payment) GetDestinationAccountID() string { + if o == nil { + return "" + } + return o.DestinationAccountID +} + +func (o *V2Payment) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2Payment) GetInitialAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.InitialAmount +} + +func (o *V2Payment) GetMetadata() *V2PaymentMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *V2Payment) GetProvider() *V2Connector { + if o == nil { + return nil + } + return o.Provider +} + +func (o *V2Payment) GetRaw() *V2PaymentRaw { + if o == nil { + return nil + } + return o.Raw +} + +func (o *V2Payment) GetReference() string { + if o == nil { + return "" + } + return o.Reference +} + +func (o *V2Payment) GetScheme() V2PaymentScheme { + if o == nil { + return V2PaymentScheme("") + } + return o.Scheme +} + +func (o *V2Payment) GetSourceAccountID() string { + if o == nil { + return "" + } + return o.SourceAccountID +} + +func (o *V2Payment) GetStatus() V2PaymentStatus { + if o == nil { + return V2PaymentStatus("") + } + return o.Status +} + +func (o *V2Payment) GetType() V2PaymentType { + if o == nil { + return V2PaymentType("") + } + return o.Type +} diff --git a/pkg/models/shared/v2paymentadjustment.go b/pkg/models/shared/v2paymentadjustment.go new file mode 100755 index 00000000..5e03ddba --- /dev/null +++ b/pkg/models/shared/v2paymentadjustment.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type V2PaymentAdjustmentRaw struct { +} + +type V2PaymentAdjustment struct { + Absolute bool `json:"absolute"` + Amount *big.Int `json:"amount"` + Date time.Time `json:"date"` + Raw V2PaymentAdjustmentRaw `json:"raw"` + Status V2PaymentStatus `json:"status"` +} + +func (v V2PaymentAdjustment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2PaymentAdjustment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2PaymentAdjustment) GetAbsolute() bool { + if o == nil { + return false + } + return o.Absolute +} + +func (o *V2PaymentAdjustment) GetAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Amount +} + +func (o *V2PaymentAdjustment) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *V2PaymentAdjustment) GetRaw() V2PaymentAdjustmentRaw { + if o == nil { + return V2PaymentAdjustmentRaw{} + } + return o.Raw +} + +func (o *V2PaymentAdjustment) GetStatus() V2PaymentStatus { + if o == nil { + return V2PaymentStatus("") + } + return o.Status +} diff --git a/pkg/models/shared/v2paymentmetadata.go b/pkg/models/shared/v2paymentmetadata.go new file mode 100755 index 00000000..1fc7b070 --- /dev/null +++ b/pkg/models/shared/v2paymentmetadata.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2PaymentMetadata struct { + Key *string `json:"key,omitempty"` +} + +func (o *V2PaymentMetadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} diff --git a/pkg/models/shared/v2paymentstatus.go b/pkg/models/shared/v2paymentstatus.go new file mode 100755 index 00000000..ea07953a --- /dev/null +++ b/pkg/models/shared/v2paymentstatus.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type V2PaymentStatus string + +const ( + V2PaymentStatusPending V2PaymentStatus = "PENDING" + V2PaymentStatusActive V2PaymentStatus = "ACTIVE" + V2PaymentStatusTerminated V2PaymentStatus = "TERMINATED" + V2PaymentStatusFailed V2PaymentStatus = "FAILED" + V2PaymentStatusSucceeded V2PaymentStatus = "SUCCEEDED" + V2PaymentStatusCancelled V2PaymentStatus = "CANCELLED" +) + +func (e V2PaymentStatus) ToPointer() *V2PaymentStatus { + return &e +} + +func (e *V2PaymentStatus) 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": + fallthrough + case "SUCCEEDED": + fallthrough + case "CANCELLED": + *e = V2PaymentStatus(v) + return nil + default: + return fmt.Errorf("invalid value for V2PaymentStatus: %v", v) + } +} diff --git a/pkg/models/shared/v2posting.go b/pkg/models/shared/v2posting.go new file mode 100755 index 00000000..e9e78270 --- /dev/null +++ b/pkg/models/shared/v2posting.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2Posting struct { + Amount *big.Int `json:"amount"` + Asset string `json:"asset"` + Destination string `json:"destination"` + Source string `json:"source"` +} + +func (v V2Posting) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Posting) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Posting) GetAmount() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Amount +} + +func (o *V2Posting) GetAsset() string { + if o == nil { + return "" + } + return o.Asset +} + +func (o *V2Posting) GetDestination() string { + if o == nil { + return "" + } + return o.Destination +} + +func (o *V2Posting) GetSource() string { + if o == nil { + return "" + } + return o.Source +} diff --git a/pkg/models/shared/v2posttransaction.go b/pkg/models/shared/v2posttransaction.go new file mode 100755 index 00000000..0517f4d3 --- /dev/null +++ b/pkg/models/shared/v2posttransaction.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2PostTransactionScript struct { + Plain string `json:"plain"` + Vars map[string]interface{} `json:"vars,omitempty"` +} + +func (o *V2PostTransactionScript) GetPlain() string { + if o == nil { + return "" + } + return o.Plain +} + +func (o *V2PostTransactionScript) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +type V2PostTransaction struct { + Metadata map[string]string `json:"metadata"` + Postings []V2Posting `json:"postings,omitempty"` + Reference *string `json:"reference,omitempty"` + Script *V2PostTransactionScript `json:"script,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +func (v V2PostTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2PostTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2PostTransaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2PostTransaction) GetPostings() []V2Posting { + if o == nil { + return nil + } + return o.Postings +} + +func (o *V2PostTransaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *V2PostTransaction) GetScript() *V2PostTransactionScript { + if o == nil { + return nil + } + return o.Script +} + +func (o *V2PostTransaction) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} diff --git a/pkg/models/shared/v2readtriggerresponse.go b/pkg/models/shared/v2readtriggerresponse.go new file mode 100755 index 00000000..48e46588 --- /dev/null +++ b/pkg/models/shared/v2readtriggerresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ReadTriggerResponse struct { + Data V2Trigger `json:"data"` +} + +func (o *V2ReadTriggerResponse) GetData() V2Trigger { + if o == nil { + return V2Trigger{} + } + return o.Data +} diff --git a/pkg/models/shared/v2reverttransactionresponse.go b/pkg/models/shared/v2reverttransactionresponse.go new file mode 100755 index 00000000..941b274d --- /dev/null +++ b/pkg/models/shared/v2reverttransactionresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2RevertTransactionResponse struct { + Data OrchestrationV2Transaction `json:"data"` +} + +func (o *V2RevertTransactionResponse) GetData() OrchestrationV2Transaction { + if o == nil { + return OrchestrationV2Transaction{} + } + return o.Data +} diff --git a/pkg/models/shared/v2runworkflowresponse.go b/pkg/models/shared/v2runworkflowresponse.go new file mode 100755 index 00000000..999501fa --- /dev/null +++ b/pkg/models/shared/v2runworkflowresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2RunWorkflowResponse struct { + Data V2WorkflowInstance `json:"data"` +} + +func (o *V2RunWorkflowResponse) GetData() V2WorkflowInstance { + if o == nil { + return V2WorkflowInstance{} + } + return o.Data +} diff --git a/pkg/models/shared/v2serverinfo.go b/pkg/models/shared/v2serverinfo.go new file mode 100755 index 00000000..f292d643 --- /dev/null +++ b/pkg/models/shared/v2serverinfo.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2ServerInfo struct { + Version string `json:"version"` +} + +func (o *V2ServerInfo) GetVersion() string { + if o == nil { + return "" + } + return o.Version +} diff --git a/pkg/models/shared/v2stage.go b/pkg/models/shared/v2stage.go new file mode 100755 index 00000000..8ecf5490 --- /dev/null +++ b/pkg/models/shared/v2stage.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "errors" + "github.com/formancehq/formance-sdk-go/pkg/utils" +) + +type V2StageType string + +const ( + V2StageTypeV2StageSend V2StageType = "V2StageSend" + V2StageTypeV2StageDelay V2StageType = "V2StageDelay" + V2StageTypeV2StageWaitEvent V2StageType = "V2StageWaitEvent" +) + +type V2Stage struct { + V2StageSend *V2StageSend + V2StageDelay *V2StageDelay + V2StageWaitEvent *V2StageWaitEvent + + Type V2StageType +} + +func CreateV2StageV2StageSend(v2StageSend V2StageSend) V2Stage { + typ := V2StageTypeV2StageSend + + return V2Stage{ + V2StageSend: &v2StageSend, + Type: typ, + } +} + +func CreateV2StageV2StageDelay(v2StageDelay V2StageDelay) V2Stage { + typ := V2StageTypeV2StageDelay + + return V2Stage{ + V2StageDelay: &v2StageDelay, + Type: typ, + } +} + +func CreateV2StageV2StageWaitEvent(v2StageWaitEvent V2StageWaitEvent) V2Stage { + typ := V2StageTypeV2StageWaitEvent + + return V2Stage{ + V2StageWaitEvent: &v2StageWaitEvent, + Type: typ, + } +} + +func (u *V2Stage) UnmarshalJSON(data []byte) error { + + v2StageWaitEvent := V2StageWaitEvent{} + if err := utils.UnmarshalJSON(data, &v2StageWaitEvent, "", true, true); err == nil { + u.V2StageWaitEvent = &v2StageWaitEvent + u.Type = V2StageTypeV2StageWaitEvent + return nil + } + + v2StageDelay := V2StageDelay{} + if err := utils.UnmarshalJSON(data, &v2StageDelay, "", true, true); err == nil { + u.V2StageDelay = &v2StageDelay + u.Type = V2StageTypeV2StageDelay + return nil + } + + v2StageSend := V2StageSend{} + if err := utils.UnmarshalJSON(data, &v2StageSend, "", true, true); err == nil { + u.V2StageSend = &v2StageSend + u.Type = V2StageTypeV2StageSend + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u V2Stage) MarshalJSON() ([]byte, error) { + if u.V2StageSend != nil { + return utils.MarshalJSON(u.V2StageSend, "", true) + } + + if u.V2StageDelay != nil { + return utils.MarshalJSON(u.V2StageDelay, "", true) + } + + if u.V2StageWaitEvent != nil { + return utils.MarshalJSON(u.V2StageWaitEvent, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/v2stagedelay.go b/pkg/models/shared/v2stagedelay.go new file mode 100755 index 00000000..e86bece1 --- /dev/null +++ b/pkg/models/shared/v2stagedelay.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2StageDelay struct { + Duration *string `json:"duration,omitempty"` + Until *time.Time `json:"until,omitempty"` +} + +func (v V2StageDelay) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2StageDelay) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, true); err != nil { + return err + } + return nil +} + +func (o *V2StageDelay) GetDuration() *string { + if o == nil { + return nil + } + return o.Duration +} + +func (o *V2StageDelay) GetUntil() *time.Time { + if o == nil { + return nil + } + return o.Until +} diff --git a/pkg/models/shared/v2stagesend.go b/pkg/models/shared/v2stagesend.go new file mode 100755 index 00000000..cd454966 --- /dev/null +++ b/pkg/models/shared/v2stagesend.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSend struct { + Amount *V2Monetary `json:"amount,omitempty"` + Destination *V2StageSendDestination `json:"destination,omitempty"` + Source *V2StageSendSource `json:"source,omitempty"` +} + +func (o *V2StageSend) GetAmount() *V2Monetary { + if o == nil { + return nil + } + return o.Amount +} + +func (o *V2StageSend) GetDestination() *V2StageSendDestination { + if o == nil { + return nil + } + return o.Destination +} + +func (o *V2StageSend) GetSource() *V2StageSendSource { + if o == nil { + return nil + } + return o.Source +} diff --git a/pkg/models/shared/v2stagesenddestination.go b/pkg/models/shared/v2stagesenddestination.go new file mode 100755 index 00000000..7d51b276 --- /dev/null +++ b/pkg/models/shared/v2stagesenddestination.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendDestination struct { + Account *V2StageSendDestinationAccount `json:"account,omitempty"` + Payment *V2StageSendDestinationPayment `json:"payment,omitempty"` + Wallet *V2StageSendDestinationWallet `json:"wallet,omitempty"` +} + +func (o *V2StageSendDestination) GetAccount() *V2StageSendDestinationAccount { + if o == nil { + return nil + } + return o.Account +} + +func (o *V2StageSendDestination) GetPayment() *V2StageSendDestinationPayment { + if o == nil { + return nil + } + return o.Payment +} + +func (o *V2StageSendDestination) GetWallet() *V2StageSendDestinationWallet { + if o == nil { + return nil + } + return o.Wallet +} diff --git a/pkg/models/shared/v2stagesenddestinationaccount.go b/pkg/models/shared/v2stagesenddestinationaccount.go new file mode 100755 index 00000000..26f10b92 --- /dev/null +++ b/pkg/models/shared/v2stagesenddestinationaccount.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendDestinationAccount struct { + ID string `json:"id"` + Ledger *string `json:"ledger,omitempty"` +} + +func (o *V2StageSendDestinationAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2StageSendDestinationAccount) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} diff --git a/pkg/models/shared/v2stagesenddestinationpayment.go b/pkg/models/shared/v2stagesenddestinationpayment.go new file mode 100755 index 00000000..30cbd497 --- /dev/null +++ b/pkg/models/shared/v2stagesenddestinationpayment.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendDestinationPayment struct { + Psp string `json:"psp"` +} + +func (o *V2StageSendDestinationPayment) GetPsp() string { + if o == nil { + return "" + } + return o.Psp +} diff --git a/pkg/models/shared/v2stagesenddestinationwallet.go b/pkg/models/shared/v2stagesenddestinationwallet.go new file mode 100755 index 00000000..6011671b --- /dev/null +++ b/pkg/models/shared/v2stagesenddestinationwallet.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendDestinationWallet struct { + Balance *string `json:"balance,omitempty"` + ID string `json:"id"` +} + +func (o *V2StageSendDestinationWallet) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *V2StageSendDestinationWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2stagesendsource.go b/pkg/models/shared/v2stagesendsource.go new file mode 100755 index 00000000..45e4d0e5 --- /dev/null +++ b/pkg/models/shared/v2stagesendsource.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendSource struct { + Account *V2StageSendSourceAccount `json:"account,omitempty"` + Payment *V2StageSendSourcePayment `json:"payment,omitempty"` + Wallet *V2StageSendSourceWallet `json:"wallet,omitempty"` +} + +func (o *V2StageSendSource) GetAccount() *V2StageSendSourceAccount { + if o == nil { + return nil + } + return o.Account +} + +func (o *V2StageSendSource) GetPayment() *V2StageSendSourcePayment { + if o == nil { + return nil + } + return o.Payment +} + +func (o *V2StageSendSource) GetWallet() *V2StageSendSourceWallet { + if o == nil { + return nil + } + return o.Wallet +} diff --git a/pkg/models/shared/v2stagesendsourceaccount.go b/pkg/models/shared/v2stagesendsourceaccount.go new file mode 100755 index 00000000..004853d7 --- /dev/null +++ b/pkg/models/shared/v2stagesendsourceaccount.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendSourceAccount struct { + ID string `json:"id"` + Ledger *string `json:"ledger,omitempty"` +} + +func (o *V2StageSendSourceAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2StageSendSourceAccount) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} diff --git a/pkg/models/shared/v2stagesendsourcepayment.go b/pkg/models/shared/v2stagesendsourcepayment.go new file mode 100755 index 00000000..4c2fb929 --- /dev/null +++ b/pkg/models/shared/v2stagesendsourcepayment.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendSourcePayment struct { + ID string `json:"id"` +} + +func (o *V2StageSendSourcePayment) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2stagesendsourcewallet.go b/pkg/models/shared/v2stagesendsourcewallet.go new file mode 100755 index 00000000..50e7fe72 --- /dev/null +++ b/pkg/models/shared/v2stagesendsourcewallet.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageSendSourceWallet struct { + Balance *string `json:"balance,omitempty"` + ID string `json:"id"` +} + +func (o *V2StageSendSourceWallet) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *V2StageSendSourceWallet) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/pkg/models/shared/v2stagestatus.go b/pkg/models/shared/v2stagestatus.go new file mode 100755 index 00000000..fb4f0f5d --- /dev/null +++ b/pkg/models/shared/v2stagestatus.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2StageStatus struct { + Error *string `json:"error,omitempty"` + InstanceID string `json:"instanceID"` + Stage float64 `json:"stage"` + StartedAt time.Time `json:"startedAt"` + TerminatedAt *time.Time `json:"terminatedAt,omitempty"` +} + +func (v V2StageStatus) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2StageStatus) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2StageStatus) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *V2StageStatus) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +func (o *V2StageStatus) GetStage() float64 { + if o == nil { + return 0.0 + } + return o.Stage +} + +func (o *V2StageStatus) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *V2StageStatus) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} diff --git a/pkg/models/shared/v2stagewaitevent.go b/pkg/models/shared/v2stagewaitevent.go new file mode 100755 index 00000000..10bf6171 --- /dev/null +++ b/pkg/models/shared/v2stagewaitevent.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StageWaitEvent struct { + Event string `json:"event"` +} + +func (o *V2StageWaitEvent) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} diff --git a/pkg/models/shared/v2stats.go b/pkg/models/shared/v2stats.go new file mode 100755 index 00000000..46352c2e --- /dev/null +++ b/pkg/models/shared/v2stats.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2Stats struct { + Accounts int64 `json:"accounts"` + Transactions *big.Int `json:"transactions"` +} + +func (v V2Stats) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Stats) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Stats) GetAccounts() int64 { + if o == nil { + return 0 + } + return o.Accounts +} + +func (o *V2Stats) GetTransactions() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Transactions +} diff --git a/pkg/models/shared/v2statsresponse.go b/pkg/models/shared/v2statsresponse.go new file mode 100755 index 00000000..1b02d730 --- /dev/null +++ b/pkg/models/shared/v2statsresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2StatsResponse struct { + Data V2Stats `json:"data"` +} + +func (o *V2StatsResponse) GetData() V2Stats { + if o == nil { + return V2Stats{} + } + return o.Data +} diff --git a/pkg/models/shared/v2subject.go b/pkg/models/shared/v2subject.go new file mode 100755 index 00000000..b774c30d --- /dev/null +++ b/pkg/models/shared/v2subject.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/utils" +) + +type V2SubjectType string + +const ( + V2SubjectTypeAccount V2SubjectType = "ACCOUNT" + V2SubjectTypeWallet V2SubjectType = "WALLET" +) + +type V2Subject struct { + V2LedgerAccountSubject *V2LedgerAccountSubject + V2WalletSubject *V2WalletSubject + + Type V2SubjectType +} + +func CreateV2SubjectAccount(account V2LedgerAccountSubject) V2Subject { + typ := V2SubjectTypeAccount + typStr := string(typ) + account.Type = typStr + + return V2Subject{ + V2LedgerAccountSubject: &account, + Type: typ, + } +} + +func CreateV2SubjectWallet(wallet V2WalletSubject) V2Subject { + typ := V2SubjectTypeWallet + typStr := string(typ) + wallet.Type = typStr + + return V2Subject{ + V2WalletSubject: &wallet, + Type: typ, + } +} + +func (u *V2Subject) 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": + v2LedgerAccountSubject := new(V2LedgerAccountSubject) + if err := utils.UnmarshalJSON(data, &v2LedgerAccountSubject, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2LedgerAccountSubject = v2LedgerAccountSubject + u.Type = V2SubjectTypeAccount + return nil + case "WALLET": + v2WalletSubject := new(V2WalletSubject) + if err := utils.UnmarshalJSON(data, &v2WalletSubject, "", true, true); err != nil { + return fmt.Errorf("could not unmarshal expected type: %w", err) + } + + u.V2WalletSubject = v2WalletSubject + u.Type = V2SubjectTypeWallet + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u V2Subject) MarshalJSON() ([]byte, error) { + if u.V2LedgerAccountSubject != nil { + return utils.MarshalJSON(u.V2LedgerAccountSubject, "", true) + } + + if u.V2WalletSubject != nil { + return utils.MarshalJSON(u.V2WalletSubject, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/v2targetid.go b/pkg/models/shared/v2targetid.go new file mode 100755 index 00000000..ee46279e --- /dev/null +++ b/pkg/models/shared/v2targetid.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "errors" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2TargetIDType string + +const ( + V2TargetIDTypeStr V2TargetIDType = "str" + V2TargetIDTypeBigint V2TargetIDType = "bigint" +) + +type V2TargetID struct { + Str *string + Bigint *big.Int + + Type V2TargetIDType +} + +func CreateV2TargetIDStr(str string) V2TargetID { + typ := V2TargetIDTypeStr + + return V2TargetID{ + Str: &str, + Type: typ, + } +} + +func CreateV2TargetIDBigint(bigint *big.Int) V2TargetID { + typ := V2TargetIDTypeBigint + + return V2TargetID{ + Bigint: bigint, + Type: typ, + } +} + +func (u *V2TargetID) UnmarshalJSON(data []byte) error { + + str := "" + if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { + u.Str = &str + u.Type = V2TargetIDTypeStr + return nil + } + + bigint := big.NewInt(0) + if err := utils.UnmarshalJSON(data, &bigint, "", true, true); err == nil { + u.Bigint = bigint + u.Type = V2TargetIDTypeBigint + return nil + } + + return errors.New("could not unmarshal into supported union types") +} + +func (u V2TargetID) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Bigint != nil { + return utils.MarshalJSON(u.Bigint, "", true) + } + + return nil, errors.New("could not marshal union type: all fields are null") +} diff --git a/pkg/models/shared/v2targettype.go b/pkg/models/shared/v2targettype.go new file mode 100755 index 00000000..97f2d96b --- /dev/null +++ b/pkg/models/shared/v2targettype.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type V2TargetType string + +const ( + V2TargetTypeTransaction V2TargetType = "TRANSACTION" + V2TargetTypeAccount V2TargetType = "ACCOUNT" +) + +func (e V2TargetType) ToPointer() *V2TargetType { + return &e +} + +func (e *V2TargetType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TRANSACTION": + fallthrough + case "ACCOUNT": + *e = V2TargetType(v) + return nil + default: + return fmt.Errorf("invalid value for V2TargetType: %v", v) + } +} diff --git a/pkg/models/shared/v2transaction.go b/pkg/models/shared/v2transaction.go new file mode 100755 index 00000000..98df13f4 --- /dev/null +++ b/pkg/models/shared/v2transaction.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" + "time" +) + +type V2Transaction struct { + ID *big.Int `json:"id"` + Metadata map[string]string `json:"metadata"` + Postings []V2Posting `json:"postings"` + Reference *string `json:"reference,omitempty"` + Reverted bool `json:"reverted"` + Timestamp time.Time `json:"timestamp"` +} + +func (v V2Transaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Transaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Transaction) GetID() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.ID +} + +func (o *V2Transaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2Transaction) GetPostings() []V2Posting { + if o == nil { + return []V2Posting{} + } + return o.Postings +} + +func (o *V2Transaction) GetReference() *string { + if o == nil { + return nil + } + return o.Reference +} + +func (o *V2Transaction) GetReverted() bool { + if o == nil { + return false + } + return o.Reverted +} + +func (o *V2Transaction) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} diff --git a/pkg/models/shared/v2transactionscursorresponse.go b/pkg/models/shared/v2transactionscursorresponse.go new file mode 100755 index 00000000..32d99e41 --- /dev/null +++ b/pkg/models/shared/v2transactionscursorresponse.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2TransactionsCursorResponseCursor struct { + Data []V2ExpandedTransaction `json:"data"` + HasMore bool `json:"hasMore"` + Next *string `json:"next,omitempty"` + PageSize int64 `json:"pageSize"` + Previous *string `json:"previous,omitempty"` +} + +func (o *V2TransactionsCursorResponseCursor) GetData() []V2ExpandedTransaction { + if o == nil { + return []V2ExpandedTransaction{} + } + return o.Data +} + +func (o *V2TransactionsCursorResponseCursor) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *V2TransactionsCursorResponseCursor) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *V2TransactionsCursorResponseCursor) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *V2TransactionsCursorResponseCursor) GetPrevious() *string { + if o == nil { + return nil + } + return o.Previous +} + +type V2TransactionsCursorResponse struct { + Cursor V2TransactionsCursorResponseCursor `json:"cursor"` +} + +func (o *V2TransactionsCursorResponse) GetCursor() V2TransactionsCursorResponseCursor { + if o == nil { + return V2TransactionsCursorResponseCursor{} + } + return o.Cursor +} diff --git a/pkg/models/shared/v2trigger.go b/pkg/models/shared/v2trigger.go new file mode 100755 index 00000000..b9cc4e45 --- /dev/null +++ b/pkg/models/shared/v2trigger.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2Trigger struct { + CreatedAt time.Time `json:"createdAt"` + Event string `json:"event"` + Filter *string `json:"filter,omitempty"` + ID string `json:"id"` + Vars map[string]interface{} `json:"vars,omitempty"` + WorkflowID string `json:"workflowID"` +} + +func (v V2Trigger) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Trigger) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Trigger) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *V2Trigger) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} + +func (o *V2Trigger) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +func (o *V2Trigger) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2Trigger) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +func (o *V2Trigger) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/v2triggerdata.go b/pkg/models/shared/v2triggerdata.go new file mode 100755 index 00000000..12ac45f5 --- /dev/null +++ b/pkg/models/shared/v2triggerdata.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2TriggerData struct { + Event string `json:"event"` + Filter *string `json:"filter,omitempty"` + Vars map[string]interface{} `json:"vars,omitempty"` + WorkflowID string `json:"workflowID"` +} + +func (o *V2TriggerData) GetEvent() string { + if o == nil { + return "" + } + return o.Event +} + +func (o *V2TriggerData) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +func (o *V2TriggerData) GetVars() map[string]interface{} { + if o == nil { + return nil + } + return o.Vars +} + +func (o *V2TriggerData) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/v2triggeroccurrence.go b/pkg/models/shared/v2triggeroccurrence.go new file mode 100755 index 00000000..8a2d1d38 --- /dev/null +++ b/pkg/models/shared/v2triggeroccurrence.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2TriggerOccurrence struct { + Date time.Time `json:"date"` + Event map[string]interface{} `json:"event"` + TriggerID string `json:"triggerID"` + WorkflowInstanceID string `json:"workflowInstanceID"` +} + +func (v V2TriggerOccurrence) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2TriggerOccurrence) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2TriggerOccurrence) GetDate() time.Time { + if o == nil { + return time.Time{} + } + return o.Date +} + +func (o *V2TriggerOccurrence) GetEvent() map[string]interface{} { + if o == nil { + return map[string]interface{}{} + } + return o.Event +} + +func (o *V2TriggerOccurrence) GetTriggerID() string { + if o == nil { + return "" + } + return o.TriggerID +} + +func (o *V2TriggerOccurrence) GetWorkflowInstanceID() string { + if o == nil { + return "" + } + return o.WorkflowInstanceID +} diff --git a/pkg/models/shared/v2volume.go b/pkg/models/shared/v2volume.go new file mode 100755 index 00000000..7fe0ea9e --- /dev/null +++ b/pkg/models/shared/v2volume.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "math/big" +) + +type V2Volume struct { + Balance *big.Int `json:"balance,omitempty"` + Input *big.Int `json:"input"` + Output *big.Int `json:"output"` +} + +func (v V2Volume) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Volume) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Volume) GetBalance() *big.Int { + if o == nil { + return nil + } + return o.Balance +} + +func (o *V2Volume) GetInput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Input +} + +func (o *V2Volume) GetOutput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Output +} diff --git a/pkg/models/shared/v2walletsubject.go b/pkg/models/shared/v2walletsubject.go new file mode 100755 index 00000000..0122dc9e --- /dev/null +++ b/pkg/models/shared/v2walletsubject.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2WalletSubject struct { + Balance *string `json:"balance,omitempty"` + Identifier string `json:"identifier"` + Type string `json:"type"` +} + +func (o *V2WalletSubject) GetBalance() *string { + if o == nil { + return nil + } + return o.Balance +} + +func (o *V2WalletSubject) GetIdentifier() string { + if o == nil { + return "" + } + return o.Identifier +} + +func (o *V2WalletSubject) GetType() string { + if o == nil { + return "" + } + return o.Type +} diff --git a/pkg/models/shared/v2walletwithbalances.go b/pkg/models/shared/v2walletwithbalances.go new file mode 100755 index 00000000..89cc7c1f --- /dev/null +++ b/pkg/models/shared/v2walletwithbalances.go @@ -0,0 +1,83 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2WalletWithBalancesBalances struct { + Main V2AssetHolder `json:"main"` +} + +func (o *V2WalletWithBalancesBalances) GetMain() V2AssetHolder { + if o == nil { + return V2AssetHolder{} + } + return o.Main +} + +type V2WalletWithBalances struct { + Balances V2WalletWithBalancesBalances `json:"balances"` + 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]string `json:"metadata"` + Name string `json:"name"` +} + +func (v V2WalletWithBalances) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2WalletWithBalances) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2WalletWithBalances) GetBalances() V2WalletWithBalancesBalances { + if o == nil { + return V2WalletWithBalancesBalances{} + } + return o.Balances +} + +func (o *V2WalletWithBalances) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *V2WalletWithBalances) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2WalletWithBalances) GetLedger() string { + if o == nil { + return "" + } + return o.Ledger +} + +func (o *V2WalletWithBalances) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + return o.Metadata +} + +func (o *V2WalletWithBalances) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/pkg/models/shared/v2workflow.go b/pkg/models/shared/v2workflow.go new file mode 100755 index 00000000..cd58f517 --- /dev/null +++ b/pkg/models/shared/v2workflow.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2Workflow struct { + Config V2WorkflowConfig `json:"config"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + UpdatedAt time.Time `json:"updatedAt"` +} + +func (v V2Workflow) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2Workflow) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2Workflow) GetConfig() V2WorkflowConfig { + if o == nil { + return V2WorkflowConfig{} + } + return o.Config +} + +func (o *V2Workflow) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *V2Workflow) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2Workflow) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/v2workflowconfig.go b/pkg/models/shared/v2workflowconfig.go new file mode 100755 index 00000000..98fd78d7 --- /dev/null +++ b/pkg/models/shared/v2workflowconfig.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2WorkflowConfig struct { + Name *string `json:"name,omitempty"` + Stages []map[string]interface{} `json:"stages"` +} + +func (o *V2WorkflowConfig) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *V2WorkflowConfig) GetStages() []map[string]interface{} { + if o == nil { + return []map[string]interface{}{} + } + return o.Stages +} diff --git a/pkg/models/shared/v2workflowinstance.go b/pkg/models/shared/v2workflowinstance.go new file mode 100755 index 00000000..2432f1c4 --- /dev/null +++ b/pkg/models/shared/v2workflowinstance.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2WorkflowInstance struct { + CreatedAt time.Time `json:"createdAt"` + Error *string `json:"error,omitempty"` + ID string `json:"id"` + Status []V2StageStatus `json:"status,omitempty"` + Terminated bool `json:"terminated"` + TerminatedAt *time.Time `json:"terminatedAt,omitempty"` + UpdatedAt time.Time `json:"updatedAt"` + WorkflowID string `json:"workflowID"` +} + +func (v V2WorkflowInstance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2WorkflowInstance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2WorkflowInstance) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *V2WorkflowInstance) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *V2WorkflowInstance) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *V2WorkflowInstance) GetStatus() []V2StageStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *V2WorkflowInstance) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *V2WorkflowInstance) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} + +func (o *V2WorkflowInstance) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *V2WorkflowInstance) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/v2workflowinstancehistory.go b/pkg/models/shared/v2workflowinstancehistory.go new file mode 100755 index 00000000..b76a70fe --- /dev/null +++ b/pkg/models/shared/v2workflowinstancehistory.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2WorkflowInstanceHistory struct { + Error *string `json:"error,omitempty"` + Input V2Stage `json:"input"` + Name string `json:"name"` + StartedAt time.Time `json:"startedAt"` + Terminated bool `json:"terminated"` + TerminatedAt *time.Time `json:"terminatedAt,omitempty"` +} + +func (v V2WorkflowInstanceHistory) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2WorkflowInstanceHistory) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2WorkflowInstanceHistory) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *V2WorkflowInstanceHistory) GetInput() V2Stage { + if o == nil { + return V2Stage{} + } + return o.Input +} + +func (o *V2WorkflowInstanceHistory) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *V2WorkflowInstanceHistory) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *V2WorkflowInstanceHistory) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *V2WorkflowInstanceHistory) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} diff --git a/pkg/models/shared/v2workflowinstancehistorystage.go b/pkg/models/shared/v2workflowinstancehistorystage.go new file mode 100755 index 00000000..c10f3807 --- /dev/null +++ b/pkg/models/shared/v2workflowinstancehistorystage.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" + "time" +) + +type V2WorkflowInstanceHistoryStage struct { + Attempt int64 `json:"attempt"` + Error *string `json:"error,omitempty"` + Input V2WorkflowInstanceHistoryStageInput `json:"input"` + LastFailure *string `json:"lastFailure,omitempty"` + Name string `json:"name"` + NextExecution *time.Time `json:"nextExecution,omitempty"` + Output *V2WorkflowInstanceHistoryStageOutput `json:"output,omitempty"` + StartedAt time.Time `json:"startedAt"` + Terminated bool `json:"terminated"` + TerminatedAt *time.Time `json:"terminatedAt,omitempty"` +} + +func (v V2WorkflowInstanceHistoryStage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *V2WorkflowInstanceHistoryStage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *V2WorkflowInstanceHistoryStage) GetAttempt() int64 { + if o == nil { + return 0 + } + return o.Attempt +} + +func (o *V2WorkflowInstanceHistoryStage) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *V2WorkflowInstanceHistoryStage) GetInput() V2WorkflowInstanceHistoryStageInput { + if o == nil { + return V2WorkflowInstanceHistoryStageInput{} + } + return o.Input +} + +func (o *V2WorkflowInstanceHistoryStage) GetLastFailure() *string { + if o == nil { + return nil + } + return o.LastFailure +} + +func (o *V2WorkflowInstanceHistoryStage) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *V2WorkflowInstanceHistoryStage) GetNextExecution() *time.Time { + if o == nil { + return nil + } + return o.NextExecution +} + +func (o *V2WorkflowInstanceHistoryStage) GetOutput() *V2WorkflowInstanceHistoryStageOutput { + if o == nil { + return nil + } + return o.Output +} + +func (o *V2WorkflowInstanceHistoryStage) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *V2WorkflowInstanceHistoryStage) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *V2WorkflowInstanceHistoryStage) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} diff --git a/pkg/models/shared/v2workflowinstancehistorystageinput.go b/pkg/models/shared/v2workflowinstancehistorystageinput.go new file mode 100755 index 00000000..64976ed9 --- /dev/null +++ b/pkg/models/shared/v2workflowinstancehistorystageinput.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2WorkflowInstanceHistoryStageInput struct { + ConfirmHold *V2ActivityConfirmHold `json:"ConfirmHold,omitempty"` + CreateTransaction *V2ActivityCreateTransaction `json:"CreateTransaction,omitempty"` + CreditWallet *V2ActivityCreditWallet `json:"CreditWallet,omitempty"` + DebitWallet *V2ActivityDebitWallet `json:"DebitWallet,omitempty"` + GetAccount *V2ActivityGetAccount `json:"GetAccount,omitempty"` + GetPayment *V2ActivityGetPayment `json:"GetPayment,omitempty"` + GetWallet *V2ActivityGetWallet `json:"GetWallet,omitempty"` + StripeTransfer *V2ActivityStripeTransfer `json:"StripeTransfer,omitempty"` + VoidHold *V2ActivityVoidHold `json:"VoidHold,omitempty"` +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetConfirmHold() *V2ActivityConfirmHold { + if o == nil { + return nil + } + return o.ConfirmHold +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetCreateTransaction() *V2ActivityCreateTransaction { + if o == nil { + return nil + } + return o.CreateTransaction +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetCreditWallet() *V2ActivityCreditWallet { + if o == nil { + return nil + } + return o.CreditWallet +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetDebitWallet() *V2ActivityDebitWallet { + if o == nil { + return nil + } + return o.DebitWallet +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetGetAccount() *V2ActivityGetAccount { + if o == nil { + return nil + } + return o.GetAccount +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetGetPayment() *V2ActivityGetPayment { + if o == nil { + return nil + } + return o.GetPayment +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetGetWallet() *V2ActivityGetWallet { + if o == nil { + return nil + } + return o.GetWallet +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetStripeTransfer() *V2ActivityStripeTransfer { + if o == nil { + return nil + } + return o.StripeTransfer +} + +func (o *V2WorkflowInstanceHistoryStageInput) GetVoidHold() *V2ActivityVoidHold { + if o == nil { + return nil + } + return o.VoidHold +} diff --git a/pkg/models/shared/v2workflowinstancehistorystageoutput.go b/pkg/models/shared/v2workflowinstancehistorystageoutput.go new file mode 100755 index 00000000..a4b5b0e6 --- /dev/null +++ b/pkg/models/shared/v2workflowinstancehistorystageoutput.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type V2WorkflowInstanceHistoryStageOutput struct { + CreateTransaction *V2ActivityCreateTransactionOutput `json:"CreateTransaction,omitempty"` + DebitWallet *V2ActivityDebitWalletOutput `json:"DebitWallet,omitempty"` + GetAccount *V2ActivityGetAccountOutput `json:"GetAccount,omitempty"` + GetPayment *V2ActivityGetPaymentOutput `json:"GetPayment,omitempty"` + GetWallet *V2ActivityGetWalletOutput `json:"GetWallet,omitempty"` +} + +func (o *V2WorkflowInstanceHistoryStageOutput) GetCreateTransaction() *V2ActivityCreateTransactionOutput { + if o == nil { + return nil + } + return o.CreateTransaction +} + +func (o *V2WorkflowInstanceHistoryStageOutput) GetDebitWallet() *V2ActivityDebitWalletOutput { + if o == nil { + return nil + } + return o.DebitWallet +} + +func (o *V2WorkflowInstanceHistoryStageOutput) GetGetAccount() *V2ActivityGetAccountOutput { + if o == nil { + return nil + } + return o.GetAccount +} + +func (o *V2WorkflowInstanceHistoryStageOutput) GetGetPayment() *V2ActivityGetPaymentOutput { + if o == nil { + return nil + } + return o.GetPayment +} + +func (o *V2WorkflowInstanceHistoryStageOutput) GetGetWallet() *V2ActivityGetWalletOutput { + if o == nil { + return nil + } + return o.GetWallet +} diff --git a/pkg/models/shared/version.go b/pkg/models/shared/version.go index a5191098..0b6ac101 100755 --- a/pkg/models/shared/version.go +++ b/pkg/models/shared/version.go @@ -7,3 +7,24 @@ type Version struct { Name string `json:"name"` Version string `json:"version"` } + +func (o *Version) GetHealth() bool { + if o == nil { + return false + } + return o.Health +} + +func (o *Version) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Version) GetVersion() string { + if o == nil { + return "" + } + return o.Version +} diff --git a/pkg/models/shared/volume.go b/pkg/models/shared/volume.go index 98fce0e9..54460ca9 100755 --- a/pkg/models/shared/volume.go +++ b/pkg/models/shared/volume.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -11,3 +12,35 @@ type Volume struct { Input *big.Int `json:"input"` Output *big.Int `json:"output"` } + +func (v Volume) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *Volume) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Volume) GetBalance() *big.Int { + if o == nil { + return nil + } + return o.Balance +} + +func (o *Volume) GetInput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Input +} + +func (o *Volume) GetOutput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Output +} diff --git a/pkg/models/shared/wallet.go b/pkg/models/shared/wallet.go index 46a5c4ac..d6324863 100755 --- a/pkg/models/shared/wallet.go +++ b/pkg/models/shared/wallet.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -15,3 +16,49 @@ type Wallet struct { Metadata map[string]string `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]string { + if o == nil { + return map[string]string{} + } + 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 7b67d81a..d58efbe9 100755 --- a/pkg/models/shared/walletserrorresponse.go +++ b/pkg/models/shared/walletserrorresponse.go @@ -40,8 +40,21 @@ func (e *WalletsErrorResponseErrorCode) UnmarshalJSON(data []byte) error { } } -// WalletsErrorResponse - Error 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 { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/walletsposting.go b/pkg/models/shared/walletsposting.go deleted file mode 100755 index 3e789ace..00000000 --- a/pkg/models/shared/walletsposting.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -import ( - "math/big" -) - -type WalletsPosting struct { - Amount *big.Int `json:"amount"` - Asset string `json:"asset"` - Destination string `json:"destination"` - Source string `json:"source"` -} diff --git a/pkg/models/shared/walletstransaction.go b/pkg/models/shared/walletstransaction.go index b05d2e0b..6b0f0119 100755 --- a/pkg/models/shared/walletstransaction.go +++ b/pkg/models/shared/walletstransaction.go @@ -3,17 +3,85 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) type WalletsTransaction struct { + ID int64 `json:"id"` Ledger *string `json:"ledger,omitempty"` // Metadata associated with the wallet. Metadata map[string]string `json:"metadata"` PostCommitVolumes map[string]map[string]WalletsVolume `json:"postCommitVolumes,omitempty"` - Postings []WalletsPosting `json:"postings"` + Postings []Posting `json:"postings"` PreCommitVolumes map[string]map[string]WalletsVolume `json:"preCommitVolumes,omitempty"` Reference *string `json:"reference,omitempty"` 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) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *WalletsTransaction) GetLedger() *string { + if o == nil { + return nil + } + return o.Ledger +} + +func (o *WalletsTransaction) GetMetadata() map[string]string { + if o == nil { + return map[string]string{} + } + 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 } diff --git a/pkg/models/shared/walletsubject.go b/pkg/models/shared/walletsubject.go index c7d81579..b06b40bc 100755 --- a/pkg/models/shared/walletsubject.go +++ b/pkg/models/shared/walletsubject.go @@ -7,3 +7,24 @@ type WalletSubject struct { 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 ff08e3ac..b1f0075b 100755 --- a/pkg/models/shared/walletsvolume.go +++ b/pkg/models/shared/walletsvolume.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "math/big" ) @@ -11,3 +12,35 @@ type WalletsVolume struct { Input *big.Int `json:"input"` Output *big.Int `json:"output"` } + +func (w WalletsVolume) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WalletsVolume) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WalletsVolume) GetBalance() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Balance +} + +func (o *WalletsVolume) GetInput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Input +} + +func (o *WalletsVolume) GetOutput() *big.Int { + if o == nil { + return big.NewInt(0) + } + return o.Output +} diff --git a/pkg/models/shared/walletwithbalances.go b/pkg/models/shared/walletwithbalances.go index f54285c5..78fa5643 100755 --- a/pkg/models/shared/walletwithbalances.go +++ b/pkg/models/shared/walletwithbalances.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -10,6 +11,13 @@ 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"` @@ -20,3 +28,56 @@ type WalletWithBalances struct { Metadata map[string]string `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]string { + if o == nil { + return map[string]string{} + } + 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 index dc577248..9f810dd7 100755 --- a/pkg/models/shared/webhooksconfig.go +++ b/pkg/models/shared/webhooksconfig.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -15,3 +16,63 @@ type WebhooksConfig struct { Secret string `json:"secret"` UpdatedAt time.Time `json:"updatedAt"` } + +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 false + } + return o.Active +} + +func (o *WebhooksConfig) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *WebhooksConfig) GetEndpoint() string { + if o == nil { + return "" + } + return o.Endpoint +} + +func (o *WebhooksConfig) GetEventTypes() []string { + if o == nil { + return []string{} + } + return o.EventTypes +} + +func (o *WebhooksConfig) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *WebhooksConfig) GetSecret() string { + if o == nil { + return "" + } + return o.Secret +} + +func (o *WebhooksConfig) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/pkg/models/shared/webhookserrorresponse.go b/pkg/models/shared/webhookserrorresponse.go index 41384be7..47121808 100755 --- a/pkg/models/shared/webhookserrorresponse.go +++ b/pkg/models/shared/webhookserrorresponse.go @@ -2,9 +2,29 @@ package shared -// WebhooksErrorResponse - Error type WebhooksErrorResponse struct { Details *string `json:"details,omitempty"` ErrorCode WebhooksErrorsEnum `json:"errorCode"` ErrorMessage string `json:"errorMessage"` } + +func (o *WebhooksErrorResponse) GetDetails() *string { + if o == nil { + return nil + } + return o.Details +} + +func (o *WebhooksErrorResponse) GetErrorCode() WebhooksErrorsEnum { + if o == nil { + return WebhooksErrorsEnum("") + } + return o.ErrorCode +} + +func (o *WebhooksErrorResponse) GetErrorMessage() string { + if o == nil { + return "" + } + return o.ErrorMessage +} diff --git a/pkg/models/shared/webhookserrorsenum.go b/pkg/models/shared/webhookserrorsenum.go index 1cb17382..10d0687d 100755 --- a/pkg/models/shared/webhookserrorsenum.go +++ b/pkg/models/shared/webhookserrorsenum.go @@ -10,16 +10,9 @@ import ( type WebhooksErrorsEnum string const ( - WebhooksErrorsEnumInternal WebhooksErrorsEnum = "INTERNAL" - WebhooksErrorsEnumInsufficientFund WebhooksErrorsEnum = "INSUFFICIENT_FUND" - WebhooksErrorsEnumValidation WebhooksErrorsEnum = "VALIDATION" - WebhooksErrorsEnumConflict WebhooksErrorsEnum = "CONFLICT" - WebhooksErrorsEnumNoScript WebhooksErrorsEnum = "NO_SCRIPT" - WebhooksErrorsEnumCompilationFailed WebhooksErrorsEnum = "COMPILATION_FAILED" - WebhooksErrorsEnumMetadataOverride WebhooksErrorsEnum = "METADATA_OVERRIDE" - WebhooksErrorsEnumNotFound WebhooksErrorsEnum = "NOT_FOUND" - WebhooksErrorsEnumContextCancelled WebhooksErrorsEnum = "CONTEXT_CANCELLED" - WebhooksErrorsEnumStore WebhooksErrorsEnum = "STORE" + WebhooksErrorsEnumInternal WebhooksErrorsEnum = "INTERNAL" + WebhooksErrorsEnumValidation WebhooksErrorsEnum = "VALIDATION" + WebhooksErrorsEnumNotFound WebhooksErrorsEnum = "NOT_FOUND" ) func (e WebhooksErrorsEnum) ToPointer() *WebhooksErrorsEnum { @@ -34,23 +27,9 @@ func (e *WebhooksErrorsEnum) UnmarshalJSON(data []byte) error { 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": - fallthrough case "NOT_FOUND": - fallthrough - case "CONTEXT_CANCELLED": - fallthrough - case "STORE": *e = WebhooksErrorsEnum(v) return nil default: diff --git a/pkg/models/shared/wiseconfig.go b/pkg/models/shared/wiseconfig.go deleted file mode 100755 index 42c00cee..00000000 --- a/pkg/models/shared/wiseconfig.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package shared - -type WiseConfig struct { - APIKey string `json:"apiKey"` - // The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. - // - PollingPeriod *string `json:"pollingPeriod,omitempty"` -} diff --git a/pkg/models/shared/workflow.go b/pkg/models/shared/workflow.go index 8d54b871..85bbe079 100755 --- a/pkg/models/shared/workflow.go +++ b/pkg/models/shared/workflow.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -12,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 cd1e856a..2f21f163 100755 --- a/pkg/models/shared/workflowconfig.go +++ b/pkg/models/shared/workflowconfig.go @@ -6,3 +6,17 @@ type WorkflowConfig struct { Name *string `json:"name,omitempty"` Stages []map[string]interface{} `json:"stages"` } + +func (o *WorkflowConfig) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *WorkflowConfig) GetStages() []map[string]interface{} { + if o == nil { + return []map[string]interface{}{} + } + return o.Stages +} diff --git a/pkg/models/shared/workflowinstance.go b/pkg/models/shared/workflowinstance.go index fa2ca76b..cc7a2dc6 100755 --- a/pkg/models/shared/workflowinstance.go +++ b/pkg/models/shared/workflowinstance.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -16,3 +17,70 @@ type WorkflowInstance struct { UpdatedAt time.Time `json:"updatedAt"` WorkflowID string `json:"workflowID"` } + +func (w WorkflowInstance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WorkflowInstance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WorkflowInstance) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *WorkflowInstance) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *WorkflowInstance) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *WorkflowInstance) GetStatus() []StageStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *WorkflowInstance) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *WorkflowInstance) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} + +func (o *WorkflowInstance) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *WorkflowInstance) GetWorkflowID() string { + if o == nil { + return "" + } + return o.WorkflowID +} diff --git a/pkg/models/shared/workflowinstancehistory.go b/pkg/models/shared/workflowinstancehistory.go index 44b94e6a..00a5a5dd 100755 --- a/pkg/models/shared/workflowinstancehistory.go +++ b/pkg/models/shared/workflowinstancehistory.go @@ -3,14 +3,68 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) type WorkflowInstanceHistory struct { - Error *string `json:"error,omitempty"` - Input interface{} `json:"input"` - Name string `json:"name"` - StartedAt time.Time `json:"startedAt"` - Terminated bool `json:"terminated"` - TerminatedAt *time.Time `json:"terminatedAt,omitempty"` + Error *string `json:"error,omitempty"` + Input Stage `json:"input"` + Name string `json:"name"` + StartedAt time.Time `json:"startedAt"` + Terminated bool `json:"terminated"` + TerminatedAt *time.Time `json:"terminatedAt,omitempty"` +} + +func (w WorkflowInstanceHistory) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WorkflowInstanceHistory) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WorkflowInstanceHistory) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *WorkflowInstanceHistory) GetInput() Stage { + if o == nil { + return Stage{} + } + return o.Input +} + +func (o *WorkflowInstanceHistory) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *WorkflowInstanceHistory) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *WorkflowInstanceHistory) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *WorkflowInstanceHistory) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt } diff --git a/pkg/models/shared/workflowinstancehistorystage.go b/pkg/models/shared/workflowinstancehistorystage.go index a6956940..e3b14df1 100755 --- a/pkg/models/shared/workflowinstancehistorystage.go +++ b/pkg/models/shared/workflowinstancehistorystage.go @@ -3,6 +3,7 @@ package shared import ( + "github.com/formancehq/formance-sdk-go/pkg/utils" "time" ) @@ -18,3 +19,84 @@ type WorkflowInstanceHistoryStage struct { Terminated bool `json:"terminated"` TerminatedAt *time.Time `json:"terminatedAt,omitempty"` } + +func (w WorkflowInstanceHistoryStage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WorkflowInstanceHistoryStage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { + return err + } + return nil +} + +func (o *WorkflowInstanceHistoryStage) GetAttempt() int64 { + if o == nil { + return 0 + } + return o.Attempt +} + +func (o *WorkflowInstanceHistoryStage) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *WorkflowInstanceHistoryStage) GetInput() WorkflowInstanceHistoryStageInput { + if o == nil { + return WorkflowInstanceHistoryStageInput{} + } + return o.Input +} + +func (o *WorkflowInstanceHistoryStage) GetLastFailure() *string { + if o == nil { + return nil + } + return o.LastFailure +} + +func (o *WorkflowInstanceHistoryStage) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *WorkflowInstanceHistoryStage) GetNextExecution() *time.Time { + if o == nil { + return nil + } + return o.NextExecution +} + +func (o *WorkflowInstanceHistoryStage) GetOutput() *WorkflowInstanceHistoryStageOutput { + if o == nil { + return nil + } + return o.Output +} + +func (o *WorkflowInstanceHistoryStage) GetStartedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.StartedAt +} + +func (o *WorkflowInstanceHistoryStage) GetTerminated() bool { + if o == nil { + return false + } + return o.Terminated +} + +func (o *WorkflowInstanceHistoryStage) GetTerminatedAt() *time.Time { + if o == nil { + return nil + } + return o.TerminatedAt +} diff --git a/pkg/models/shared/workflowinstancehistorystageinput.go b/pkg/models/shared/workflowinstancehistorystageinput.go index d7ca9a9f..892197e1 100755 --- a/pkg/models/shared/workflowinstancehistorystageinput.go +++ b/pkg/models/shared/workflowinstancehistorystageinput.go @@ -10,7 +10,69 @@ type WorkflowInstanceHistoryStageInput struct { GetAccount *ActivityGetAccount `json:"GetAccount,omitempty"` GetPayment *ActivityGetPayment `json:"GetPayment,omitempty"` GetWallet *ActivityGetWallet `json:"GetWallet,omitempty"` - RevertTransaction *ActivityRevertTransaction `json:"RevertTransaction,omitempty"` StripeTransfer *ActivityStripeTransfer `json:"StripeTransfer,omitempty"` VoidHold *ActivityVoidHold `json:"VoidHold,omitempty"` } + +func (o *WorkflowInstanceHistoryStageInput) GetConfirmHold() *ActivityConfirmHold { + if o == nil { + return nil + } + return o.ConfirmHold +} + +func (o *WorkflowInstanceHistoryStageInput) GetCreateTransaction() *ActivityCreateTransaction { + if o == nil { + return nil + } + return o.CreateTransaction +} + +func (o *WorkflowInstanceHistoryStageInput) GetCreditWallet() *ActivityCreditWallet { + if o == nil { + return nil + } + return o.CreditWallet +} + +func (o *WorkflowInstanceHistoryStageInput) GetDebitWallet() *ActivityDebitWallet { + if o == nil { + return nil + } + return o.DebitWallet +} + +func (o *WorkflowInstanceHistoryStageInput) GetGetAccount() *ActivityGetAccount { + if o == nil { + return nil + } + return o.GetAccount +} + +func (o *WorkflowInstanceHistoryStageInput) GetGetPayment() *ActivityGetPayment { + if o == nil { + return nil + } + return o.GetPayment +} + +func (o *WorkflowInstanceHistoryStageInput) GetGetWallet() *ActivityGetWallet { + if o == nil { + return nil + } + return o.GetWallet +} + +func (o *WorkflowInstanceHistoryStageInput) GetStripeTransfer() *ActivityStripeTransfer { + if o == nil { + return nil + } + return o.StripeTransfer +} + +func (o *WorkflowInstanceHistoryStageInput) GetVoidHold() *ActivityVoidHold { + if o == nil { + return nil + } + return o.VoidHold +} diff --git a/pkg/models/shared/workflowinstancehistorystageoutput.go b/pkg/models/shared/workflowinstancehistorystageoutput.go index 709189a8..193416e2 100755 --- a/pkg/models/shared/workflowinstancehistorystageoutput.go +++ b/pkg/models/shared/workflowinstancehistorystageoutput.go @@ -8,5 +8,39 @@ type WorkflowInstanceHistoryStageOutput struct { GetAccount *ActivityGetAccountOutput `json:"GetAccount,omitempty"` GetPayment *ActivityGetPaymentOutput `json:"GetPayment,omitempty"` GetWallet *ActivityGetWalletOutput `json:"GetWallet,omitempty"` - RevertTransaction *ActivityRevertTransactionOutput `json:"RevertTransaction,omitempty"` +} + +func (o *WorkflowInstanceHistoryStageOutput) GetCreateTransaction() *ActivityCreateTransactionOutput { + if o == nil { + return nil + } + return o.CreateTransaction +} + +func (o *WorkflowInstanceHistoryStageOutput) GetDebitWallet() *ActivityDebitWalletOutput { + if o == nil { + return nil + } + return o.DebitWallet +} + +func (o *WorkflowInstanceHistoryStageOutput) GetGetAccount() *ActivityGetAccountOutput { + if o == nil { + return nil + } + return o.GetAccount +} + +func (o *WorkflowInstanceHistoryStageOutput) GetGetPayment() *ActivityGetPaymentOutput { + if o == nil { + return nil + } + return o.GetPayment +} + +func (o *WorkflowInstanceHistoryStageOutput) GetGetWallet() *ActivityGetWalletOutput { + if o == nil { + return nil + } + return o.GetWallet } diff --git a/pkg/types/bigint.go b/pkg/types/bigint.go index b37a4153..afd0cd2b 100755 --- a/pkg/types/bigint.go +++ b/pkg/types/bigint.go @@ -7,42 +7,15 @@ import ( "math/big" ) -type BigInt struct { - big.Int -} - -func (b BigInt) MarshalJSON() ([]byte, error) { - return []byte(`"` + b.String() + `"`), nil -} - -func (b *BigInt) UnmarshalJSON(p []byte) error { - if string(p) == "null" { - return nil - } - - stringVal := string(p) - if len(stringVal) > 2 && stringVal[0] == '"' && stringVal[len(stringVal)-1] == '"' { - stringVal = stringVal[1 : len(stringVal)-1] - } - - var z big.Int - _, ok := z.SetString(string(stringVal), 10) - if !ok { - return fmt.Errorf("not a valid big integer: %s", p) - } - b.Int = z - return nil -} - -// MustBigIntFromString provides a helper function to return a big.Int from a string +// 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 will return nil -func MustBigIntFromString(s string) *BigInt { +// 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 { - return nil - } - return &BigInt{ - Int: *i, + 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 01c69b7a..c4648fa9 100755 --- a/pkg/types/date.go +++ b/pkg/types/date.go @@ -67,6 +67,10 @@ func MustDateFromString(str string) Date { 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/decimal.go b/pkg/types/decimal.go new file mode 100755 index 00000000..a42284b9 --- /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 00000000..4f15e99d --- /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/form.go b/pkg/utils/form.go index d7db2dde..0d7abfee 100755 --- a/pkg/utils/form.go +++ b/pkg/utils/form.go @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/ericlagergren/decimal" + "github.com/formancehq/formance-sdk-go/pkg/types" ) @@ -17,10 +19,11 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue 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() } @@ -32,10 +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 types.BigInt: - 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 @@ -43,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() } diff --git a/pkg/utils/headers.go b/pkg/utils/headers.go index d8ca9b18..0837022e 100755 --- a/pkg/utils/headers.go +++ b/pkg/utils/headers.go @@ -31,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() } @@ -47,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 00000000..5ba306ff --- /dev/null +++ b/pkg/utils/json.go @@ -0,0 +1,579 @@ +// 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/formancehq/formance-sdk-go/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 { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + 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 { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + 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 c2fd7281..d79c0e85 100755 --- a/pkg/utils/pathparams.go +++ b/pkg/utils/pathparams.go @@ -5,9 +5,15 @@ package utils import ( "context" "fmt" + "math/big" "net/url" "reflect" "strings" + "time" + + "github.com/ericlagergren/decimal" + + "github.com/formancehq/formance-sdk-go/pkg/types" ) func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, globals map[string]map[string]map[string]interface{}) (string, error) { @@ -61,10 +67,11 @@ func GenerateURL(ctx context.Context, serverURL, path string, pathParams interfa 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() } @@ -94,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 87ecef88..0e94bcee 100755 --- a/pkg/utils/queryparams.go +++ b/pkg/utils/queryparams.go @@ -76,15 +76,13 @@ func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams int } 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 nil, nil - } objValue = objValue.Elem() } - if objValue.Interface() == nil { - return nil, nil - } values := map[string]string{} @@ -103,10 +101,11 @@ func populateSerializedParams(tag *paramTag, objType reflect.Type, objValue refl 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() } @@ -117,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() } diff --git a/pkg/utils/requestbody.go b/pkg/utils/requestbody.go index 5c1d2638..950f39a3 100755 --- a/pkg/utils/requestbody.go +++ b/pkg/utils/requestbody.go @@ -5,7 +5,6 @@ package utils import ( "bytes" "context" - "encoding/json" "fmt" "io" "mime/multipart" @@ -26,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 !nullable && optional { 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) @@ -50,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 !nullable && optional { + return nil, "", nil + } + + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) } - 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): @@ -116,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() } @@ -137,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 @@ -231,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 } diff --git a/pkg/utils/security.go b/pkg/utils/security.go index ec837d7f..fa5eff7d 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,137 +27,142 @@ 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) } 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 securityStructType.Kind() == reflect.Ptr { - if securityValType.IsNil() { - return nil - } + if isNil(securityStructType, securityValType) { + return + } + if securityStructType.Kind() == reflect.Ptr { securityStructType = securityStructType.Elem() securityValType = securityValType.Elem() } - client := newSecurityClient(c) - for i := 0; i < securityStructType.NumField(); i++ { fieldType := securityStructType.Field(i) valType := securityValType.Field(i) 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() } 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) - - if optionStructType.Kind() == reflect.Ptr { - if optionValType.IsNil() { - return nil - } +func handleSecurityOption(c *securityConfig, option interface{}) error { + optionValType := trueReflectValue(reflect.ValueOf(option)) + optionStructType := optionValType.Type() - optionStructType = optionStructType.Elem() - optionValType = optionValType.Elem() + if isNil(optionStructType, optionValType) { + return nil } - 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) - - if schemeType.Kind() == reflect.Ptr { - if schemeVal.IsNil() { - return - } +func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme interface{}) { + schemeVal := trueReflectValue(reflect.ValueOf(scheme)) + schemeType := schemeVal.Type() - schemeType = schemeType.Elem() - schemeVal = schemeVal.Elem() + if isNil(schemeType, schemeVal) { + return } if schemeType.Kind() == reflect.Struct { if schemeTag.Type == "http" && schemeTag.SubType == "basic" { - parseBasicAuthScheme(client, schemeVal.Interface()) + handleBasicAuthScheme(client, schemeVal.Interface()) return } @@ -164,11 +170,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() } @@ -184,7 +190,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 +227,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/pkg/utils/utils.go b/pkg/utils/utils.go index 0ec8291f..4ef632ae 100755 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -3,7 +3,6 @@ package utils import ( - "encoding/json" "fmt" "io" "math/big" @@ -12,7 +11,7 @@ import ( "strings" "time" - "github.com/formancehq/formance-sdk-go/pkg/types" + "github.com/ericlagergren/decimal" ) const ( @@ -32,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) } @@ -45,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] @@ -123,10 +126,10 @@ func valToString(val interface{}) string { switch v := val.(type) { case time.Time: return v.Format(time.RFC3339Nano) - case types.BigInt: - return v.String() case big.Int: return v.String() + case decimal.Big: + return v.String() default: return fmt.Sprintf("%v", v) } @@ -150,3 +153,19 @@ func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, p return valType } + +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() + } + + return false +} diff --git a/reconciliation.go b/reconciliation.go new file mode 100755 index 00000000..0a1ece8f --- /dev/null +++ b/reconciliation.go @@ -0,0 +1,586 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package formancesdkgo + +import ( + "bytes" + "context" + "fmt" + "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" + "github.com/formancehq/formance-sdk-go/pkg/models/shared" + "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" + "net/http" + "strings" +) + +type reconciliation struct { + sdkConfiguration sdkConfiguration +} + +func newReconciliation(sdkConfig sdkConfiguration) *reconciliation { + return &reconciliation{ + sdkConfiguration: sdkConfig, + } +} + +// CreatePolicy - Create a policy +// Create a policy +func (s *reconciliation) CreatePolicy(ctx context.Context, request shared.PolicyRequest) (*operations.CreatePolicyResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/reconciliation/policies" + + 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) + } + if bodyReader == nil { + return nil, fmt.Errorf("request body is required") + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreatePolicyResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PolicyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PolicyResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// DeletePolicy - Delete a policy +// Delete a policy by its id. +func (s *reconciliation) DeletePolicy(ctx context.Context, request operations.DeletePolicyRequest) (*operations.DeletePolicyResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/reconciliation/policies/{policyID}", 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", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.DeletePolicyResponse{ + StatusCode: httpRes.StatusCode, + 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: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetPolicy - Get a policy +func (s *reconciliation) GetPolicy(ctx context.Context, request operations.GetPolicyRequest) (*operations.GetPolicyResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/reconciliation/policies/{policyID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetPolicyResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PolicyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PolicyResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetReconciliation - Get a reconciliation +func (s *reconciliation) GetReconciliation(ctx context.Context, request operations.GetReconciliationRequest) (*operations.GetReconciliationResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/reconciliation/reconciliations/{reconciliationID}", 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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetReconciliationResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ReconciliationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListPolicies - List policies +func (s *reconciliation) ListPolicies(ctx context.Context, request operations.ListPoliciesRequest) (*operations.ListPoliciesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/reconciliation/policies" + + 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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListPoliciesResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PoliciesCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PoliciesCursorResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ListReconciliations - List reconciliations +func (s *reconciliation) ListReconciliations(ctx context.Context, request operations.ListReconciliationsRequest) (*operations.ListReconciliationsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/reconciliation/reconciliations" + + 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", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListReconciliationsResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ReconciliationsCursorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationsCursorResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// Reconcile using a policy +// Reconcile using a policy +func (s *reconciliation) Reconcile(ctx context.Context, request operations.ReconcileRequest) (*operations.ReconcileResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/api/reconciliation/policies/{policyID}/reconciliation", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ReconciliationRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + if bodyReader == nil { + return nil, fmt.Errorf("request body is required") + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ReconcileResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ReconciliationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationResponse = &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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ReconciliationgetServerInfo - Get server info +func (s *reconciliation) ReconciliationgetServerInfo(ctx context.Context) (*operations.ReconciliationgetServerInfoResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/api/reconciliation/_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", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.DefaultClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ReconciliationgetServerInfoResponse{ + StatusCode: httpRes.StatusCode, + 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 { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ServerInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + 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.ReconciliationErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ReconciliationErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/search.go b/search.go index 62767886..a3ee836c 100755 --- a/search.go +++ b/search.go @@ -1,44 +1,37 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" ) 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) } @@ -51,11 +44,11 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -64,7 +57,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -73,16 +65,25 @@ 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 { 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: } @@ -92,7 +93,7 @@ func (s *search) Search(ctx context.Context, request shared.Query) (*operations. // SearchgetServerInfo - Get server info func (s *search) 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) @@ -100,9 +101,9 @@ func (s *search) SearchgetServerInfo(ctx context.Context) (*operations.Searchget 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -111,7 +112,6 @@ func (s *search) SearchgetServerInfo(ctx context.Context) (*operations.Searchget if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -120,16 +120,25 @@ func (s *search) SearchgetServerInfo(ctx context.Context) (*operations.Searchget 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 { 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/wallets.go b/wallets.go index 9c9169cc..d225960d 100755 --- a/wallets.go +++ b/wallets.go @@ -1,46 +1,39 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" ) 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 + 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) } @@ -50,11 +43,11 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -63,7 +56,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -72,17 +64,26 @@ 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: 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) } } @@ -91,13 +92,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 + 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) } @@ -106,12 +107,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -120,7 +121,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -129,26 +129,37 @@ 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 { 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) } } @@ -156,11 +167,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) } @@ -169,12 +180,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -183,7 +194,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -192,26 +202,37 @@ func (s *wallets) CreateWallet(ctx context.Context, request shared.CreateWalletR 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 { 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) } } @@ -220,13 +241,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 + 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) } @@ -236,11 +257,11 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -249,7 +270,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -258,17 +278,26 @@ 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: 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) } } @@ -277,13 +306,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 + 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) } @@ -292,12 +321,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -306,7 +335,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -315,27 +343,38 @@ 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 == 201: 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) } } @@ -344,7 +383,7 @@ 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 + 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) @@ -354,10 +393,10 @@ func (s *wallets) GetBalance(ctx context.Context, request operations.GetBalanceR if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -366,7 +405,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -375,26 +413,37 @@ 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 { 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) } } @@ -403,7 +452,7 @@ 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 + 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) @@ -413,10 +462,10 @@ func (s *wallets) GetHold(ctx context.Context, request operations.GetHoldRequest if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -425,7 +474,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -434,26 +482,37 @@ 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 { 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) } } @@ -462,21 +521,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -485,7 +544,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -494,26 +552,37 @@ 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 { 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) } } @@ -521,21 +590,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -544,7 +613,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -553,26 +621,37 @@ 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 { 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) } } @@ -581,7 +660,7 @@ 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 + 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) @@ -591,10 +670,10 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -603,7 +682,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -612,27 +690,38 @@ 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 { 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) } } @@ -641,7 +730,7 @@ func (s *wallets) GetWallet(ctx context.Context, request operations.GetWalletReq // GetWalletSummary - Get wallet summary func (s *wallets) GetWalletSummary(ctx context.Context, request operations.GetWalletSummaryRequest) (*operations.GetWalletSummaryResponse, error) { - baseURL := s.serverURL + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url, err := utils.GenerateURL(ctx, baseURL, "/api/wallets/wallets/{id}/summary", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -651,10 +740,10 @@ func (s *wallets) GetWalletSummary(ctx context.Context, request operations.GetWa if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -663,7 +752,6 @@ func (s *wallets) GetWalletSummary(ctx context.Context, request operations.GetWa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() contentType := httpRes.Header.Get("Content-Type") @@ -672,27 +760,38 @@ func (s *wallets) GetWalletSummary(ctx context.Context, request operations.GetWa 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 { case utils.MatchContentType(contentType, `application/json`): - var out *shared.GetWalletSummaryResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.GetWalletSummaryResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetWalletSummaryResponse = out + res.GetWalletSummaryResponse = &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) } } @@ -701,7 +800,7 @@ func (s *wallets) GetWalletSummary(ctx context.Context, request operations.GetWa // ListBalances - List balances of a wallet func (s *wallets) ListBalances(ctx context.Context, request operations.ListBalancesRequest) (*operations.ListBalancesResponse, error) { - baseURL := s.serverURL + 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) @@ -712,9 +811,9 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -723,7 +822,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -732,16 +830,25 @@ 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 { 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) } } @@ -750,7 +857,7 @@ 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) @@ -758,13 +865,13 @@ 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.language, s.sdkVersion, s.genVersion)) + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -773,7 +880,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -782,16 +888,25 @@ 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 { 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) } } @@ -800,13 +915,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 + 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) } @@ -816,11 +931,11 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -829,7 +944,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -838,17 +952,26 @@ 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: 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) } } @@ -857,7 +980,7 @@ 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 + 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) @@ -868,9 +991,9 @@ 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -879,7 +1002,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -888,17 +1010,26 @@ 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: 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) } } @@ -907,17 +1038,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -926,7 +1057,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -935,26 +1065,37 @@ 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 { 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 950a7c2a..84c2cecb 100755 --- a/webhooks.go +++ b/webhooks.go @@ -1,41 +1,34 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package formance +package formancesdkgo import ( + "bytes" "context" "fmt" "github.com/formancehq/formance-sdk-go/pkg/models/operations" + "github.com/formancehq/formance-sdk-go/pkg/models/sdkerrors" "github.com/formancehq/formance-sdk-go/pkg/models/shared" "github.com/formancehq/formance-sdk-go/pkg/utils" + "io" "net/http" "strings" ) 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 + 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) @@ -45,10 +38,10 @@ func (s *webhooks) ActivateConfig(ctx context.Context, request operations.Activa if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -57,7 +50,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -66,26 +58,37 @@ 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 { 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) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -98,13 +101,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 + 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) } @@ -113,12 +116,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -127,7 +130,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -136,26 +138,39 @@ 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 { 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: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -165,7 +180,7 @@ 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 + 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) @@ -175,10 +190,10 @@ func (s *webhooks) DeactivateConfig(ctx context.Context, request operations.Deac if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -187,7 +202,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -196,26 +210,39 @@ 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 { 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 == 404: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -225,7 +252,7 @@ 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 + 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) @@ -236,9 +263,9 @@ func (s *webhooks) DeleteConfig(ctx context.Context, request operations.DeleteCo 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.language, s.sdkVersion, s.genVersion)) + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -247,7 +274,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -256,17 +282,30 @@ 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: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -276,21 +315,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;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + 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) } - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -299,7 +338,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -308,26 +346,37 @@ 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 { 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) } default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -345,10 +394,10 @@ func (s *webhooks) GetManyConfigs(ctx context.Context, request operations.GetMan // // 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 + 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) } @@ -360,12 +409,12 @@ func (s *webhooks) InsertConfig(ctx context.Context, request shared.ConfigUser) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) req.Header.Set("Content-Type", reqContentType) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -374,7 +423,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -383,26 +431,39 @@ 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 { 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: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } } @@ -412,7 +473,7 @@ 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 + 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) @@ -422,10 +483,10 @@ func (s *webhooks) TestConfig(ctx context.Context, request operations.TestConfig if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") - req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s", s.language, s.sdkVersion, s.genVersion)) + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) - client := s.securityClient + client := s.sdkConfiguration.DefaultClient httpRes, err := client.Do(req) if err != nil { @@ -434,7 +495,6 @@ 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() contentType := httpRes.Header.Get("Content-Type") @@ -443,26 +503,41 @@ 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 { 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) } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough default: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.WebhooksErrorResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + var out shared.WebhooksErrorResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.WebhooksErrorResponse = out + res.WebhooksErrorResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } }