mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
- go.mod module path + all self-imports: github.com/formancehq/payments -> github.com/hanzo-fi/payments (1590 .go files / 3152 refs; 20 modules: root, pkg/client, pkg/domain, 18 ce/plugins). External dep kept: formancehq/go-libs. - plugins: each ce/plugins/* consumed a *published* pkg/domain; added local 'replace .../pkg/domain => ../../../pkg/domain' (consistent with root) so every standalone plugin module builds in-monorepo. compile-plugin.sh MOD var rebranded too. - branding: README, LICENSE (dual MIT+EE; upstream copyright retained + Hanzo added), goreleaser (release images -> registry.hanzo.ai/hanzo-fi, OCI labels, homepage), proto go_package, renovate, speakeasy gen.yaml, connector-template *.gotpl. - CI: removed Numary/Formance workflows + composite action; added canonical hanzo.yml + cicd.yml (hanzoai/ci, gated HANZO_CI_ENABLED) + secretless ci.yml (go build/vet). - kept as data/compat keys: wire capability enums ALLOW_FORMANCE_*, generated SDK type client.Formance, domain field FormanceRedirectURL, OTEL_SERVICE_NAME, upstream base image. - verified: go build ./... (default + -tags ee) + all 20 nested modules green.
636 lines
22 KiB
Go
636 lines
22 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
import (
|
|
"encoding/json"
|
|
"errors"
|
|
"fmt"
|
|
"github.com/hanzo-fi/payments/pkg/client/internal/utils"
|
|
)
|
|
|
|
type V3InstallConnectorRequestType string
|
|
|
|
const (
|
|
V3InstallConnectorRequestTypeAdyen V3InstallConnectorRequestType = "Adyen"
|
|
V3InstallConnectorRequestTypeAtlar V3InstallConnectorRequestType = "Atlar"
|
|
V3InstallConnectorRequestTypeBankingbridge V3InstallConnectorRequestType = "Bankingbridge"
|
|
V3InstallConnectorRequestTypeBankingcircle V3InstallConnectorRequestType = "Bankingcircle"
|
|
V3InstallConnectorRequestTypeBitstamp V3InstallConnectorRequestType = "Bitstamp"
|
|
V3InstallConnectorRequestTypeCoinbaseprime V3InstallConnectorRequestType = "Coinbaseprime"
|
|
V3InstallConnectorRequestTypeColumn V3InstallConnectorRequestType = "Column"
|
|
V3InstallConnectorRequestTypeCurrencycloud V3InstallConnectorRequestType = "Currencycloud"
|
|
V3InstallConnectorRequestTypeDummypay V3InstallConnectorRequestType = "Dummypay"
|
|
V3InstallConnectorRequestTypeFireblocks V3InstallConnectorRequestType = "Fireblocks"
|
|
V3InstallConnectorRequestTypeGeneric V3InstallConnectorRequestType = "Generic"
|
|
V3InstallConnectorRequestTypeIncrease V3InstallConnectorRequestType = "Increase"
|
|
V3InstallConnectorRequestTypeMangopay V3InstallConnectorRequestType = "Mangopay"
|
|
V3InstallConnectorRequestTypeModulr V3InstallConnectorRequestType = "Modulr"
|
|
V3InstallConnectorRequestTypeMoneycorp V3InstallConnectorRequestType = "Moneycorp"
|
|
V3InstallConnectorRequestTypePlaid V3InstallConnectorRequestType = "Plaid"
|
|
V3InstallConnectorRequestTypePowens V3InstallConnectorRequestType = "Powens"
|
|
V3InstallConnectorRequestTypeQonto V3InstallConnectorRequestType = "Qonto"
|
|
V3InstallConnectorRequestTypeRoutable V3InstallConnectorRequestType = "Routable"
|
|
V3InstallConnectorRequestTypeStripe V3InstallConnectorRequestType = "Stripe"
|
|
V3InstallConnectorRequestTypeTink V3InstallConnectorRequestType = "Tink"
|
|
V3InstallConnectorRequestTypeWise V3InstallConnectorRequestType = "Wise"
|
|
)
|
|
|
|
type V3InstallConnectorRequest struct {
|
|
V3AdyenConfig *V3AdyenConfig `queryParam:"inline"`
|
|
V3AtlarConfig *V3AtlarConfig `queryParam:"inline"`
|
|
V3BankingcircleConfig *V3BankingcircleConfig `queryParam:"inline"`
|
|
V3ColumnConfig *V3ColumnConfig `queryParam:"inline"`
|
|
V3CurrencycloudConfig *V3CurrencycloudConfig `queryParam:"inline"`
|
|
V3DummypayConfig *V3DummypayConfig `queryParam:"inline"`
|
|
V3GenericConfig *V3GenericConfig `queryParam:"inline"`
|
|
V3IncreaseConfig *V3IncreaseConfig `queryParam:"inline"`
|
|
V3MangopayConfig *V3MangopayConfig `queryParam:"inline"`
|
|
V3ModulrConfig *V3ModulrConfig `queryParam:"inline"`
|
|
V3MoneycorpConfig *V3MoneycorpConfig `queryParam:"inline"`
|
|
V3PlaidConfig *V3PlaidConfig `queryParam:"inline"`
|
|
V3PowensConfig *V3PowensConfig `queryParam:"inline"`
|
|
V3QontoConfig *V3QontoConfig `queryParam:"inline"`
|
|
V3StripeConfig *V3StripeConfig `queryParam:"inline"`
|
|
V3TinkConfig *V3TinkConfig `queryParam:"inline"`
|
|
V3WiseConfig *V3WiseConfig `queryParam:"inline"`
|
|
V3BankingbridgeConfig *V3BankingbridgeConfig `queryParam:"inline"`
|
|
V3BitstampConfig *V3BitstampConfig `queryParam:"inline"`
|
|
V3CoinbaseprimeConfig *V3CoinbaseprimeConfig `queryParam:"inline"`
|
|
V3FireblocksConfig *V3FireblocksConfig `queryParam:"inline"`
|
|
V3RoutableConfig *V3RoutableConfig `queryParam:"inline"`
|
|
|
|
Type V3InstallConnectorRequestType
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestAdyen(adyen V3AdyenConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeAdyen
|
|
|
|
typStr := string(typ)
|
|
adyen.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3AdyenConfig: &adyen,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestAtlar(atlar V3AtlarConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeAtlar
|
|
|
|
typStr := string(typ)
|
|
atlar.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3AtlarConfig: &atlar,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestBankingbridge(bankingbridge V3BankingbridgeConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeBankingbridge
|
|
|
|
typStr := string(typ)
|
|
bankingbridge.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3BankingbridgeConfig: &bankingbridge,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestBankingcircle(bankingcircle V3BankingcircleConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeBankingcircle
|
|
|
|
typStr := string(typ)
|
|
bankingcircle.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3BankingcircleConfig: &bankingcircle,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestBitstamp(bitstamp V3BitstampConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeBitstamp
|
|
|
|
typStr := string(typ)
|
|
bitstamp.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3BitstampConfig: &bitstamp,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestCoinbaseprime(coinbaseprime V3CoinbaseprimeConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeCoinbaseprime
|
|
|
|
typStr := string(typ)
|
|
coinbaseprime.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3CoinbaseprimeConfig: &coinbaseprime,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestColumn(column V3ColumnConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeColumn
|
|
|
|
typStr := string(typ)
|
|
column.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3ColumnConfig: &column,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestCurrencycloud(currencycloud V3CurrencycloudConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeCurrencycloud
|
|
|
|
typStr := string(typ)
|
|
currencycloud.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3CurrencycloudConfig: ¤cycloud,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestDummypay(dummypay V3DummypayConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeDummypay
|
|
|
|
typStr := string(typ)
|
|
dummypay.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3DummypayConfig: &dummypay,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestFireblocks(fireblocks V3FireblocksConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeFireblocks
|
|
|
|
typStr := string(typ)
|
|
fireblocks.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3FireblocksConfig: &fireblocks,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestGeneric(generic V3GenericConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeGeneric
|
|
|
|
typStr := string(typ)
|
|
generic.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3GenericConfig: &generic,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestIncrease(increase V3IncreaseConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeIncrease
|
|
|
|
typStr := string(typ)
|
|
increase.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3IncreaseConfig: &increase,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestMangopay(mangopay V3MangopayConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeMangopay
|
|
|
|
typStr := string(typ)
|
|
mangopay.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3MangopayConfig: &mangopay,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestModulr(modulr V3ModulrConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeModulr
|
|
|
|
typStr := string(typ)
|
|
modulr.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3ModulrConfig: &modulr,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestMoneycorp(moneycorp V3MoneycorpConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeMoneycorp
|
|
|
|
typStr := string(typ)
|
|
moneycorp.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3MoneycorpConfig: &moneycorp,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestPlaid(plaid V3PlaidConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypePlaid
|
|
|
|
typStr := string(typ)
|
|
plaid.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3PlaidConfig: &plaid,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestPowens(powens V3PowensConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypePowens
|
|
|
|
typStr := string(typ)
|
|
powens.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3PowensConfig: &powens,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestQonto(qonto V3QontoConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeQonto
|
|
|
|
typStr := string(typ)
|
|
qonto.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3QontoConfig: &qonto,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestRoutable(routable V3RoutableConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeRoutable
|
|
|
|
typStr := string(typ)
|
|
routable.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3RoutableConfig: &routable,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestStripe(stripe V3StripeConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeStripe
|
|
|
|
typStr := string(typ)
|
|
stripe.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3StripeConfig: &stripe,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestTink(tink V3TinkConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeTink
|
|
|
|
typStr := string(typ)
|
|
tink.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3TinkConfig: &tink,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func CreateV3InstallConnectorRequestWise(wise V3WiseConfig) V3InstallConnectorRequest {
|
|
typ := V3InstallConnectorRequestTypeWise
|
|
|
|
typStr := string(typ)
|
|
wise.Provider = &typStr
|
|
|
|
return V3InstallConnectorRequest{
|
|
V3WiseConfig: &wise,
|
|
Type: typ,
|
|
}
|
|
}
|
|
|
|
func (u *V3InstallConnectorRequest) UnmarshalJSON(data []byte) error {
|
|
|
|
type discriminator struct {
|
|
Provider string `json:"provider"`
|
|
}
|
|
|
|
dis := new(discriminator)
|
|
if err := json.Unmarshal(data, &dis); err != nil {
|
|
return fmt.Errorf("could not unmarshal discriminator: %w", err)
|
|
}
|
|
|
|
switch dis.Provider {
|
|
case "Adyen":
|
|
v3AdyenConfig := new(V3AdyenConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3AdyenConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Adyen) type V3AdyenConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3AdyenConfig = v3AdyenConfig
|
|
u.Type = V3InstallConnectorRequestTypeAdyen
|
|
return nil
|
|
case "Atlar":
|
|
v3AtlarConfig := new(V3AtlarConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3AtlarConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Atlar) type V3AtlarConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3AtlarConfig = v3AtlarConfig
|
|
u.Type = V3InstallConnectorRequestTypeAtlar
|
|
return nil
|
|
case "Bankingbridge":
|
|
v3BankingbridgeConfig := new(V3BankingbridgeConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3BankingbridgeConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Bankingbridge) type V3BankingbridgeConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3BankingbridgeConfig = v3BankingbridgeConfig
|
|
u.Type = V3InstallConnectorRequestTypeBankingbridge
|
|
return nil
|
|
case "Bankingcircle":
|
|
v3BankingcircleConfig := new(V3BankingcircleConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3BankingcircleConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Bankingcircle) type V3BankingcircleConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3BankingcircleConfig = v3BankingcircleConfig
|
|
u.Type = V3InstallConnectorRequestTypeBankingcircle
|
|
return nil
|
|
case "Bitstamp":
|
|
v3BitstampConfig := new(V3BitstampConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3BitstampConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Bitstamp) type V3BitstampConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3BitstampConfig = v3BitstampConfig
|
|
u.Type = V3InstallConnectorRequestTypeBitstamp
|
|
return nil
|
|
case "Coinbaseprime":
|
|
v3CoinbaseprimeConfig := new(V3CoinbaseprimeConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3CoinbaseprimeConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Coinbaseprime) type V3CoinbaseprimeConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3CoinbaseprimeConfig = v3CoinbaseprimeConfig
|
|
u.Type = V3InstallConnectorRequestTypeCoinbaseprime
|
|
return nil
|
|
case "Column":
|
|
v3ColumnConfig := new(V3ColumnConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3ColumnConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Column) type V3ColumnConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3ColumnConfig = v3ColumnConfig
|
|
u.Type = V3InstallConnectorRequestTypeColumn
|
|
return nil
|
|
case "Currencycloud":
|
|
v3CurrencycloudConfig := new(V3CurrencycloudConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3CurrencycloudConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Currencycloud) type V3CurrencycloudConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3CurrencycloudConfig = v3CurrencycloudConfig
|
|
u.Type = V3InstallConnectorRequestTypeCurrencycloud
|
|
return nil
|
|
case "Dummypay":
|
|
v3DummypayConfig := new(V3DummypayConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3DummypayConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Dummypay) type V3DummypayConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3DummypayConfig = v3DummypayConfig
|
|
u.Type = V3InstallConnectorRequestTypeDummypay
|
|
return nil
|
|
case "Fireblocks":
|
|
v3FireblocksConfig := new(V3FireblocksConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3FireblocksConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Fireblocks) type V3FireblocksConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3FireblocksConfig = v3FireblocksConfig
|
|
u.Type = V3InstallConnectorRequestTypeFireblocks
|
|
return nil
|
|
case "Generic":
|
|
v3GenericConfig := new(V3GenericConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3GenericConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Generic) type V3GenericConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3GenericConfig = v3GenericConfig
|
|
u.Type = V3InstallConnectorRequestTypeGeneric
|
|
return nil
|
|
case "Increase":
|
|
v3IncreaseConfig := new(V3IncreaseConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3IncreaseConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Increase) type V3IncreaseConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3IncreaseConfig = v3IncreaseConfig
|
|
u.Type = V3InstallConnectorRequestTypeIncrease
|
|
return nil
|
|
case "Mangopay":
|
|
v3MangopayConfig := new(V3MangopayConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3MangopayConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Mangopay) type V3MangopayConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3MangopayConfig = v3MangopayConfig
|
|
u.Type = V3InstallConnectorRequestTypeMangopay
|
|
return nil
|
|
case "Modulr":
|
|
v3ModulrConfig := new(V3ModulrConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3ModulrConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Modulr) type V3ModulrConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3ModulrConfig = v3ModulrConfig
|
|
u.Type = V3InstallConnectorRequestTypeModulr
|
|
return nil
|
|
case "Moneycorp":
|
|
v3MoneycorpConfig := new(V3MoneycorpConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3MoneycorpConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Moneycorp) type V3MoneycorpConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3MoneycorpConfig = v3MoneycorpConfig
|
|
u.Type = V3InstallConnectorRequestTypeMoneycorp
|
|
return nil
|
|
case "Plaid":
|
|
v3PlaidConfig := new(V3PlaidConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3PlaidConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Plaid) type V3PlaidConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3PlaidConfig = v3PlaidConfig
|
|
u.Type = V3InstallConnectorRequestTypePlaid
|
|
return nil
|
|
case "Powens":
|
|
v3PowensConfig := new(V3PowensConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3PowensConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Powens) type V3PowensConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3PowensConfig = v3PowensConfig
|
|
u.Type = V3InstallConnectorRequestTypePowens
|
|
return nil
|
|
case "Qonto":
|
|
v3QontoConfig := new(V3QontoConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3QontoConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Qonto) type V3QontoConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3QontoConfig = v3QontoConfig
|
|
u.Type = V3InstallConnectorRequestTypeQonto
|
|
return nil
|
|
case "Routable":
|
|
v3RoutableConfig := new(V3RoutableConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3RoutableConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Routable) type V3RoutableConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3RoutableConfig = v3RoutableConfig
|
|
u.Type = V3InstallConnectorRequestTypeRoutable
|
|
return nil
|
|
case "Stripe":
|
|
v3StripeConfig := new(V3StripeConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3StripeConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Stripe) type V3StripeConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3StripeConfig = v3StripeConfig
|
|
u.Type = V3InstallConnectorRequestTypeStripe
|
|
return nil
|
|
case "Tink":
|
|
v3TinkConfig := new(V3TinkConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3TinkConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Tink) type V3TinkConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3TinkConfig = v3TinkConfig
|
|
u.Type = V3InstallConnectorRequestTypeTink
|
|
return nil
|
|
case "Wise":
|
|
v3WiseConfig := new(V3WiseConfig)
|
|
if err := utils.UnmarshalJSON(data, &v3WiseConfig, "", true, false); err != nil {
|
|
return fmt.Errorf("could not unmarshal `%s` into expected (Provider == Wise) type V3WiseConfig within V3InstallConnectorRequest: %w", string(data), err)
|
|
}
|
|
|
|
u.V3WiseConfig = v3WiseConfig
|
|
u.Type = V3InstallConnectorRequestTypeWise
|
|
return nil
|
|
}
|
|
|
|
return fmt.Errorf("could not unmarshal `%s` into any supported union types for V3InstallConnectorRequest", string(data))
|
|
}
|
|
|
|
func (u V3InstallConnectorRequest) MarshalJSON() ([]byte, error) {
|
|
if u.V3AdyenConfig != nil {
|
|
return utils.MarshalJSON(u.V3AdyenConfig, "", true)
|
|
}
|
|
|
|
if u.V3AtlarConfig != nil {
|
|
return utils.MarshalJSON(u.V3AtlarConfig, "", true)
|
|
}
|
|
|
|
if u.V3BankingcircleConfig != nil {
|
|
return utils.MarshalJSON(u.V3BankingcircleConfig, "", true)
|
|
}
|
|
|
|
if u.V3ColumnConfig != nil {
|
|
return utils.MarshalJSON(u.V3ColumnConfig, "", true)
|
|
}
|
|
|
|
if u.V3CurrencycloudConfig != nil {
|
|
return utils.MarshalJSON(u.V3CurrencycloudConfig, "", true)
|
|
}
|
|
|
|
if u.V3DummypayConfig != nil {
|
|
return utils.MarshalJSON(u.V3DummypayConfig, "", true)
|
|
}
|
|
|
|
if u.V3GenericConfig != nil {
|
|
return utils.MarshalJSON(u.V3GenericConfig, "", true)
|
|
}
|
|
|
|
if u.V3IncreaseConfig != nil {
|
|
return utils.MarshalJSON(u.V3IncreaseConfig, "", true)
|
|
}
|
|
|
|
if u.V3MangopayConfig != nil {
|
|
return utils.MarshalJSON(u.V3MangopayConfig, "", true)
|
|
}
|
|
|
|
if u.V3ModulrConfig != nil {
|
|
return utils.MarshalJSON(u.V3ModulrConfig, "", true)
|
|
}
|
|
|
|
if u.V3MoneycorpConfig != nil {
|
|
return utils.MarshalJSON(u.V3MoneycorpConfig, "", true)
|
|
}
|
|
|
|
if u.V3PlaidConfig != nil {
|
|
return utils.MarshalJSON(u.V3PlaidConfig, "", true)
|
|
}
|
|
|
|
if u.V3PowensConfig != nil {
|
|
return utils.MarshalJSON(u.V3PowensConfig, "", true)
|
|
}
|
|
|
|
if u.V3QontoConfig != nil {
|
|
return utils.MarshalJSON(u.V3QontoConfig, "", true)
|
|
}
|
|
|
|
if u.V3StripeConfig != nil {
|
|
return utils.MarshalJSON(u.V3StripeConfig, "", true)
|
|
}
|
|
|
|
if u.V3TinkConfig != nil {
|
|
return utils.MarshalJSON(u.V3TinkConfig, "", true)
|
|
}
|
|
|
|
if u.V3WiseConfig != nil {
|
|
return utils.MarshalJSON(u.V3WiseConfig, "", true)
|
|
}
|
|
|
|
if u.V3BankingbridgeConfig != nil {
|
|
return utils.MarshalJSON(u.V3BankingbridgeConfig, "", true)
|
|
}
|
|
|
|
if u.V3BitstampConfig != nil {
|
|
return utils.MarshalJSON(u.V3BitstampConfig, "", true)
|
|
}
|
|
|
|
if u.V3CoinbaseprimeConfig != nil {
|
|
return utils.MarshalJSON(u.V3CoinbaseprimeConfig, "", true)
|
|
}
|
|
|
|
if u.V3FireblocksConfig != nil {
|
|
return utils.MarshalJSON(u.V3FireblocksConfig, "", true)
|
|
}
|
|
|
|
if u.V3RoutableConfig != nil {
|
|
return utils.MarshalJSON(u.V3RoutableConfig, "", true)
|
|
}
|
|
|
|
return nil, errors.New("could not marshal union type V3InstallConnectorRequest: all fields are null")
|
|
}
|