package contacts

import (
	"fmt"
	"io"

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

	"github.com/ferocious-space/eveapi/models"
)

type DeleteCharactersCharacterIDContactsReader struct {
	formats strfmt.Registry
}

func (o *DeleteCharactersCharacterIDContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewDeleteCharactersCharacterIDContactsNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteCharactersCharacterIDContactsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteCharactersCharacterIDContactsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteCharactersCharacterIDContactsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 420:
		result := NewDeleteCharactersCharacterIDContactsEnhanceYourCalm()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteCharactersCharacterIDContactsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteCharactersCharacterIDContactsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 504:
		result := NewDeleteCharactersCharacterIDContactsGatewayTimeout()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

func NewDeleteCharactersCharacterIDContactsNoContent() *DeleteCharactersCharacterIDContactsNoContent {
	return &DeleteCharactersCharacterIDContactsNoContent{}
}

type DeleteCharactersCharacterIDContactsNoContent struct {
}

func (o *DeleteCharactersCharacterIDContactsNoContent) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsNoContent ", 204)
}

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsBadRequest() *DeleteCharactersCharacterIDContactsBadRequest {
	return &DeleteCharactersCharacterIDContactsBadRequest{}
}

type DeleteCharactersCharacterIDContactsBadRequest struct {
	Payload *models.BadRequest
}

func (o *DeleteCharactersCharacterIDContactsBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsBadRequest  %+v", 400, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsBadRequest) GetPayload() *models.BadRequest {
	return o.Payload
}

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

	o.Payload = new(models.BadRequest)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsUnauthorized() *DeleteCharactersCharacterIDContactsUnauthorized {
	return &DeleteCharactersCharacterIDContactsUnauthorized{}
}

type DeleteCharactersCharacterIDContactsUnauthorized struct {
	Payload *models.Unauthorized
}

func (o *DeleteCharactersCharacterIDContactsUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsUnauthorized  %+v", 401, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsUnauthorized) GetPayload() *models.Unauthorized {
	return o.Payload
}

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

	o.Payload = new(models.Unauthorized)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsForbidden() *DeleteCharactersCharacterIDContactsForbidden {
	return &DeleteCharactersCharacterIDContactsForbidden{}
}

type DeleteCharactersCharacterIDContactsForbidden struct {
	Payload *models.Forbidden
}

func (o *DeleteCharactersCharacterIDContactsForbidden) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsForbidden  %+v", 403, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsForbidden) GetPayload() *models.Forbidden {
	return o.Payload
}

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

	o.Payload = new(models.Forbidden)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsEnhanceYourCalm() *DeleteCharactersCharacterIDContactsEnhanceYourCalm {
	return &DeleteCharactersCharacterIDContactsEnhanceYourCalm{}
}

type DeleteCharactersCharacterIDContactsEnhanceYourCalm struct {
	Payload *models.ErrorLimited
}

func (o *DeleteCharactersCharacterIDContactsEnhanceYourCalm) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsEnhanceYourCalm  %+v", 420, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsEnhanceYourCalm) GetPayload() *models.ErrorLimited {
	return o.Payload
}

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

	o.Payload = new(models.ErrorLimited)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsInternalServerError() *DeleteCharactersCharacterIDContactsInternalServerError {
	return &DeleteCharactersCharacterIDContactsInternalServerError{}
}

type DeleteCharactersCharacterIDContactsInternalServerError struct {
	Payload *models.InternalServerError
}

func (o *DeleteCharactersCharacterIDContactsInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsInternalServerError  %+v", 500, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsInternalServerError) GetPayload() *models.InternalServerError {
	return o.Payload
}

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

	o.Payload = new(models.InternalServerError)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsServiceUnavailable() *DeleteCharactersCharacterIDContactsServiceUnavailable {
	return &DeleteCharactersCharacterIDContactsServiceUnavailable{}
}

type DeleteCharactersCharacterIDContactsServiceUnavailable struct {
	Payload *models.ServiceUnavailable
}

func (o *DeleteCharactersCharacterIDContactsServiceUnavailable) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsServiceUnavailable  %+v", 503, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsServiceUnavailable) GetPayload() *models.ServiceUnavailable {
	return o.Payload
}

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

	o.Payload = new(models.ServiceUnavailable)

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

	return nil
}

