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

// GetCoordinateBasicReader is a Reader for the GetCoordinateBasic structure.
type GetCoordinateBasicReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCoordinateBasicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCoordinateBasicOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCoordinateBasicUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCoordinateBasicForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCoordinateBasicNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCoordinateBasicUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCoordinateBasicInternalServerError()
		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())
	}
}

// NewGetCoordinateBasicOK creates a GetCoordinateBasicOK with default headers values
func NewGetCoordinateBasicOK() *GetCoordinateBasicOK {
	return &GetCoordinateBasicOK{}
}

/*GetCoordinateBasicOK handles this case with default header values.

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

	CacheControl string

	Payload *geo_models.CoordinateBasicResponse
}

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

func (o *GetCoordinateBasicOK) GetPayload() *geo_models.CoordinateBasicResponse {
	return o.Payload
}

func (o *GetCoordinateBasicOK) 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.CoordinateBasicResponse)

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

	return nil
}

// NewGetCoordinateBasicUnauthorized creates a GetCoordinateBasicUnauthorized with default headers values
func NewGetCoordinateBasicUnauthorized() *GetCoordinateBasicUnauthorized {
	return &GetCoordinateBasicUnauthorized{}
}

/*GetCoordinateBasicUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateBasicForbidden creates a GetCoordinateBasicForbidden with default headers values
func NewGetCoordinateBasicForbidden() *GetCoordinateBasicForbidden {
	return &GetCoordinateBasicForbidden{}
}

/*GetCoordinateBasicForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateBasicNotFound creates a GetCoordinateBasicNotFound with default headers values
func NewGetCoordinateBasicNotFound() *GetCoordinateBasicNotFound {
	return &GetCoordinateBasicNotFound{}
}

/*GetCoordinateBasicNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateBasicUnprocessableEntity creates a GetCoordinateBasicUnprocessableEntity with default headers values
func NewGetCoordinateBasicUnprocessableEntity() *GetCoordinateBasicUnprocessableEntity {
	return &GetCoordinateBasicUnprocessableEntity{}
}

/*GetCoordinateBasicUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetCoordinateBasicInternalServerError creates a GetCoordinateBasicInternalServerError with default headers values
func NewGetCoordinateBasicInternalServerError() *GetCoordinateBasicInternalServerError {
	return &GetCoordinateBasicInternalServerError{}
}

/*GetCoordinateBasicInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetCoordinateBasicInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

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

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

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