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

package user_interface

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

// PostUIOpenwindowNewmailReader is a Reader for the PostUIOpenwindowNewmail structure.
type PostUIOpenwindowNewmailReader struct {
	formats strfmt.Registry
}

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

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

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

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

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

// NewPostUIOpenwindowNewmailNoContent creates a PostUIOpenwindowNewmailNoContent with default headers values
func NewPostUIOpenwindowNewmailNoContent() *PostUIOpenwindowNewmailNoContent {
	return &PostUIOpenwindowNewmailNoContent{}
}

/*PostUIOpenwindowNewmailNoContent handles this case with default header values.

Open window request received
*/
type PostUIOpenwindowNewmailNoContent struct {
}

func (o *PostUIOpenwindowNewmailNoContent) Error() string {
	return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailNoContent ", 204)
}

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

	return nil
}

// NewPostUIOpenwindowNewmailForbidden creates a PostUIOpenwindowNewmailForbidden with default headers values
func NewPostUIOpenwindowNewmailForbidden() *PostUIOpenwindowNewmailForbidden {
	return &PostUIOpenwindowNewmailForbidden{}
}

/*PostUIOpenwindowNewmailForbidden handles this case with default header values.

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

func (o *PostUIOpenwindowNewmailForbidden) Error() string {
	return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailForbidden  %+v", 403, o.Payload)
}

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

// NewPostUIOpenwindowNewmailUnprocessableEntity creates a PostUIOpenwindowNewmailUnprocessableEntity with default headers values
func NewPostUIOpenwindowNewmailUnprocessableEntity() *PostUIOpenwindowNewmailUnprocessableEntity {
	return &PostUIOpenwindowNewmailUnprocessableEntity{}
}

/*PostUIOpenwindowNewmailUnprocessableEntity handles this case with default header values.

Invalid request
*/
type PostUIOpenwindowNewmailUnprocessableEntity struct {
	Payload *models.PostUIOpenwindowNewmailUnprocessableEntityBody
}

func (o *PostUIOpenwindowNewmailUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailUnprocessableEntity  %+v", 422, o.Payload)
}

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

	o.Payload = new(models.PostUIOpenwindowNewmailUnprocessableEntityBody)

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

	return nil
}

// NewPostUIOpenwindowNewmailInternalServerError creates a PostUIOpenwindowNewmailInternalServerError with default headers values
func NewPostUIOpenwindowNewmailInternalServerError() *PostUIOpenwindowNewmailInternalServerError {
	return &PostUIOpenwindowNewmailInternalServerError{}
}

/*PostUIOpenwindowNewmailInternalServerError handles this case with default header values.

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

func (o *PostUIOpenwindowNewmailInternalServerError) Error() string {
	return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailInternalServerError  %+v", 500, o.Payload)
}

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