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

// UsecaseHelpersJSONFleetUpdatesRequest usecase helpers JSON fleet updates request
//
// swagger:model usecase_helpers.JSONFleetUpdatesRequest
type UsecaseHelpersJSONFleetUpdatesRequest struct {

	// fleet names
	// Required: true
	// Max Items: 1000
	// Min Items: 1
	FleetNames []string `json:"fleet_names"`

	// manifest id
	// Required: true
	ManifestID *int64 `json:"manifest_id"`
}

// Validate validates this usecase helpers JSON fleet updates request
func (m *UsecaseHelpersJSONFleetUpdatesRequest) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *UsecaseHelpersJSONFleetUpdatesRequest) validateFleetNames(formats strfmt.Registry) error {

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

	iFleetNamesSize := int64(len(m.FleetNames))

	if err := validate.MinItems("fleet_names", "body", iFleetNamesSize, 1); err != nil {
		return err
	}

	if err := validate.MaxItems("fleet_names", "body", iFleetNamesSize, 1000); err != nil {
		return err
	}

	return nil
}

func (m *UsecaseHelpersJSONFleetUpdatesRequest) validateManifestID(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this usecase helpers JSON fleet updates request based on context it is used
func (m *UsecaseHelpersJSONFleetUpdatesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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