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"
)

/*Services services

swagger:model Services
*/
type Services struct {

	/* services
	 */
	Services []*Service `json:"services,omitempty"`
}

// Validate validates this services
func (m *Services) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateServices(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *Services) validateServices(formats strfmt.Registry) error {

	if swag.IsZero(m.Services) { // not required
		return nil
	}

	for i := 0; i < len(m.Services); i++ {

		if swag.IsZero(m.Services[i]) { // not required
			continue
		}

		if m.Services[i] != nil {

			if err := m.Services[i].Validate(formats); err != nil {
				return err
			}
		}

	}

	return nil
}