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

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package emails

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

	"code.tnxs.net/work/lib/api/members/members_models"
)

// PostOutgoingEmailMessagesReader is a Reader for the PostOutgoingEmailMessages structure.
type PostOutgoingEmailMessagesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostOutgoingEmailMessagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostOutgoingEmailMessagesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostOutgoingEmailMessagesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostOutgoingEmailMessagesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostOutgoingEmailMessagesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostOutgoingEmailMessagesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostOutgoingEmailMessagesInternalServerError()
		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())
	}
}

// NewPostOutgoingEmailMessagesOK creates a PostOutgoingEmailMessagesOK with default headers values
func NewPostOutgoingEmailMessagesOK() *PostOutgoingEmailMessagesOK {
	return &PostOutgoingEmailMessagesOK{}
}

/*
PostOutgoingEmailMessagesOK describes a response with status code 200, with default header values.

Array of Outgoing Email Messages
*/
type PostOutgoingEmailMessagesOK struct {
	Payload *members_models.OutgoingEmailMessagesResponse
}

// IsSuccess returns true when this post outgoing email messages o k response has a 2xx status code
func (o *PostOutgoingEmailMessagesOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this post outgoing email messages o k response has a 3xx status code
func (o *PostOutgoingEmailMessagesOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages o k response has a 4xx status code
func (o *PostOutgoingEmailMessagesOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this post outgoing email messages o k response has a 5xx status code
func (o *PostOutgoingEmailMessagesOK) IsServerError() bool {
	return false
}

// IsCode returns true when this post outgoing email messages o k response a status code equal to that given
func (o *PostOutgoingEmailMessagesOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the post outgoing email messages o k response
func (o *PostOutgoingEmailMessagesOK) Code() int {
	return 200
}

func (o *PostOutgoingEmailMessagesOK) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesOK  %+v", 200, o.Payload)
}

func (o *PostOutgoingEmailMessagesOK) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesOK  %+v", 200, o.Payload)
}

func (o *PostOutgoingEmailMessagesOK) GetPayload() *members_models.OutgoingEmailMessagesResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.OutgoingEmailMessagesResponse)

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

	return nil
}

// NewPostOutgoingEmailMessagesUnauthorized creates a PostOutgoingEmailMessagesUnauthorized with default headers values
func NewPostOutgoingEmailMessagesUnauthorized() *PostOutgoingEmailMessagesUnauthorized {
	return &PostOutgoingEmailMessagesUnauthorized{}
}

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

