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

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

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

// PostCharactersCharacterIDContactsReader is a Reader for the PostCharactersCharacterIDContacts structure.
type PostCharactersCharacterIDContactsReader struct {
	formats strfmt.Registry
}

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

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

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

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

// NewPostCharactersCharacterIDContactsCreated creates a PostCharactersCharacterIDContactsCreated with default headers values
func NewPostCharactersCharacterIDContactsCreated() *PostCharactersCharacterIDContactsCreated {
	return &PostCharactersCharacterIDContactsCreated{}
}

/*PostCharactersCharacterIDContactsCreated handles this case with default header values.

A list of contact ids that successfully created
*/
type PostCharactersCharacterIDContactsCreated struct {
	Payload []int32
}

func (o *PostCharactersCharacterIDContactsCreated) Error() string {
	return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsCreated  %+v", 201, o.Payload)
}

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

// NewPostCharactersCharacterIDContactsForbidden creates a PostCharactersCharacterIDContactsForbidden with default headers values
func NewPostCharactersCharacterIDContactsForbidden() *PostCharactersCharacterIDContactsForbidden {
	return &PostCharactersCharacterIDContactsForbidden{}
}

/*PostCharactersCharacterIDContactsForbidden handles this case with default header values.

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

func (o *PostCharactersCharacterIDContactsForbidden) Error() string {
	return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsForbidden  %+v", 403, o.Payload)
}

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

// NewPostCharactersCharacterIDContactsInternalServerError creates a PostCharactersCharacterIDContactsInternalServerError with default headers values
func NewPostCharactersCharacterIDContactsInternalServerError() *PostCharactersCharacterIDContactsInternalServerError {
	return &PostCharactersCharacterIDContactsInternalServerError{}
}

/*PostCharactersCharacterIDContactsInternalServerError handles this case with default header values.

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

func (o *PostCharactersCharacterIDContactsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsInternalServerError  %+v", 500, o.Payload)
}

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