mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Move all public connectors to ce/plugins * Update tooling to account for new go modules under ce * Ensure we test all CE plugins in CI * Move Dummypay to ce/plugins for simplicity's sake in the generation scripts * Use versioned pkg/domain in plugins * Ensure that renovate updates all CE plugins in a single PR when pkg/domain tags are pushed to github * Ensure Justfile commands work over all CE plugins * Copy ce plugin go.mods in dev.Dockerfile * Only add a go.mod for new plugins if they are ce * Ensure generated generic client structs are named correctly for submodule * Add coverprofile for each ce plugin * Add set -e for Justfile for loops over plugins * Infer go version from flake.nix in connector template tool
138 lines
3.4 KiB
Go
138 lines
3.4 KiB
Go
/*
|
|
GENERIC connector API
|
|
|
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
|
|
API version: v0.1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package genericclient
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// TransactionStatus the model 'TransactionStatus'
|
|
type TransactionStatus string
|
|
|
|
// List of TransactionStatus
|
|
const (
|
|
PENDING TransactionStatus = "PENDING"
|
|
SUCCEEDED TransactionStatus = "SUCCEEDED"
|
|
FAILED TransactionStatus = "FAILED"
|
|
CANCELLED TransactionStatus = "CANCELLED"
|
|
EXPIRED TransactionStatus = "EXPIRED"
|
|
REFUNDED TransactionStatus = "REFUNDED"
|
|
REFUNDED_FAILURE TransactionStatus = "REFUNDED_FAILURE"
|
|
REFUND_REVERSED TransactionStatus = "REFUND_REVERSED"
|
|
DISPUTE TransactionStatus = "DISPUTE"
|
|
DISPUTE_WON TransactionStatus = "DISPUTE_WON"
|
|
DISPUTE_LOST TransactionStatus = "DISPUTE_LOST"
|
|
AUTHORISATION TransactionStatus = "AUTHORISATION"
|
|
CAPTURE TransactionStatus = "CAPTURE"
|
|
CAPTURE_FAILED TransactionStatus = "CAPTURE_FAILED"
|
|
OTHER TransactionStatus = "OTHER"
|
|
)
|
|
|
|
// All allowed values of TransactionStatus enum
|
|
var AllowedTransactionStatusEnumValues = []TransactionStatus{
|
|
"PENDING",
|
|
"SUCCEEDED",
|
|
"FAILED",
|
|
"CANCELLED",
|
|
"EXPIRED",
|
|
"REFUNDED",
|
|
"REFUNDED_FAILURE",
|
|
"REFUND_REVERSED",
|
|
"DISPUTE",
|
|
"DISPUTE_WON",
|
|
"DISPUTE_LOST",
|
|
"AUTHORISATION",
|
|
"CAPTURE",
|
|
"CAPTURE_FAILED",
|
|
"OTHER",
|
|
}
|
|
|
|
func (v *TransactionStatus) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := TransactionStatus(value)
|
|
for _, existing := range AllowedTransactionStatusEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid TransactionStatus", value)
|
|
}
|
|
|
|
// NewTransactionStatusFromValue returns a pointer to a valid TransactionStatus
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewTransactionStatusFromValue(v string) (*TransactionStatus, error) {
|
|
ev := TransactionStatus(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for TransactionStatus: valid values are %v", v, AllowedTransactionStatusEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v TransactionStatus) IsValid() bool {
|
|
for _, existing := range AllowedTransactionStatusEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to TransactionStatus value
|
|
func (v TransactionStatus) Ptr() *TransactionStatus {
|
|
return &v
|
|
}
|
|
|
|
type NullableTransactionStatus struct {
|
|
value *TransactionStatus
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTransactionStatus) Get() *TransactionStatus {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTransactionStatus) Set(val *TransactionStatus) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTransactionStatus) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTransactionStatus) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTransactionStatus(val *TransactionStatus) *NullableTransactionStatus {
|
|
return &NullableTransactionStatus{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTransactionStatus) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTransactionStatus) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|