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

// GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems get_characters_character_id_medals_graphic
//
// graphic object
// swagger:model getCharactersCharacterIdMedalsOKBodyItemsGraphicsItems

type GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems struct {

	// get_characters_character_id_medals_color
	//
	// color integer
	Color int32 `json:"color,omitempty"`

	// get_characters_character_id_medals_graphic
	//
	// graphic string
	// Required: true
	Graphic *string `json:"graphic"`

	// get_characters_character_id_medals_layer
	//
	// layer integer
	// Required: true
	Layer *int32 `json:"layer"`

	// get_characters_character_id_medals_part
	//
	// part integer
	// Required: true
	Part *int32 `json:"part"`
}

/* polymorph getCharactersCharacterIdMedalsOKBodyItemsGraphicsItems color false */

/* polymorph getCharactersCharacterIdMedalsOKBodyItemsGraphicsItems graphic false */

/* polymorph getCharactersCharacterIdMedalsOKBodyItemsGraphicsItems layer false */

/* polymorph getCharactersCharacterIdMedalsOKBodyItemsGraphicsItems part false */

// Validate validates this get characters character Id medals o k body items graphics items
func (m *GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems) validateGraphic(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems) validateLayer(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDMedalsOKBodyItemsGraphicsItems) validatePart(formats strfmt.Registry) error {

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

	return nil
}

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

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