push_notifications.go
func (pn *notificationRequest) validate() error {
	if 0 == len(pn.Interests) || len(pn.Interests) > 10 {
		return errors.New("Interests must contain between 1 and 10 interests")
	}

	if pn.APNS == nil && pn.GCM == nil && pn.FCM == nil {
		return errors.New("PushNotification must contain a GCM, FCM or APNS payload")
	}

	return nil
}
func (pn *notificationRequest) validate() error {
	if 0 == len(pn.Interests) || len(pn.Interests) > 10 {
		return errors.New("Interests must contain between 1 and 10 interests")
	}

	if pn.APNS == nil && pn.GCM == nil && pn.FCM == nil {
		return errors.New("PushNotification must contain a GCM, FCM or APNS payload")
	}

	return nil
}
func ( pn * notificationRequest ) validate ( ) error { if 0 == len ( pn . Interests ) || len ( pn . Interests ) > 10 { return errors . New ( " " ) } if pn . APNS == nil && pn . GCM == nil && pn . FCM == nil { return errors . New ( " " ) } return nil }
// validate checks the notificationRequest has 0<Interests<11 and has a
// APNS, GCM or FCM payload
validate checks the notificationRequest has 0<Interests<11 and has a APNS GCM or FCM payload