Files
stack/releases/sdks/go/pkg/models/shared/webhookserrorsenum.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

39 lines
798 B
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
)
type WebhooksErrorsEnum string
const (
WebhooksErrorsEnumInternal WebhooksErrorsEnum = "INTERNAL"
WebhooksErrorsEnumValidation WebhooksErrorsEnum = "VALIDATION"
WebhooksErrorsEnumNotFound WebhooksErrorsEnum = "NOT_FOUND"
)
func (e WebhooksErrorsEnum) ToPointer() *WebhooksErrorsEnum {
return &e
}
func (e *WebhooksErrorsEnum) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "INTERNAL":
fallthrough
case "VALIDATION":
fallthrough
case "NOT_FOUND":
*e = WebhooksErrorsEnum(v)
return nil
default:
return fmt.Errorf("invalid value for WebhooksErrorsEnum: %v", v)
}
}