442 lines
12 KiB
Go
442 lines
12 KiB
Go
package fittings
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/swag"
|
|
"github.com/go-openapi/validate"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// GetCharactersCharacterIDFittingsReader is a Reader for the GetCharactersCharacterIDFittings structure.
|
|
type GetCharactersCharacterIDFittingsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetCharactersCharacterIDFittingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewGetCharactersCharacterIDFittingsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 403:
|
|
result := NewGetCharactersCharacterIDFittingsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewGetCharactersCharacterIDFittingsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDFittingsOK creates a GetCharactersCharacterIDFittingsOK with default headers values
|
|
func NewGetCharactersCharacterIDFittingsOK() *GetCharactersCharacterIDFittingsOK {
|
|
return &GetCharactersCharacterIDFittingsOK{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsOK handles this case with default header values.
|
|
|
|
A list of fittings
|
|
*/
|
|
type GetCharactersCharacterIDFittingsOK struct {
|
|
/*The caching mechanism used
|
|
*/
|
|
CacheControl string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
Expires string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
LastModified string
|
|
|
|
Payload []*GetCharactersCharacterIDFittingsOKBodyItems0
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOK) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/fittings/][%d] getCharactersCharacterIdFittingsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOK) 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
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDFittingsForbidden creates a GetCharactersCharacterIDFittingsForbidden with default headers values
|
|
func NewGetCharactersCharacterIDFittingsForbidden() *GetCharactersCharacterIDFittingsForbidden {
|
|
return &GetCharactersCharacterIDFittingsForbidden{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsForbidden handles this case with default header values.
|
|
|
|
Forbidden
|
|
*/
|
|
type GetCharactersCharacterIDFittingsForbidden struct {
|
|
Payload GetCharactersCharacterIDFittingsForbiddenBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/fittings/][%d] getCharactersCharacterIdFittingsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsForbidden) 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
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDFittingsInternalServerError creates a GetCharactersCharacterIDFittingsInternalServerError with default headers values
|
|
func NewGetCharactersCharacterIDFittingsInternalServerError() *GetCharactersCharacterIDFittingsInternalServerError {
|
|
return &GetCharactersCharacterIDFittingsInternalServerError{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type GetCharactersCharacterIDFittingsInternalServerError struct {
|
|
Payload GetCharactersCharacterIDFittingsInternalServerErrorBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/fittings/][%d] getCharactersCharacterIdFittingsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsInternalServerError) 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
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsForbiddenBody get_characters_character_id_fittings_forbidden
|
|
//
|
|
// Forbidden
|
|
swagger:model GetCharactersCharacterIDFittingsForbiddenBody
|
|
*/
|
|
type GetCharactersCharacterIDFittingsForbiddenBody struct {
|
|
|
|
// get_characters_character_id_fittings_403_forbidden
|
|
//
|
|
// Forbidden message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID fittings forbidden body
|
|
func (o *GetCharactersCharacterIDFittingsForbiddenBody) 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 *GetCharactersCharacterIDFittingsForbiddenBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdFittingsForbidden"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsInternalServerErrorBody get_characters_character_id_fittings_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model GetCharactersCharacterIDFittingsInternalServerErrorBody
|
|
*/
|
|
type GetCharactersCharacterIDFittingsInternalServerErrorBody struct {
|
|
|
|
// get_characters_character_id_fittings_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID fittings internal server error body
|
|
func (o *GetCharactersCharacterIDFittingsInternalServerErrorBody) 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 *GetCharactersCharacterIDFittingsInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdFittingsInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsOKBodyItems0 get_characters_character_id_fittings_200_ok
|
|
//
|
|
// 200 ok object
|
|
swagger:model GetCharactersCharacterIDFittingsOKBodyItems0
|
|
*/
|
|
type GetCharactersCharacterIDFittingsOKBodyItems0 struct {
|
|
|
|
// get_characters_character_id_fittings_description
|
|
//
|
|
// description string
|
|
// Required: true
|
|
Description *string `json:"description"`
|
|
|
|
// get_characters_character_id_fittings_fitting_id
|
|
//
|
|
// fitting_id integer
|
|
// Required: true
|
|
FittingID *int32 `json:"fitting_id"`
|
|
|
|
// get_characters_character_id_fittings_items
|
|
//
|
|
// items array
|
|
// Required: true
|
|
Items []*GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0 `json:"items"`
|
|
|
|
// get_characters_character_id_fittings_name
|
|
//
|
|
// name string
|
|
// Required: true
|
|
Name *string `json:"name"`
|
|
|
|
// get_characters_character_id_fittings_ship_type_id
|
|
//
|
|
// ship_type_id integer
|
|
// Required: true
|
|
ShipTypeID *int32 `json:"ship_type_id"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID fittings o k body items0
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateDescription(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateFittingID(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateItems(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateName(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateShipTypeID(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) validateDescription(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("description", "body", o.Description); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) validateFittingID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("fitting_id", "body", o.FittingID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) validateItems(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("items", "body", o.Items); err != nil {
|
|
return err
|
|
}
|
|
|
|
for i := 0; i < len(o.Items); i++ {
|
|
|
|
if swag.IsZero(o.Items[i]) { // not required
|
|
continue
|
|
}
|
|
|
|
if o.Items[i] != nil {
|
|
|
|
if err := o.Items[i].Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("items" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) validateName(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("name", "body", o.Name); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0) validateShipTypeID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("ship_type_id", "body", o.ShipTypeID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0 get_characters_character_id_fittings_item
|
|
//
|
|
// item object
|
|
swagger:model GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0
|
|
*/
|
|
type GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0 struct {
|
|
|
|
// get_characters_character_id_fittings_flag
|
|
//
|
|
// flag integer
|
|
// Required: true
|
|
Flag *int32 `json:"flag"`
|
|
|
|
// get_characters_character_id_fittings_quantity
|
|
//
|
|
// quantity integer
|
|
// Required: true
|
|
Quantity *int32 `json:"quantity"`
|
|
|
|
// get_characters_character_id_fittings_type_id
|
|
//
|
|
// type_id integer
|
|
// Required: true
|
|
TypeID *int32 `json:"type_id"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID fittings o k body items0 items items0
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateFlag(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateQuantity(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 *GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0) validateFlag(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("flag", "body", o.Flag); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0) validateQuantity(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("quantity", "body", o.Quantity); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDFittingsOKBodyItems0ItemsItems0) validateTypeID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("type_id", "body", o.TypeID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|