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

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

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

// GetUniverseStationsStationIDOKBody get_universe_stations_station_id_ok
//
// 200 ok object
// swagger:model getUniverseStationsStationIdOKBody

type GetUniverseStationsStationIDOKBody struct {

	// get_universe_stations_station_id_max_dockable_ship_volume
	//
	// max_dockable_ship_volume number
	// Required: true
	MaxDockableShipVolume *float32 `json:"max_dockable_ship_volume"`

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

	// get_universe_stations_station_id_office_rental_cost
	//
	// office_rental_cost number
	// Required: true
	OfficeRentalCost *float32 `json:"office_rental_cost"`

	// get_universe_stations_station_id_owner
	//
	// ID of the corporation that controls this station
	Owner int32 `json:"owner,omitempty"`

	// position
	// Required: true
	Position *GetUniverseStationsStationIDOKBodyPosition `json:"position"`

	// get_universe_stations_station_id_race_id
	//
	// race_id integer
	RaceID int32 `json:"race_id,omitempty"`

	// get_universe_stations_station_id_reprocessing_efficiency
	//
	// reprocessing_efficiency number
	// Required: true
	ReprocessingEfficiency *float32 `json:"reprocessing_efficiency"`

	// get_universe_stations_station_id_reprocessing_stations_take
	//
	// reprocessing_stations_take number
	// Required: true
	ReprocessingStationsTake *float32 `json:"reprocessing_stations_take"`

	// get_universe_stations_station_id_services
	//
	// services array
	// Required: true
	// Max Items: 30
	Services []string `json:"services"`

	// get_universe_stations_station_id_station_id
	//
	// station_id integer
	// Required: true
	StationID *int32 `json:"station_id"`

	// get_universe_stations_station_id_system_id
	//
	// The solar system this station is in
	// Required: true
	SystemID *int32 `json:"system_id"`

	// get_universe_stations_station_id_type_id
	//
	// type_id integer
	// Required: true
	TypeID *int32 `json:"type_id"`
}

/* polymorph getUniverseStationsStationIdOKBody max_dockable_ship_volume false */

/* polymorph getUniverseStationsStationIdOKBody name false */

/* polymorph getUniverseStationsStationIdOKBody office_rental_cost false */

/* polymorph getUniverseStationsStationIdOKBody owner false */

/* polymorph getUniverseStationsStationIdOKBody position false */

/* polymorph getUniverseStationsStationIdOKBody race_id false */

/* polymorph getUniverseStationsStationIdOKBody reprocessing_efficiency false */

/* polymorph getUniverseStationsStationIdOKBody reprocessing_stations_take false */

/* polymorph getUniverseStationsStationIdOKBody services false */

/* polymorph getUniverseStationsStationIdOKBody station_id false */

/* polymorph getUniverseStationsStationIdOKBody system_id false */

/* polymorph getUniverseStationsStationIdOKBody type_id false */

// Validate validates this get universe stations station Id o k body
func (m *GetUniverseStationsStationIDOKBody) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

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

func (m *GetUniverseStationsStationIDOKBody) validateMaxDockableShipVolume(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateOfficeRentalCost(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validatePosition(formats strfmt.Registry) error {

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

	if m.Position != nil {

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateReprocessingEfficiency(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateReprocessingStationsTake(formats strfmt.Registry) error {

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

	return nil
}

var getUniverseStationsStationIdOKBodyServicesItemsEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["bounty-missions","assasination-missions","courier-missions","interbus","reprocessing-plant","refinery","market","black-market","stock-exchange","cloning","surgery","dna-therapy","repair-facilities","factory","labratory","gambling","fitting","paintshop","news","storage","insurance","docking","office-rental","jump-clone-facility","loyalty-point-store","navy-offices","security-offices"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getUniverseStationsStationIdOKBodyServicesItemsEnum = append(getUniverseStationsStationIdOKBodyServicesItemsEnum, v)
	}
}

func (m *GetUniverseStationsStationIDOKBody) validateServicesItemsEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getUniverseStationsStationIdOKBodyServicesItemsEnum); err != nil {
		return err
	}
	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateServices(formats strfmt.Registry) error {

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

	iServicesSize := int64(len(m.Services))

	if err := validate.MaxItems("services", "body", iServicesSize, 30); err != nil {
		return err
	}

	for i := 0; i < len(m.Services); i++ {

		// value enum
		if err := m.validateServicesItemsEnum("services"+"."+strconv.Itoa(i), "body", m.Services[i]); err != nil {
			return err
		}

	}

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateStationID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateSystemID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseStationsStationIDOKBody) validateTypeID(formats strfmt.Registry) error {

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

	return nil
}

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

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