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

// GetFwLeaderboardsCharactersOKBody get_fw_leaderboards_characters_ok
//
// 200 ok object
// swagger:model getFwLeaderboardsCharactersOKBody

type GetFwLeaderboardsCharactersOKBody struct {

	// kills
	// Required: true
	Kills *GetFwLeaderboardsCharactersOKBodyKills `json:"kills"`

	// victory points
	// Required: true
	VictoryPoints *GetFwLeaderboardsCharactersOKBodyVictoryPoints `json:"victory_points"`
}

/* polymorph getFwLeaderboardsCharactersOKBody kills false */

/* polymorph getFwLeaderboardsCharactersOKBody victory_points false */

// Validate validates this get fw leaderboards characters o k body
func (m *GetFwLeaderboardsCharactersOKBody) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *GetFwLeaderboardsCharactersOKBody) validateKills(formats strfmt.Registry) error {

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

	if m.Kills != nil {

		if err := m.Kills.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("kills")
			}
			return err
		}
	}

	return nil
}

func (m *GetFwLeaderboardsCharactersOKBody) validateVictoryPoints(formats strfmt.Registry) error {

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

	if m.VictoryPoints != nil {

		if err := m.VictoryPoints.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("victory_points")
			}
			return err
		}
	}

	return nil
}

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

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