func (m *AuthorizationError) UnmarshalBinary(b []byte) error {
	var res AuthorizationError
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"encoding/json"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type AuthorizationError struct {
	Code int64 `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	Type string `json:"type,omitempty"`
}
func (m *AuthorizationError) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateType(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
var authorizationErrorTypeTypePropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["AuthorizationError","EnvironmentAccessDenied"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		authorizationErrorTypeTypePropEnum = append(authorizationErrorTypeTypePropEnum, v)
	}
}
const (
	AuthorizationErrorTypeAuthorizationError string = "AuthorizationError"
	AuthorizationErrorTypeEnvironmentAccessDenied string = "EnvironmentAccessDenied"
)
func (m *AuthorizationError) validateTypeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, authorizationErrorTypeTypePropEnum); err != nil {
		return err
	}
	return nil
}
func (m *AuthorizationError) validateType(formats strfmt.Registry) error {
	if swag.IsZero(m.Type) {  
		return nil
	}
	if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
		return err
	}
	return nil
}
func (m *AuthorizationError) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}