This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
eve-goclient/client/universe/get_universe_stations_station_id_responses.go

600 lines
16 KiB
Go

package universe
// 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"
"fmt"
"io"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/validate"
strfmt "github.com/go-openapi/strfmt"
)
// GetUniverseStationsStationIDReader is a Reader for the GetUniverseStationsStationID structure.
type GetUniverseStationsStationIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetUniverseStationsStationIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetUniverseStationsStationIDOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewGetUniverseStationsStationIDNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetUniverseStationsStationIDInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
}
}
// NewGetUniverseStationsStationIDOK creates a GetUniverseStationsStationIDOK with default headers values
func NewGetUniverseStationsStationIDOK() *GetUniverseStationsStationIDOK {
return &GetUniverseStationsStationIDOK{}
}
/*GetUniverseStationsStationIDOK handles this case with default header values.
Information about a station
*/
type GetUniverseStationsStationIDOK struct {
/*The caching mechanism used
*/
CacheControl string
/*RFC7231 formatted datetime string
*/
Expires string
/*RFC7231 formatted datetime string
*/
LastModified string
Payload GetUniverseStationsStationIDOKBody
}
func (o *GetUniverseStationsStationIDOK) Error() string {
return fmt.Sprintf("[GET /universe/stations/{station_id}/][%d] getUniverseStationsStationIdOK %+v", 200, o.Payload)
}
func (o *GetUniverseStationsStationIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Cache-Control
o.CacheControl = response.GetHeader("Cache-Control")
// response header Expires
o.Expires = response.GetHeader("Expires")
// response header Last-Modified
o.LastModified = response.GetHeader("Last-Modified")
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetUniverseStationsStationIDNotFound creates a GetUniverseStationsStationIDNotFound with default headers values
func NewGetUniverseStationsStationIDNotFound() *GetUniverseStationsStationIDNotFound {
return &GetUniverseStationsStationIDNotFound{}
}
/*GetUniverseStationsStationIDNotFound handles this case with default header values.
Station not found
*/
type GetUniverseStationsStationIDNotFound struct {
Payload GetUniverseStationsStationIDNotFoundBody
}
func (o *GetUniverseStationsStationIDNotFound) Error() string {
return fmt.Sprintf("[GET /universe/stations/{station_id}/][%d] getUniverseStationsStationIdNotFound %+v", 404, o.Payload)
}
func (o *GetUniverseStationsStationIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetUniverseStationsStationIDInternalServerError creates a GetUniverseStationsStationIDInternalServerError with default headers values
func NewGetUniverseStationsStationIDInternalServerError() *GetUniverseStationsStationIDInternalServerError {
return &GetUniverseStationsStationIDInternalServerError{}
}
/*GetUniverseStationsStationIDInternalServerError handles this case with default header values.
Internal server error
*/
type GetUniverseStationsStationIDInternalServerError struct {
Payload GetUniverseStationsStationIDInternalServerErrorBody
}
func (o *GetUniverseStationsStationIDInternalServerError) Error() string {
return fmt.Sprintf("[GET /universe/stations/{station_id}/][%d] getUniverseStationsStationIdInternalServerError %+v", 500, o.Payload)
}
func (o *GetUniverseStationsStationIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
/*GetUniverseStationsStationIDInternalServerErrorBody get_universe_stations_station_id_internal_server_error
//
// Internal server error
swagger:model GetUniverseStationsStationIDInternalServerErrorBody
*/
type GetUniverseStationsStationIDInternalServerErrorBody struct {
// get_universe_stations_station_id_500_internal_server_error
//
// Internal server error message
// Required: true
Error *string `json:"error"`
}
// Validate validates this get universe stations station ID internal server error body
func (o *GetUniverseStationsStationIDInternalServerErrorBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateError(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetUniverseStationsStationIDInternalServerErrorBody) validateError(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdInternalServerError"+"."+"error", "body", o.Error); err != nil {
return err
}
return nil
}
/*GetUniverseStationsStationIDNotFoundBody get_universe_stations_station_id_not_found
//
// Not found
swagger:model GetUniverseStationsStationIDNotFoundBody
*/
type GetUniverseStationsStationIDNotFoundBody struct {
// get_universe_stations_station_id_404_not_found
//
// Not found message
// Required: true
Error *string `json:"error"`
}
// Validate validates this get universe stations station ID not found body
func (o *GetUniverseStationsStationIDNotFoundBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateError(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetUniverseStationsStationIDNotFoundBody) validateError(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdNotFound"+"."+"error", "body", o.Error); err != nil {
return err
}
return nil
}
/*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
// Required: true
Owner *int32 `json:"owner"`
// position
// Required: true
Position *GetUniverseStationsStationIDOKBodyPosition `json:"position"`
// get_universe_stations_station_id_race_id
//
// race_id integer
// Required: true
RaceID *int32 `json:"race_id"`
// 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
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"`
}
// Validate validates this get universe stations station ID o k body
func (o *GetUniverseStationsStationIDOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateMaxDockableShipVolume(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateName(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateOfficeRentalCost(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateOwner(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validatePosition(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateRaceID(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateReprocessingEfficiency(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateReprocessingStationsTake(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateServices(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateStationID(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateSystemID(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateTypeID(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateMaxDockableShipVolume(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"max_dockable_ship_volume", "body", o.MaxDockableShipVolume); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateName(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"name", "body", o.Name); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateOfficeRentalCost(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"office_rental_cost", "body", o.OfficeRentalCost); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateOwner(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"owner", "body", o.Owner); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validatePosition(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"position", "body", o.Position); err != nil {
return err
}
if o.Position != nil {
if err := o.Position.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("getUniverseStationsStationIdOK" + "." + "position")
}
return err
}
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateRaceID(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"race_id", "body", o.RaceID); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateReprocessingEfficiency(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"reprocessing_efficiency", "body", o.ReprocessingEfficiency); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateReprocessingStationsTake(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"reprocessing_stations_take", "body", o.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 (o *GetUniverseStationsStationIDOKBody) validateServicesItemsEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, getUniverseStationsStationIdOKBodyServicesItemsEnum); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateServices(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"services", "body", o.Services); err != nil {
return err
}
for i := 0; i < len(o.Services); i++ {
// value enum
if err := o.validateServicesItemsEnum("getUniverseStationsStationIdOK"+"."+"services"+"."+strconv.Itoa(i), "body", o.Services[i]); err != nil {
return err
}
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateStationID(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"station_id", "body", o.StationID); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateSystemID(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"system_id", "body", o.SystemID); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBody) validateTypeID(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"type_id", "body", o.TypeID); err != nil {
return err
}
return nil
}
/*GetUniverseStationsStationIDOKBodyPosition get_universe_stations_station_id_position
//
// position object
swagger:model GetUniverseStationsStationIDOKBodyPosition
*/
type GetUniverseStationsStationIDOKBodyPosition struct {
// get_universe_stations_station_id_x
//
// x number
// Required: true
X *float32 `json:"x"`
// get_universe_stations_station_id_y
//
// y number
// Required: true
Y *float32 `json:"y"`
// get_universe_stations_station_id_z
//
// z number
// Required: true
Z *float32 `json:"z"`
}
// Validate validates this get universe stations station ID o k body position
func (o *GetUniverseStationsStationIDOKBodyPosition) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateX(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateY(formats); err != nil {
// prop
res = append(res, err)
}
if err := o.validateZ(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetUniverseStationsStationIDOKBodyPosition) validateX(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"position"+"."+"x", "body", o.X); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBodyPosition) validateY(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"position"+"."+"y", "body", o.Y); err != nil {
return err
}
return nil
}
func (o *GetUniverseStationsStationIDOKBodyPosition) validateZ(formats strfmt.Registry) error {
if err := validate.Required("getUniverseStationsStationIdOK"+"."+"position"+"."+"z", "body", o.Z); err != nil {
return err
}
return nil
}