Access Unauthorized, invalid API-KEY was used
*/
type PostOutgoingEmailMessagesUnauthorized struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this post outgoing email messages unauthorized response has a 2xx status code
func (o *PostOutgoingEmailMessagesUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post outgoing email messages unauthorized response has a 3xx status code
func (o *PostOutgoingEmailMessagesUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages unauthorized response has a 4xx status code
func (o *PostOutgoingEmailMessagesUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this post outgoing email messages unauthorized response has a 5xx status code
func (o *PostOutgoingEmailMessagesUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this post outgoing email messages unauthorized response a status code equal to that given
func (o *PostOutgoingEmailMessagesUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the post outgoing email messages unauthorized response
func (o *PostOutgoingEmailMessagesUnauthorized) Code() int {
	return 401
}

func (o *PostOutgoingEmailMessagesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnauthorized  %+v", 401, o.Payload)
}

func (o *PostOutgoingEmailMessagesUnauthorized) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnauthorized  %+v", 401, o.Payload)
}

func (o *PostOutgoingEmailMessagesUnauthorized) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPostOutgoingEmailMessagesForbidden creates a PostOutgoingEmailMessagesForbidden with default headers values
func NewPostOutgoingEmailMessagesForbidden() *PostOutgoingEmailMessagesForbidden {
	return &PostOutgoingEmailMessagesForbidden{}
}

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

Access forbidden, account lacks access
*/
type PostOutgoingEmailMessagesForbidden struct {
	AccessControlAllowOrigin string

	Payload *members_models.Error
}

// IsSuccess returns true when this post outgoing email messages forbidden response has a 2xx status code
func (o *PostOutgoingEmailMessagesForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post outgoing email messages forbidden response has a 3xx status code
func (o *PostOutgoingEmailMessagesForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages forbidden response has a 4xx status code
func (o *PostOutgoingEmailMessagesForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this post outgoing email messages forbidden response has a 5xx status code
func (o *PostOutgoingEmailMessagesForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this post outgoing email messages forbidden response a status code equal to that given
func (o *PostOutgoingEmailMessagesForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the post outgoing email messages forbidden response
func (o *PostOutgoingEmailMessagesForbidden) Code() int {
	return 403
}

func (o *PostOutgoingEmailMessagesForbidden) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesForbidden  %+v", 403, o.Payload)
}

func (o *PostOutgoingEmailMessagesForbidden) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesForbidden  %+v", 403, o.Payload)
}

func (o *PostOutgoingEmailMessagesForbidden) GetPayload() *members_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPostOutgoingEmailMessagesNotFound creates a PostOutgoingEmailMessagesNotFound with default headers values
func NewPostOutgoingEmailMessagesNotFound() *PostOutgoingEmailMessagesNotFound {
	return &PostOutgoingEmailMessagesNotFound{}
}

/*
PostOutgoingEmailMessagesNotFound describes a response with status code 404, with default header values.

Resource was not found
*/
type PostOutgoingEmailMessagesNotFound struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this post outgoing email messages not found response has a 2xx status code
func (o *PostOutgoingEmailMessagesNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post outgoing email messages not found response has a 3xx status code
func (o *PostOutgoingEmailMessagesNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages not found response has a 4xx status code
func (o *PostOutgoingEmailMessagesNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this post outgoing email messages not found response has a 5xx status code
func (o *PostOutgoingEmailMessagesNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this post outgoing email messages not found response a status code equal to that given
func (o *PostOutgoingEmailMessagesNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the post outgoing email messages not found response
func (o *PostOutgoingEmailMessagesNotFound) Code() int {
	return 404
}

func (o *PostOutgoingEmailMessagesNotFound) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesNotFound  %+v", 404, o.Payload)
}

func (o *PostOutgoingEmailMessagesNotFound) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesNotFound  %+v", 404, o.Payload)
}

func (o *PostOutgoingEmailMessagesNotFound) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPostOutgoingEmailMessagesUnprocessableEntity creates a PostOutgoingEmailMessagesUnprocessableEntity with default headers values
func NewPostOutgoingEmailMessagesUnprocessableEntity() *PostOutgoingEmailMessagesUnprocessableEntity {
	return &PostOutgoingEmailMessagesUnprocessableEntity{}
}

/*
PostOutgoingEmailMessagesUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity, likely a bad parameter
*/
type PostOutgoingEmailMessagesUnprocessableEntity struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this post outgoing email messages unprocessable entity response has a 2xx status code
func (o *PostOutgoingEmailMessagesUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post outgoing email messages unprocessable entity response has a 3xx status code
func (o *PostOutgoingEmailMessagesUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages unprocessable entity response has a 4xx status code
func (o *PostOutgoingEmailMessagesUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this post outgoing email messages unprocessable entity response has a 5xx status code
func (o *PostOutgoingEmailMessagesUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this post outgoing email messages unprocessable entity response a status code equal to that given
func (o *PostOutgoingEmailMessagesUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the post outgoing email messages unprocessable entity response
func (o *PostOutgoingEmailMessagesUnprocessableEntity) Code() int {
	return 422
}

func (o *PostOutgoingEmailMessagesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostOutgoingEmailMessagesUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostOutgoingEmailMessagesUnprocessableEntity) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPostOutgoingEmailMessagesInternalServerError creates a PostOutgoingEmailMessagesInternalServerError with default headers values
func NewPostOutgoingEmailMessagesInternalServerError() *PostOutgoingEmailMessagesInternalServerError {
	return &PostOutgoingEmailMessagesInternalServerError{}
}

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

Server Internal Error
*/
type PostOutgoingEmailMessagesInternalServerError struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this post outgoing email messages internal server error response has a 2xx status code
func (o *PostOutgoingEmailMessagesInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post outgoing email messages internal server error response has a 3xx status code
func (o *PostOutgoingEmailMessagesInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post outgoing email messages internal server error response has a 4xx status code
func (o *PostOutgoingEmailMessagesInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this post outgoing email messages internal server error response has a 5xx status code
func (o *PostOutgoingEmailMessagesInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this post outgoing email messages internal server error response a status code equal to that given
func (o *PostOutgoingEmailMessagesInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the post outgoing email messages internal server error response
func (o *PostOutgoingEmailMessagesInternalServerError) Code() int {
	return 500
}

func (o *PostOutgoingEmailMessagesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesInternalServerError  %+v", 500, o.Payload)
}

func (o *PostOutgoingEmailMessagesInternalServerError) String() string {
	return fmt.Sprintf("[POST /outgoingemailmessages][%d] postOutgoingEmailMessagesInternalServerError  %+v", 500, o.Payload)
}

func (o *PostOutgoingEmailMessagesInternalServerError) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}
