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

package assets

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

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

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

// GetCorporationsCorporationIDAssetsReader is a Reader for the GetCorporationsCorporationIDAssets structure.
type GetCorporationsCorporationIDAssetsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCorporationsCorporationIDAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {

	case 200:
		result := NewGetCorporationsCorporationIDAssetsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil

	case 403:
		result := NewGetCorporationsCorporationIDAssetsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	case 500:
		result := NewGetCorporationsCorporationIDAssetsInternalServerError()
		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())
	}
}

// NewGetCorporationsCorporationIDAssetsOK creates a GetCorporationsCorporationIDAssetsOK with default headers values
func NewGetCorporationsCorporationIDAssetsOK() *GetCorporationsCorporationIDAssetsOK {
	return &GetCorporationsCorporationIDAssetsOK{
		XPages: 1,
	}
}

/*GetCorporationsCorporationIDAssetsOK handles this case with default header values.

A list of assets
*/
type GetCorporationsCorporationIDAssetsOK struct {
	/*The caching mechanism used
	 */
	CacheControl string
	/*RFC7231 formatted datetime string
	 */
	Expires string
	/*RFC7231 formatted datetime string
	 */
	LastModified string
	/*Maximum page number
	 */
	XPages int32

	Payload models.GetCorporationsCorporationIDAssetsOKBody
}

func (o *GetCorporationsCorporationIDAssetsOK) Error() string {
	return fmt.Sprintf("[GET /corporations/{corporation_id}/assets/][%d] getCorporationsCorporationIdAssetsOK  %+v", 200, o.Payload)
}

func (o *GetCorporationsCorporationIDAssetsOK) 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 header X-Pages
	xPages, err := swag.ConvertInt32(response.GetHeader("X-Pages"))
	if err != nil {
		return errors.InvalidType("X-Pages", "header", "int32", response.GetHeader("X-Pages"))
	}
	o.XPages = xPages

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

	return nil
}

// NewGetCorporationsCorporationIDAssetsForbidden creates a GetCorporationsCorporationIDAssetsForbidden with default headers values
func NewGetCorporationsCorporationIDAssetsForbidden() *GetCorporationsCorporationIDAssetsForbidden {
	return &GetCorporationsCorporationIDAssetsForbidden{}
}

/*GetCorporationsCorporationIDAssetsForbidden handles this case with default header values.

Forbidden
*/
type GetCorporationsCorporationIDAssetsForbidden struct {
	Payload *models.Forbidden
}

func (o *GetCorporationsCorporationIDAssetsForbidden) Error() string {
	return fmt.Sprintf("[GET /corporations/{corporation_id}/assets/][%d] getCorporationsCorporationIdAssetsForbidden  %+v", 403, o.Payload)
}

func (o *GetCorporationsCorporationIDAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Forbidden)

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

	return nil
}

// NewGetCorporationsCorporationIDAssetsInternalServerError creates a GetCorporationsCorporationIDAssetsInternalServerError with default headers values
func NewGetCorporationsCorporationIDAssetsInternalServerError() *GetCorporationsCorporationIDAssetsInternalServerError {
	return &GetCorporationsCorporationIDAssetsInternalServerError{}
}

/*GetCorporationsCorporationIDAssetsInternalServerError handles this case with default header values.

Internal server error
*/
type GetCorporationsCorporationIDAssetsInternalServerError struct {
	Payload *models.InternalServerError
}

func (o *GetCorporationsCorporationIDAssetsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /corporations/{corporation_id}/assets/][%d] getCorporationsCorporationIdAssetsInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCorporationsCorporationIDAssetsInternalServerError) 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
}
