func (o *GetSelfInternalServerErrorBody) validateTypeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getSelfInternalServerErrorBodyTypeTypePropEnum); err != nil {
		return err
	}
	return nil
}
prop value enum
package o_auth
import (
	"encoding/json"
	"fmt"
	"io"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/validate"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/manifoldco/grafton/generated/connector/models"
)
type GetSelfReader struct {
	formats strfmt.Registry
}
func (o *GetSelfReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetSelfOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetSelfBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetSelfUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetSelfInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}
func NewGetSelfOK() *GetSelfOK {
	return &GetSelfOK{}
}
type GetSelfOK struct {
	Payload models.Identity
}
func (o *GetSelfOK) Error() string {
	return fmt.Sprintf("[GET /self][%d] getSelfOK  %+v", 200, o.Payload)
}
func (o *GetSelfOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	payload, err := models.UnmarshalIdentity(response.Body(), consumer)
	if err != nil {
		return err
	}
	o.Payload = payload
	return nil
}
func NewGetSelfBadRequest() *GetSelfBadRequest {
	return &GetSelfBadRequest{}
}
type GetSelfBadRequest struct {
	Payload GetSelfBadRequestBody
}
func (o *GetSelfBadRequest) Error() string {
	return fmt.Sprintf("[GET /self][%d] getSelfBadRequest  %+v", 400, o.Payload)
}
func (o *GetSelfBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
func NewGetSelfUnauthorized() *GetSelfUnauthorized {
	return &GetSelfUnauthorized{}
}
type GetSelfUnauthorized struct {
	Payload GetSelfUnauthorizedBody
}
func (o *GetSelfUnauthorized) Error() string {
	return fmt.Sprintf("[GET /self][%d] getSelfUnauthorized  %+v", 401, o.Payload)
}
func (o *GetSelfUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
func NewGetSelfInternalServerError() *GetSelfInternalServerError {
	return &GetSelfInternalServerError{}
}
type GetSelfInternalServerError struct {
	Payload GetSelfInternalServerErrorBody
}
func (o *GetSelfInternalServerError) Error() string {
	return fmt.Sprintf("[GET /self][%d] getSelfInternalServerError  %+v", 500, o.Payload)
}
func (o *GetSelfInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
type GetSelfBadRequestBody struct {
	Message []string `json:"message"`
	Type *string `json:"type"`
}
func (o *GetSelfBadRequestBody) Validate(formats strfmt.Registry) error {
	var res []error
	if err := o.validateMessage(formats); err != nil {
		res = append(res, err)
	}
	if err := o.validateType(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (o *GetSelfBadRequestBody) validateMessage(formats strfmt.Registry) error {
	if err := validate.Required("getSelfBadRequest"+"."+"message", "body", o.Message); err != nil {
		return err
	}
	return nil
}
var getSelfBadRequestBodyTypeTypePropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["bad_request","unauthorized","not_found","method_not_allowed","internal","invalid_grant","unsupported_grant_type"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getSelfBadRequestBodyTypeTypePropEnum = append(getSelfBadRequestBodyTypeTypePropEnum, v)
	}
}
const (
	GetSelfBadRequestBodyTypeBadRequest string = "bad_request"
	GetSelfBadRequestBodyTypeUnauthorized string = "unauthorized"
	GetSelfBadRequestBodyTypeNotFound string = "not_found"
	GetSelfBadRequestBodyTypeMethodNotAllowed string = "method_not_allowed"
	GetSelfBadRequestBodyTypeInternal string = "internal"
	GetSelfBadRequestBodyTypeInvalidGrant string = "invalid_grant"
	GetSelfBadRequestBodyTypeUnsupportedGrantType string = "unsupported_grant_type"
)
func (o *GetSelfBadRequestBody) validateTypeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getSelfBadRequestBodyTypeTypePropEnum); err != nil {
		return err
	}
	return nil
}
func (o *GetSelfBadRequestBody) validateType(formats strfmt.Registry) error {
	if err := validate.Required("getSelfBadRequest"+"."+"type", "body", o.Type); err != nil {
		return err
	}
	if err := o.validateTypeEnum("getSelfBadRequest"+"."+"type", "body", *o.Type); err != nil {
		return err
	}
	return nil
}
type GetSelfInternalServerErrorBody struct {
	Message []string `json:"message"`
	Type *string `json:"type"`
}
func (o *GetSelfInternalServerErrorBody) Validate(formats strfmt.Registry) error {
	var res []error
	if err := o.validateMessage(formats); err != nil {
		res = append(res, err)
	}
	if err := o.validateType(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (o *GetSelfInternalServerErrorBody) validateMessage(formats strfmt.Registry) error {
	if err := validate.Required("getSelfInternalServerError"+"."+"message", "body", o.Message); err != nil {
		return err
	}
	return nil
}
var getSelfInternalServerErrorBodyTypeTypePropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["bad_request","unauthorized","not_found","method_not_allowed","internal","invalid_grant","unsupported_grant_type"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getSelfInternalServerErrorBodyTypeTypePropEnum = append(getSelfInternalServerErrorBodyTypeTypePropEnum, v)
	}
}
const (
	GetSelfInternalServerErrorBodyTypeBadRequest string = "bad_request"
	GetSelfInternalServerErrorBodyTypeUnauthorized string = "unauthorized"
	GetSelfInternalServerErrorBodyTypeNotFound string = "not_found"
	GetSelfInternalServerErrorBodyTypeMethodNotAllowed string = "method_not_allowed"
	GetSelfInternalServerErrorBodyTypeInternal string = "internal"
	GetSelfInternalServerErrorBodyTypeInvalidGrant string = "invalid_grant"
	GetSelfInternalServerErrorBodyTypeUnsupportedGrantType string = "unsupported_grant_type"
)