// 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 (
	"encoding/json"

	strfmt "github.com/go-openapi/strfmt"

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

// GetFleetsFleetIDMembersOKBodyItems get_fleets_fleet_id_members_200_ok
//
// 200 ok object
// swagger:model getFleetsFleetIdMembersOKBodyItems

type GetFleetsFleetIDMembersOKBodyItems struct {

	// get_fleets_fleet_id_members_character_id
	//
	// character_id integer
	// Required: true
	CharacterID *int32 `json:"character_id"`

	// get_fleets_fleet_id_members_join_time
	//
	// join_time string
	// Required: true
	JoinTime *strfmt.DateTime `json:"join_time"`

	// get_fleets_fleet_id_members_role
	//
	// Member’s role in fleet
	// Required: true
	Role *string `json:"role"`

	// get_fleets_fleet_id_members_role_name
	//
	// Localized role names
	// Required: true
	RoleName *string `json:"role_name"`

	// get_fleets_fleet_id_members_ship_type_id
	//
	// ship_type_id integer
	// Required: true
	ShipTypeID *int32 `json:"ship_type_id"`

	// get_fleets_fleet_id_members_solar_system_id
	//
	// Solar system the member is located in
	// Required: true
	SolarSystemID *int32 `json:"solar_system_id"`

	// get_fleets_fleet_id_members_squad_id
	//
	// ID of the squad the member is in. If not applicable, will be set to -1
	// Required: true
	SquadID *int64 `json:"squad_id"`

	// get_fleets_fleet_id_members_station_id
	//
	// Station in which the member is docked in, if applicable
	StationID int64 `json:"station_id,omitempty"`

	// get_fleets_fleet_id_members_takes_fleet_warp
	//
	// Whether the member take fleet warps
	// Required: true
	TakesFleetWarp *bool `json:"takes_fleet_warp"`

	// get_fleets_fleet_id_members_wing_id
	//
	// ID of the wing the member is in. If not applicable, will be set to -1
	// Required: true
	WingID *int64 `json:"wing_id"`
}

/* polymorph getFleetsFleetIdMembersOKBodyItems character_id false */

/* polymorph getFleetsFleetIdMembersOKBodyItems join_time false */

/* polymorph getFleetsFleetIdMembersOKBodyItems role false */

/* polymorph getFleetsFleetIdMembersOKBodyItems role_name false */

/* polymorph getFleetsFleetIdMembersOKBodyItems ship_type_id false */

/* polymorph getFleetsFleetIdMembersOKBodyItems solar_system_id false */

/* polymorph getFleetsFleetIdMembersOKBodyItems squad_id false */

/* polymorph getFleetsFleetIdMembersOKBodyItems station_id false */

/* polymorph getFleetsFleetIdMembersOKBodyItems takes_fleet_warp false */

/* polymorph getFleetsFleetIdMembersOKBodyItems wing_id false */

// Validate validates this get fleets fleet Id members o k body items
func (m *GetFleetsFleetIDMembersOKBodyItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

func (m *GetFleetsFleetIDMembersOKBodyItems) validateCharacterID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateJoinTime(formats strfmt.Registry) error {

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

	if err := validate.FormatOf("join_time", "body", "date-time", m.JoinTime.String(), formats); err != nil {
		return err
	}

	return nil
}

var getFleetsFleetIdMembersOKBodyItemsTypeRolePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["fleet_commander","wing_commander","squad_commander","squad_member"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getFleetsFleetIdMembersOKBodyItemsTypeRolePropEnum = append(getFleetsFleetIdMembersOKBodyItemsTypeRolePropEnum, v)
	}
}

const (
	// GetFleetsFleetIDMembersOKBodyItemsRoleFleetCommander captures enum value "fleet_commander"
	GetFleetsFleetIDMembersOKBodyItemsRoleFleetCommander string = "fleet_commander"
	// GetFleetsFleetIDMembersOKBodyItemsRoleWingCommander captures enum value "wing_commander"
	GetFleetsFleetIDMembersOKBodyItemsRoleWingCommander string = "wing_commander"
	// GetFleetsFleetIDMembersOKBodyItemsRoleSquadCommander captures enum value "squad_commander"
	GetFleetsFleetIDMembersOKBodyItemsRoleSquadCommander string = "squad_commander"
	// GetFleetsFleetIDMembersOKBodyItemsRoleSquadMember captures enum value "squad_member"
	GetFleetsFleetIDMembersOKBodyItemsRoleSquadMember string = "squad_member"
)

// prop value enum
func (m *GetFleetsFleetIDMembersOKBodyItems) validateRoleEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getFleetsFleetIdMembersOKBodyItemsTypeRolePropEnum); err != nil {
		return err
	}
	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateRole(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateRoleEnum("role", "body", *m.Role); err != nil {
		return err
	}

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateRoleName(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateShipTypeID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateSolarSystemID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateSquadID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateTakesFleetWarp(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetFleetsFleetIDMembersOKBodyItems) validateWingID(formats strfmt.Registry) error {

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

	return nil
}

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

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