// Code generated by go-swagger; DO NOT EDIT.

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

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

	"git.inf3.xyz/tschwery/eve-goclient.git/models"
)

// 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 *models.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")

	o.Payload = new(models.GetAlliancesAllianceIDIconsOKBody)

	// 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 *models.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 {

	o.Payload = new(models.GetAlliancesAllianceIDIconsNotFoundBody)

	// 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 *models.InternalServerError
}

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 {

	o.Payload = new(models.InternalServerError)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
