339 lines
9.3 KiB
Go
339 lines
9.3 KiB
Go
package alliance
|
|
|
|
// 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"
|
|
|
|
"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"
|
|
)
|
|
|
|
// GetAlliancesAllianceIDIconsReader is a Reader for the GetAlliancesAllianceIDIcons structure.
|
|
type GetAlliancesAllianceIDIconsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetAlliancesAllianceIDIconsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewGetAlliancesAllianceIDIconsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 404:
|
|
result := NewGetAlliancesAllianceIDIconsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewGetAlliancesAllianceIDIconsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetAlliancesAllianceIDIconsOK creates a GetAlliancesAllianceIDIconsOK with default headers values
|
|
func NewGetAlliancesAllianceIDIconsOK() *GetAlliancesAllianceIDIconsOK {
|
|
return &GetAlliancesAllianceIDIconsOK{}
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsOK handles this case with default header values.
|
|
|
|
Urls for icons for the given alliance id and server
|
|
*/
|
|
type GetAlliancesAllianceIDIconsOK struct {
|
|
/*The caching mechanism used
|
|
*/
|
|
CacheControl string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
Expires string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
LastModified string
|
|
|
|
Payload GetAlliancesAllianceIDIconsOKBody
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsOK) Error() string {
|
|
return fmt.Sprintf("[GET /alliances/{alliance_id}/icons/][%d] getAlliancesAllianceIdIconsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsOK) 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
|
|
}
|
|
|
|
// NewGetAlliancesAllianceIDIconsNotFound creates a GetAlliancesAllianceIDIconsNotFound with default headers values
|
|
func NewGetAlliancesAllianceIDIconsNotFound() *GetAlliancesAllianceIDIconsNotFound {
|
|
return &GetAlliancesAllianceIDIconsNotFound{}
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsNotFound handles this case with default header values.
|
|
|
|
No image server for this datasource
|
|
*/
|
|
type GetAlliancesAllianceIDIconsNotFound struct {
|
|
Payload GetAlliancesAllianceIDIconsNotFoundBody
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /alliances/{alliance_id}/icons/][%d] getAlliancesAllianceIdIconsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsNotFound) 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
|
|
}
|
|
|
|
// NewGetAlliancesAllianceIDIconsInternalServerError creates a GetAlliancesAllianceIDIconsInternalServerError with default headers values
|
|
func NewGetAlliancesAllianceIDIconsInternalServerError() *GetAlliancesAllianceIDIconsInternalServerError {
|
|
return &GetAlliancesAllianceIDIconsInternalServerError{}
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type GetAlliancesAllianceIDIconsInternalServerError struct {
|
|
Payload GetAlliancesAllianceIDIconsInternalServerErrorBody
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /alliances/{alliance_id}/icons/][%d] getAlliancesAllianceIdIconsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsInternalServerError) 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
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsInternalServerErrorBody get_alliances_alliance_id_icons_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model GetAlliancesAllianceIDIconsInternalServerErrorBody
|
|
*/
|
|
type GetAlliancesAllianceIDIconsInternalServerErrorBody struct {
|
|
|
|
// get_alliances_alliance_id_icons_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get alliances alliance ID icons internal server error body
|
|
func (o *GetAlliancesAllianceIDIconsInternalServerErrorBody) 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 *GetAlliancesAllianceIDIconsInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getAlliancesAllianceIdIconsInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsInternalServerErrorBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsInternalServerErrorBody) UnmarshalBinary(b []byte) error {
|
|
var res GetAlliancesAllianceIDIconsInternalServerErrorBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsNotFoundBody get_alliances_alliance_id_icons_not_found
|
|
//
|
|
// No image server for this datasource
|
|
swagger:model GetAlliancesAllianceIDIconsNotFoundBody
|
|
*/
|
|
type GetAlliancesAllianceIDIconsNotFoundBody struct {
|
|
|
|
// get_alliances_alliance_id_icons_error
|
|
//
|
|
// error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get alliances alliance ID icons not found body
|
|
func (o *GetAlliancesAllianceIDIconsNotFoundBody) 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 *GetAlliancesAllianceIDIconsNotFoundBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getAlliancesAllianceIdIconsNotFound"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsNotFoundBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsNotFoundBody) UnmarshalBinary(b []byte) error {
|
|
var res GetAlliancesAllianceIDIconsNotFoundBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*GetAlliancesAllianceIDIconsOKBody get_alliances_alliance_id_icons_ok
|
|
//
|
|
// 200 ok object
|
|
swagger:model GetAlliancesAllianceIDIconsOKBody
|
|
*/
|
|
type GetAlliancesAllianceIDIconsOKBody struct {
|
|
|
|
// get_alliances_alliance_id_icons_px128x128
|
|
//
|
|
// px128x128 string
|
|
// Required: true
|
|
Px128x128 *string `json:"px128x128"`
|
|
|
|
// get_alliances_alliance_id_icons_px64x64
|
|
//
|
|
// px64x64 string
|
|
// Required: true
|
|
Px64x64 *string `json:"px64x64"`
|
|
}
|
|
|
|
// Validate validates this get alliances alliance ID icons o k body
|
|
func (o *GetAlliancesAllianceIDIconsOKBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validatePx128x128(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validatePx64x64(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsOKBody) validatePx128x128(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getAlliancesAllianceIdIconsOK"+"."+"px128x128", "body", o.Px128x128); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetAlliancesAllianceIDIconsOKBody) validatePx64x64(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getAlliancesAllianceIdIconsOK"+"."+"px64x64", "body", o.Px64x64); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsOKBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetAlliancesAllianceIDIconsOKBody) UnmarshalBinary(b []byte) error {
|
|
var res GetAlliancesAllianceIDIconsOKBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|