// Code generated by go-swagger; DO NOT EDIT.

package restmodels

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"strconv"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
)

// V1LogLinesList v1 log lines list
// swagger:model v1LogLinesList

type V1LogLinesList struct {

	// models
	Models []*V1LogLine `json:"models"`
}

/* polymorph v1LogLinesList models false */

// Validate validates this v1 log lines list
func (m *V1LogLinesList) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *V1LogLinesList) validateModels(formats strfmt.Registry) error {

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

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

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

		if m.Models[i] != nil {

			if err := m.Models[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("models" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// MarshalBinary interface implementation
func (m *V1LogLinesList) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *V1LogLinesList) UnmarshalBinary(b []byte) error {
	var res V1LogLinesList
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
