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

// GetCoordinateObservableReader is a Reader for the GetCoordinateObservable structure.
type GetCoordinateObservableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCoordinateObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCoordinateObservableOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCoordinateObservableUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCoordinateObservableForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCoordinateObservableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCoordinateObservableUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCoordinateObservableInternalServerError()
		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())
	}
}

// NewGetCoordinateObservableOK creates a GetCoordinateObservableOK with default headers values
func NewGetCoordinateObservableOK() *GetCoordinateObservableOK {
	return &GetCoordinateObservableOK{}
}

/*GetCoordinateObservableOK handles this case with default header values.

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

	CacheControl string

	Payload []*geo_models.Coordinate
}

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

func (o *GetCoordinateObservableOK) GetPayload() []*geo_models.Coordinate {
	return o.Payload
}

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

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

	return nil
}

// NewGetCoordinateObservableUnauthorized creates a GetCoordinateObservableUnauthorized with default headers values
func NewGetCoordinateObservableUnauthorized() *GetCoordinateObservableUnauthorized {
	return &GetCoordinateObservableUnauthorized{}
}

/*GetCoordinateObservableUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateObservableForbidden creates a GetCoordinateObservableForbidden with default headers values
func NewGetCoordinateObservableForbidden() *GetCoordinateObservableForbidden {
	return &GetCoordinateObservableForbidden{}
}

/*GetCoordinateObservableForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateObservableNotFound creates a GetCoordinateObservableNotFound with default headers values
func NewGetCoordinateObservableNotFound() *GetCoordinateObservableNotFound {
	return &GetCoordinateObservableNotFound{}
}

/*GetCoordinateObservableNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateObservableUnprocessableEntity creates a GetCoordinateObservableUnprocessableEntity with default headers values
func NewGetCoordinateObservableUnprocessableEntity() *GetCoordinateObservableUnprocessableEntity {
	return &GetCoordinateObservableUnprocessableEntity{}
}

/*GetCoordinateObservableUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateObservableInternalServerError creates a GetCoordinateObservableInternalServerError with default headers values
func NewGetCoordinateObservableInternalServerError() *GetCoordinateObservableInternalServerError {
	return &GetCoordinateObservableInternalServerError{}
}

/*GetCoordinateObservableInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetCoordinateObservableInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

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

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

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