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

// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package app_log

// 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/taxnexus/go/lib/api/workflow/workflow_models"
)

// PostAppLogsReader is a Reader for the PostAppLogs structure.
type PostAppLogsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostAppLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostAppLogsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostAppLogsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostAppLogsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostAppLogsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostAppLogsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostAppLogsInternalServerError()
		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())
	}
}

// NewPostAppLogsOK creates a PostAppLogsOK with default headers values
func NewPostAppLogsOK() *PostAppLogsOK {
	return &PostAppLogsOK{}
}

/*PostAppLogsOK handles this case with default header values.

Array of AppLogs
*/
type PostAppLogsOK struct {
	AccessControlAllowOrigin string

	Payload *workflow_models.AppLogResponse
}

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

func (o *PostAppLogsOK) GetPayload() *workflow_models.AppLogResponse {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.AppLogResponse)

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

	return nil
}

// NewPostAppLogsUnauthorized creates a PostAppLogsUnauthorized with default headers values
func NewPostAppLogsUnauthorized() *PostAppLogsUnauthorized {
	return &PostAppLogsUnauthorized{}
}

/*PostAppLogsUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type PostAppLogsUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *workflow_models.Error
}

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

func (o *PostAppLogsUnauthorized) GetPayload() *workflow_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.Error)

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

	return nil
}

// NewPostAppLogsForbidden creates a PostAppLogsForbidden with default headers values
func NewPostAppLogsForbidden() *PostAppLogsForbidden {
	return &PostAppLogsForbidden{}
}

/*PostAppLogsForbidden handles this case with default header values.

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

	Payload *workflow_models.Error
}

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

func (o *PostAppLogsForbidden) GetPayload() *workflow_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.Error)

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

	return nil
}

// NewPostAppLogsNotFound creates a PostAppLogsNotFound with default headers values
func NewPostAppLogsNotFound() *PostAppLogsNotFound {
	return &PostAppLogsNotFound{}
}

/*PostAppLogsNotFound handles this case with default header values.

Resource was not found
*/
type PostAppLogsNotFound struct {
	AccessControlAllowOrigin string

	Payload *workflow_models.Error
}

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

func (o *PostAppLogsNotFound) GetPayload() *workflow_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.Error)

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

	return nil
}

// NewPostAppLogsUnprocessableEntity creates a PostAppLogsUnprocessableEntity with default headers values
func NewPostAppLogsUnprocessableEntity() *PostAppLogsUnprocessableEntity {
	return &PostAppLogsUnprocessableEntity{}
}

/*PostAppLogsUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type PostAppLogsUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *workflow_models.Error
}

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

func (o *PostAppLogsUnprocessableEntity) GetPayload() *workflow_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.Error)

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

	return nil
}

// NewPostAppLogsInternalServerError creates a PostAppLogsInternalServerError with default headers values
func NewPostAppLogsInternalServerError() *PostAppLogsInternalServerError {
	return &PostAppLogsInternalServerError{}
}

/*PostAppLogsInternalServerError handles this case with default header values.

Server Internal Error
*/
type PostAppLogsInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *workflow_models.Error
}

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

func (o *PostAppLogsInternalServerError) GetPayload() *workflow_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(workflow_models.Error)

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

	return nil
}
