func NewTransferEventTypeFromValue(v string) (*TransferEventType, error) {
	ev := TransferEventType(v)
	if ev.IsValid() {
		return &ev, nil
	} else {
		return nil, fmt.Errorf("invalid value '%v' for TransferEventType: valid values are %v", v, allowedTransferEventTypeEnumValues)
	}
}
NewTransferEventTypeFromValue returns a pointer to a valid TransferEventType
for the value passed as argument, or an error if the value passed is not allowed by the enum
package plaid
import (
	"encoding/json"
	"fmt"
)
type TransferEventType string
const (
	TRANSFEREVENTTYPE_PENDING TransferEventType = "pending"
	TRANSFEREVENTTYPE_CANCELLED TransferEventType = "cancelled"
	TRANSFEREVENTTYPE_FAILED TransferEventType = "failed"
	TRANSFEREVENTTYPE_POSTED TransferEventType = "posted"
	TRANSFEREVENTTYPE_REVERSED TransferEventType = "reversed"
)
var allowedTransferEventTypeEnumValues = []TransferEventType{
	"pending",
	"cancelled",
	"failed",
	"posted",
	"reversed",
}
func (v *TransferEventType) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := TransferEventType(value)
	for _, existing := range allowedTransferEventTypeEnumValues {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}
	return fmt.Errorf("%+v is not a valid TransferEventType", value)
}