func NewDeleteCharactersCharacterIDContactsGatewayTimeout() *DeleteCharactersCharacterIDContactsGatewayTimeout {
	return &DeleteCharactersCharacterIDContactsGatewayTimeout{}
}

type DeleteCharactersCharacterIDContactsGatewayTimeout struct {
	Payload *models.GatewayTimeout
}

func (o *DeleteCharactersCharacterIDContactsGatewayTimeout) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsGatewayTimeout  %+v", 504, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsGatewayTimeout) GetPayload() *models.GatewayTimeout {
	return o.Payload
}

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

	o.Payload = new(models.GatewayTimeout)

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

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

package contacts

// 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"
	"github.com/go-openapi/strfmt"

	"github.com/ferocious-space/eveapi/models"
)

// DeleteCharactersCharacterIDContactsReader is a Reader for the DeleteCharactersCharacterIDContacts structure.
type DeleteCharactersCharacterIDContactsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteCharactersCharacterIDContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewDeleteCharactersCharacterIDContactsNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteCharactersCharacterIDContactsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDeleteCharactersCharacterIDContactsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteCharactersCharacterIDContactsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 420:
		result := NewDeleteCharactersCharacterIDContactsEnhanceYourCalm()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteCharactersCharacterIDContactsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewDeleteCharactersCharacterIDContactsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 504:
		result := NewDeleteCharactersCharacterIDContactsGatewayTimeout()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewDeleteCharactersCharacterIDContactsNoContent creates a DeleteCharactersCharacterIDContactsNoContent with default headers values
func NewDeleteCharactersCharacterIDContactsNoContent() *DeleteCharactersCharacterIDContactsNoContent {
	return &DeleteCharactersCharacterIDContactsNoContent{}
}

/* DeleteCharactersCharacterIDContactsNoContent describes a response with status code 204, with default header values.

Contacts deleted
*/
type DeleteCharactersCharacterIDContactsNoContent struct {
}

func (o *DeleteCharactersCharacterIDContactsNoContent) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsNoContent ", 204)
}

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

	return nil
}

// NewDeleteCharactersCharacterIDContactsBadRequest creates a DeleteCharactersCharacterIDContactsBadRequest with default headers values
func NewDeleteCharactersCharacterIDContactsBadRequest() *DeleteCharactersCharacterIDContactsBadRequest {
	return &DeleteCharactersCharacterIDContactsBadRequest{}
}

/* DeleteCharactersCharacterIDContactsBadRequest describes a response with status code 400, with default header values.

Bad request
*/
type DeleteCharactersCharacterIDContactsBadRequest struct {
	Payload *models.BadRequest
}

func (o *DeleteCharactersCharacterIDContactsBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsBadRequest  %+v", 400, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsBadRequest) GetPayload() *models.BadRequest {
	return o.Payload
}

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

	o.Payload = new(models.BadRequest)

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

	return nil
}

// NewDeleteCharactersCharacterIDContactsUnauthorized creates a DeleteCharactersCharacterIDContactsUnauthorized with default headers values
func NewDeleteCharactersCharacterIDContactsUnauthorized() *DeleteCharactersCharacterIDContactsUnauthorized {
	return &DeleteCharactersCharacterIDContactsUnauthorized{}
}

/* DeleteCharactersCharacterIDContactsUnauthorized describes a response with status code 401, with default header values.

Unauthorized
*/
type DeleteCharactersCharacterIDContactsUnauthorized struct {
	Payload *models.Unauthorized
}

func (o *DeleteCharactersCharacterIDContactsUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsUnauthorized  %+v", 401, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsUnauthorized) GetPayload() *models.Unauthorized {
	return o.Payload
}

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

	o.Payload = new(models.Unauthorized)

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

	return nil
}

// NewDeleteCharactersCharacterIDContactsForbidden creates a DeleteCharactersCharacterIDContactsForbidden with default headers values
func NewDeleteCharactersCharacterIDContactsForbidden() *DeleteCharactersCharacterIDContactsForbidden {
	return &DeleteCharactersCharacterIDContactsForbidden{}
}

