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

// GetUniverseRacesOKBodyItems get_universe_races_200_ok
//
// 200 ok object
// swagger:model getUniverseRacesOKBodyItems

type GetUniverseRacesOKBodyItems struct {

	// get_universe_races_alliance_id
	//
	// The alliance generally associated with this race
	// Required: true
	AllianceID *int32 `json:"alliance_id"`

	// get_universe_races_description
	//
	// description string
	// Required: true
	Description *string `json:"description"`

	// get_universe_races_name
	//
	// name string
	// Required: true
	Name *string `json:"name"`

	// get_universe_races_race_id
	//
	// race_id integer
	// Required: true
	RaceID *int32 `json:"race_id"`
}

/* polymorph getUniverseRacesOKBodyItems alliance_id false */

/* polymorph getUniverseRacesOKBodyItems description false */

/* polymorph getUniverseRacesOKBodyItems name false */

/* polymorph getUniverseRacesOKBodyItems race_id false */

// Validate validates this get universe races o k body items
func (m *GetUniverseRacesOKBodyItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

func (m *GetUniverseRacesOKBodyItems) validateAllianceID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseRacesOKBodyItems) validateDescription(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseRacesOKBodyItems) validateName(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseRacesOKBodyItems) validateRaceID(formats strfmt.Registry) error {

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

	return nil
}

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

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