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

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

// DeleteCoordinateReader is a Reader for the DeleteCoordinate structure.
type DeleteCoordinateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteCoordinateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteCoordinateOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteCoordinateUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteCoordinateForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteCoordinateNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteCoordinateUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteCoordinateInternalServerError()
		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())
	}
}

// NewDeleteCoordinateOK creates a DeleteCoordinateOK with default headers values
func NewDeleteCoordinateOK() *DeleteCoordinateOK {
	return &DeleteCoordinateOK{}
}

/*DeleteCoordinateOK handles this case with default header values.

Taxnexus Response with Message Objects with Delete Status
*/
type DeleteCoordinateOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *geo_models.DeleteResponse
}

func (o *DeleteCoordinateOK) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateOK  %+v", 200, o.Payload)
}

func (o *DeleteCoordinateOK) GetPayload() *geo_models.DeleteResponse {
	return o.Payload
}

func (o *DeleteCoordinateOK) 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")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(geo_models.DeleteResponse)

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

	return nil
}

// NewDeleteCoordinateUnauthorized creates a DeleteCoordinateUnauthorized with default headers values
func NewDeleteCoordinateUnauthorized() *DeleteCoordinateUnauthorized {
	return &DeleteCoordinateUnauthorized{}
}

/*DeleteCoordinateUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type DeleteCoordinateUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

func (o *DeleteCoordinateUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateUnauthorized  %+v", 401, o.Payload)
}

func (o *DeleteCoordinateUnauthorized) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *DeleteCoordinateUnauthorized) 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(geo_models.Error)

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

	return nil
}

// NewDeleteCoordinateForbidden creates a DeleteCoordinateForbidden with default headers values
func NewDeleteCoordinateForbidden() *DeleteCoordinateForbidden {
	return &DeleteCoordinateForbidden{}
}

/*DeleteCoordinateForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *DeleteCoordinateForbidden) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateForbidden  %+v", 403, o.Payload)
}

func (o *DeleteCoordinateForbidden) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *DeleteCoordinateForbidden) 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(geo_models.Error)

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

	return nil
}

// NewDeleteCoordinateNotFound creates a DeleteCoordinateNotFound with default headers values
func NewDeleteCoordinateNotFound() *DeleteCoordinateNotFound {
	return &DeleteCoordinateNotFound{}
}

/*DeleteCoordinateNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *DeleteCoordinateNotFound) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateNotFound  %+v", 404, o.Payload)
}

func (o *DeleteCoordinateNotFound) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *DeleteCoordinateNotFound) 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(geo_models.Error)

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

	return nil
}

// NewDeleteCoordinateUnprocessableEntity creates a DeleteCoordinateUnprocessableEntity with default headers values
func NewDeleteCoordinateUnprocessableEntity() *DeleteCoordinateUnprocessableEntity {
	return &DeleteCoordinateUnprocessableEntity{}
}

/*DeleteCoordinateUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *DeleteCoordinateUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *DeleteCoordinateUnprocessableEntity) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *DeleteCoordinateUnprocessableEntity) 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(geo_models.Error)

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

	return nil
}

// NewDeleteCoordinateInternalServerError creates a DeleteCoordinateInternalServerError with default headers values
func NewDeleteCoordinateInternalServerError() *DeleteCoordinateInternalServerError {
	return &DeleteCoordinateInternalServerError{}
}

/*DeleteCoordinateInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeleteCoordinateInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

func (o *DeleteCoordinateInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateInternalServerError  %+v", 500, o.Payload)
}

func (o *DeleteCoordinateInternalServerError) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *DeleteCoordinateInternalServerError) 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(geo_models.Error)

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

	return nil
}
