mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
47 lines
1017 B
Go
47 lines
1017 B
Go
// 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)
|
|
}
|
|
}
|