func (v BankTransferEventType) Ptr() *BankTransferEventType {
	return &v
}
Ptr returns reference to BankTransferEventType value
package plaid
import (
	"encoding/json"
	"fmt"
)
type BankTransferEventType string
const (
	BANKTRANSFEREVENTTYPE_PENDING BankTransferEventType = "pending"
	BANKTRANSFEREVENTTYPE_CANCELLED BankTransferEventType = "cancelled"
	BANKTRANSFEREVENTTYPE_FAILED BankTransferEventType = "failed"
	BANKTRANSFEREVENTTYPE_POSTED BankTransferEventType = "posted"
	BANKTRANSFEREVENTTYPE_REVERSED BankTransferEventType = "reversed"
	BANKTRANSFEREVENTTYPE_RECEIVER_PENDING BankTransferEventType = "receiver_pending"
	BANKTRANSFEREVENTTYPE_RECEIVER_POSTED BankTransferEventType = "receiver_posted"
)
var allowedBankTransferEventTypeEnumValues = []BankTransferEventType{
	"pending",
	"cancelled",
	"failed",
	"posted",
	"reversed",
	"receiver_pending",
	"receiver_posted",
}
func (v *BankTransferEventType) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := BankTransferEventType(value)
	for _, existing := range allowedBankTransferEventTypeEnumValues {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}
	return fmt.Errorf("%+v is not a valid BankTransferEventType", value)
}
func NewBankTransferEventTypeFromValue(v string) (*BankTransferEventType, error) {
	ev := BankTransferEventType(v)
	if ev.IsValid() {
		return &ev, nil
	} else {
		return nil, fmt.Errorf("invalid value '%v' for BankTransferEventType: valid values are %v", v, allowedBankTransferEventTypeEnumValues)
	}
}
func (v BankTransferEventType) IsValid() bool {
	for _, existing := range allowedBankTransferEventTypeEnumValues {
		if existing == v {
			return true
		}
	}
	return false
}