// 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 (
	strfmt "github.com/go-openapi/strfmt"

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

// PutCorporationsCorporationIDStructuresStructureIDParamsBodyItems put_corporations_corporation_id_structures_structure_id_new_schedule
//
// new_schedule object
// swagger:model putCorporationsCorporationIdStructuresStructureIdParamsBodyItems

type PutCorporationsCorporationIDStructuresStructureIDParamsBodyItems struct {

	// put_corporations_corporation_id_structures_structure_id_day
	//
	// Day of the week, zero-indexed to Monday
	// Required: true
	// Maximum: 6
	// Minimum: 0
	Day *int32 `json:"day"`

	// put_corporations_corporation_id_structures_structure_id_hour
	//
	// Hour of the day evetime, zero-indexed to midnight
	// Required: true
	// Maximum: 23
	// Minimum: 0
	Hour *int32 `json:"hour"`
}

/* polymorph putCorporationsCorporationIdStructuresStructureIdParamsBodyItems day false */

/* polymorph putCorporationsCorporationIdStructuresStructureIdParamsBodyItems hour false */

// Validate validates this put corporations corporation Id structures structure Id params body items
func (m *PutCorporationsCorporationIDStructuresStructureIDParamsBodyItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *PutCorporationsCorporationIDStructuresStructureIDParamsBodyItems) validateDay(formats strfmt.Registry) error {

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

	if err := validate.MinimumInt("day", "body", int64(*m.Day), 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("day", "body", int64(*m.Day), 6, false); err != nil {
		return err
	}

	return nil
}

func (m *PutCorporationsCorporationIDStructuresStructureIDParamsBodyItems) validateHour(formats strfmt.Registry) error {

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

	if err := validate.MinimumInt("hour", "body", int64(*m.Hour), 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("hour", "body", int64(*m.Hour), 23, false); err != nil {
		return err
	}

	return nil
}

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

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