package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/errors" ) /*Roles roles swagger:model Roles */ type Roles struct { /* roles */ Roles []*Role `json:"roles,omitempty"` } // Validate validates this roles func (m *Roles) Validate(formats strfmt.Registry) error { var res []error if err := m.validateRoles(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *Roles) validateRoles(formats strfmt.Registry) error { if swag.IsZero(m.Roles) { // not required return nil } for i := 0; i < len(m.Roles); i++ { if swag.IsZero(m.Roles[i]) { // not required continue } if m.Roles[i] != nil { if err := m.Roles[i].Validate(formats); err != nil { return err } } } return nil }