mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
Co-authored-by: Maxence Maireaux <[email protected]> Co-authored-by: David Ragot <[email protected]>
61 lines
1.5 KiB
Go
61 lines
1.5 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package shared
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
type WalletsErrorResponseErrorCode string
|
|
|
|
const (
|
|
WalletsErrorResponseErrorCodeValidation WalletsErrorResponseErrorCode = "VALIDATION"
|
|
WalletsErrorResponseErrorCodeInternalError WalletsErrorResponseErrorCode = "INTERNAL_ERROR"
|
|
WalletsErrorResponseErrorCodeInsufficientFund WalletsErrorResponseErrorCode = "INSUFFICIENT_FUND"
|
|
WalletsErrorResponseErrorCodeHoldClosed WalletsErrorResponseErrorCode = "HOLD_CLOSED"
|
|
)
|
|
|
|
func (e WalletsErrorResponseErrorCode) ToPointer() *WalletsErrorResponseErrorCode {
|
|
return &e
|
|
}
|
|
|
|
func (e *WalletsErrorResponseErrorCode) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "VALIDATION":
|
|
fallthrough
|
|
case "INTERNAL_ERROR":
|
|
fallthrough
|
|
case "INSUFFICIENT_FUND":
|
|
fallthrough
|
|
case "HOLD_CLOSED":
|
|
*e = WalletsErrorResponseErrorCode(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for WalletsErrorResponseErrorCode: %v", v)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|