func (m *Groups) UnmarshalBinary(b []byte) error {
	var res Groups
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"strconv"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
type Groups struct {
	Count int64 `json:"count,omitempty"`
	IsTruncated bool `json:"is_truncated,omitempty"`
	Items []*Group `json:"items"`
	NextOffset int64 `json:"next_offset,omitempty"`
}
func (m *Groups) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateItems(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *Groups) validateItems(formats strfmt.Registry) error {
	if swag.IsZero(m.Items) {  
		return nil
	}
	for i := 0; i < len(m.Items); i++ {
		if swag.IsZero(m.Items[i]) {  
			continue
		}
		if m.Items[i] != nil {
			if err := m.Items[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("items" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *Groups) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}