/* DeleteCharactersCharacterIDContactsForbidden describes a response with status code 403, with default header values.

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

func (o *DeleteCharactersCharacterIDContactsForbidden) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsForbidden  %+v", 403, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsForbidden) GetPayload() *models.Forbidden {
	return o.Payload
}

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

// NewDeleteCharactersCharacterIDContactsEnhanceYourCalm creates a DeleteCharactersCharacterIDContactsEnhanceYourCalm with default headers values
func NewDeleteCharactersCharacterIDContactsEnhanceYourCalm() *DeleteCharactersCharacterIDContactsEnhanceYourCalm {
	return &DeleteCharactersCharacterIDContactsEnhanceYourCalm{}
}

/* DeleteCharactersCharacterIDContactsEnhanceYourCalm describes a response with status code 420, with default header values.

Error limited
*/
type DeleteCharactersCharacterIDContactsEnhanceYourCalm struct {
	Payload *models.ErrorLimited
}

func (o *DeleteCharactersCharacterIDContactsEnhanceYourCalm) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsEnhanceYourCalm  %+v", 420, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsEnhanceYourCalm) GetPayload() *models.ErrorLimited {
	return o.Payload
}

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

	o.Payload = new(models.ErrorLimited)

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

	return nil
}

// NewDeleteCharactersCharacterIDContactsInternalServerError creates a DeleteCharactersCharacterIDContactsInternalServerError with default headers values
func NewDeleteCharactersCharacterIDContactsInternalServerError() *DeleteCharactersCharacterIDContactsInternalServerError {
	return &DeleteCharactersCharacterIDContactsInternalServerError{}
}

/* DeleteCharactersCharacterIDContactsInternalServerError describes a response with status code 500, with default header values.

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

func (o *DeleteCharactersCharacterIDContactsInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsInternalServerError  %+v", 500, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsInternalServerError) GetPayload() *models.InternalServerError {
	return o.Payload
}

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

// NewDeleteCharactersCharacterIDContactsServiceUnavailable creates a DeleteCharactersCharacterIDContactsServiceUnavailable with default headers values
func NewDeleteCharactersCharacterIDContactsServiceUnavailable() *DeleteCharactersCharacterIDContactsServiceUnavailable {
	return &DeleteCharactersCharacterIDContactsServiceUnavailable{}
}

/* DeleteCharactersCharacterIDContactsServiceUnavailable describes a response with status code 503, with default header values.

Service unavailable
*/
type DeleteCharactersCharacterIDContactsServiceUnavailable struct {
	Payload *models.ServiceUnavailable
}

func (o *DeleteCharactersCharacterIDContactsServiceUnavailable) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsServiceUnavailable  %+v", 503, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsServiceUnavailable) GetPayload() *models.ServiceUnavailable {
	return o.Payload
}

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

	o.Payload = new(models.ServiceUnavailable)

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

	return nil
}

// NewDeleteCharactersCharacterIDContactsGatewayTimeout creates a DeleteCharactersCharacterIDContactsGatewayTimeout with default headers values
func NewDeleteCharactersCharacterIDContactsGatewayTimeout() *DeleteCharactersCharacterIDContactsGatewayTimeout {
	return &DeleteCharactersCharacterIDContactsGatewayTimeout{}
}

/* DeleteCharactersCharacterIDContactsGatewayTimeout describes a response with status code 504, with default header values.

Gateway timeout
*/
type DeleteCharactersCharacterIDContactsGatewayTimeout struct {
	Payload *models.GatewayTimeout
}

func (o *DeleteCharactersCharacterIDContactsGatewayTimeout) Error() string {
	return fmt.Sprintf("[DELETE /v2/characters/{character_id}/contacts/][%d] deleteCharactersCharacterIdContactsGatewayTimeout  %+v", 504, o.Payload)
}
func (o *DeleteCharactersCharacterIDContactsGatewayTimeout) GetPayload() *models.GatewayTimeout {
	return o.Payload
}

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

	o.Payload = new(models.GatewayTimeout)

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

	return nil
}
