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

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 (
	"context"

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

// HandlersTagsUpdateRequest handlers tags update request
//
// swagger:model handlers.TagsUpdateRequest
type HandlersTagsUpdateRequest struct {

	// tags
	// Required: true
	Tags []string `json:"tags"`

	// vins
	// Required: true
	// Min Items: 0
	Vins []string `json:"vins"`
}

// Validate validates this handlers tags update request
func (m *HandlersTagsUpdateRequest) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *HandlersTagsUpdateRequest) validateTags(formats strfmt.Registry) error {

	if err := validate.Required("tags", "body", m.Tags); err != nil {
		return err
	}

	return nil
}

func (m *HandlersTagsUpdateRequest) validateVins(formats strfmt.Registry) error {

	if err := validate.Required("vins", "body", m.Vins); err != nil {
		return err
	}

	iVinsSize := int64(len(m.Vins))

	if err := validate.MinItems("vins", "body", iVinsSize, 0); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this handlers tags update request based on context it is used
func (m *HandlersTagsUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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