func (enum *ErrorReasonEnum) UnmarshalJSON(bytes []byte) error {
	var err error
	var val string
	err = json.Unmarshal(bytes, &val)
	if nil != err {
		return err
	}
	for k, v := range _errorReasonEnums {
		if v == val {
			*enum = k
			return nil
		}
	}
	return fmt.Errorf("%s is not a valid type value", bytes)
}
/*
UnmarshalJSON implements json.Unmarshaler
package network
import (
	"encoding/json"
	"fmt"
)
type errorReasonEnum struct {
	Failed               ErrorReasonEnum
	Aborted              ErrorReasonEnum
	TimedOut             ErrorReasonEnum
	AccessDenied         ErrorReasonEnum
	ConnectionClosed     ErrorReasonEnum
	ConnectionReset      ErrorReasonEnum
	ConnectionRefused    ErrorReasonEnum
	ConnectionAborted    ErrorReasonEnum
	ConnectionFailed     ErrorReasonEnum
	NameNotResolved      ErrorReasonEnum
	InternetDisconnected ErrorReasonEnum
	AddressUnreachable   ErrorReasonEnum
}
var ErrorReason = errorReasonEnum{
	Failed:               errorReasonFailed,
	Aborted:              errorReasonAborted,
	TimedOut:             errorReasonTimedOut,
	AccessDenied:         errorReasonAccessDenied,
	ConnectionClosed:     errorReasonConnectionClosed,
	ConnectionReset:      errorReasonConnectionReset,
	ConnectionRefused:    errorReasonConnectionRefused,
	ConnectionAborted:    errorReasonConnectionAborted,
	ConnectionFailed:     errorReasonConnectionFailed,
	NameNotResolved:      errorReasonNameNotResolved,
	InternetDisconnected: errorReasonInternetDisconnected,
	AddressUnreachable:   errorReasonAddressUnreachable,
}
type ErrorReasonEnum int
func (enum ErrorReasonEnum) String() string {
	return _errorReasonEnums[enum]
}
func (enum ErrorReasonEnum) MarshalJSON() ([]byte, error) {
	return json.Marshal(enum.String())
}