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

// GetWarsWarIDOKBodyAggressor get_wars_war_id_aggressor
//
// The aggressor corporation or alliance that declared this war, only contains either corporation_id or alliance_id
// swagger:model getWarsWarIdOKBodyAggressor

type GetWarsWarIDOKBodyAggressor struct {

	// get_wars_war_id_alliance_id
	//
	// Alliance ID if and only if the aggressor is an alliance
	AllianceID int32 `json:"alliance_id,omitempty"`

	// get_wars_war_id_corporation_id
	//
	// Corporation ID if and only if the aggressor is a corporation
	CorporationID int32 `json:"corporation_id,omitempty"`

	// get_wars_war_id_isk_destroyed
	//
	// ISK value of ships the aggressor has destroyed
	// Required: true
	IskDestroyed *float32 `json:"isk_destroyed"`

	// get_wars_war_id_ships_killed
	//
	// The number of ships the aggressor has killed
	// Required: true
	ShipsKilled *int32 `json:"ships_killed"`
}

/* polymorph getWarsWarIdOKBodyAggressor alliance_id false */

/* polymorph getWarsWarIdOKBodyAggressor corporation_id false */

/* polymorph getWarsWarIdOKBodyAggressor isk_destroyed false */

/* polymorph getWarsWarIdOKBodyAggressor ships_killed false */

// Validate validates this get wars war Id o k body aggressor
func (m *GetWarsWarIDOKBodyAggressor) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *GetWarsWarIDOKBodyAggressor) validateIskDestroyed(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetWarsWarIDOKBodyAggressor) validateShipsKilled(formats strfmt.Registry) error {

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

	return nil
}

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

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