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

// GetCoordinatesReader is a Reader for the GetCoordinates structure.
type GetCoordinatesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCoordinatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCoordinatesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCoordinatesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCoordinatesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCoordinatesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCoordinatesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCoordinatesInternalServerError()
		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())
	}
}

// NewGetCoordinatesOK creates a GetCoordinatesOK with default headers values
func NewGetCoordinatesOK() *GetCoordinatesOK {
	return &GetCoordinatesOK{}
}

/*GetCoordinatesOK handles this case with default header values.

Taxnexus Response with an array of Coordinate objects
*/
type GetCoordinatesOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *geo_models.CoordinateResponse
}

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

func (o *GetCoordinatesOK) GetPayload() *geo_models.CoordinateResponse {
	return o.Payload
}

func (o *GetCoordinatesOK) 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.CoordinateResponse)

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

	return nil
}

// NewGetCoordinatesUnauthorized creates a GetCoordinatesUnauthorized with default headers values
func NewGetCoordinatesUnauthorized() *GetCoordinatesUnauthorized {
	return &GetCoordinatesUnauthorized{}
}

/*GetCoordinatesUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinatesForbidden creates a GetCoordinatesForbidden with default headers values
func NewGetCoordinatesForbidden() *GetCoordinatesForbidden {
	return &GetCoordinatesForbidden{}
}

/*GetCoordinatesForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinatesNotFound creates a GetCoordinatesNotFound with default headers values
func NewGetCoordinatesNotFound() *GetCoordinatesNotFound {
	return &GetCoordinatesNotFound{}
}

/*GetCoordinatesNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinatesUnprocessableEntity creates a GetCoordinatesUnprocessableEntity with default headers values
func NewGetCoordinatesUnprocessableEntity() *GetCoordinatesUnprocessableEntity {
	return &GetCoordinatesUnprocessableEntity{}
}

/*GetCoordinatesUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinatesInternalServerError creates a GetCoordinatesInternalServerError with default headers values
func NewGetCoordinatesInternalServerError() *GetCoordinatesInternalServerError {
	return &GetCoordinatesInternalServerError{}
}

/*GetCoordinatesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetCoordinatesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

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

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

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