Files
stack/releases/sdks/go/pkg/models/shared/walletserrorresponse.go
2e03d96084 feat: update speakeasy (#1100)
Co-authored-by: Maxence Maireaux <[email protected]>
Co-authored-by: David Ragot <[email protected]>
2024-01-08 18:23:33 +00:00

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
}