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

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

// GetDomainObservableReader is a Reader for the GetDomainObservable structure.
type GetDomainObservableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetDomainObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetDomainObservableOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetDomainObservableUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetDomainObservableForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetDomainObservableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetDomainObservableUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetDomainObservableInternalServerError()
		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())
	}
}

// NewGetDomainObservableOK creates a GetDomainObservableOK with default headers values
func NewGetDomainObservableOK() *GetDomainObservableOK {
	return &GetDomainObservableOK{}
}

/*GetDomainObservableOK handles this case with default header values.

Observable array response to a domain retrieval
*/
type GetDomainObservableOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload []*geo_models.Domain
}

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

func (o *GetDomainObservableOK) GetPayload() []*geo_models.Domain {
	return o.Payload
}

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

// NewGetDomainObservableUnauthorized creates a GetDomainObservableUnauthorized with default headers values
func NewGetDomainObservableUnauthorized() *GetDomainObservableUnauthorized {
	return &GetDomainObservableUnauthorized{}
}

/*GetDomainObservableUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetDomainObservableForbidden creates a GetDomainObservableForbidden with default headers values
func NewGetDomainObservableForbidden() *GetDomainObservableForbidden {
	return &GetDomainObservableForbidden{}
}

/*GetDomainObservableForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetDomainObservableNotFound creates a GetDomainObservableNotFound with default headers values
func NewGetDomainObservableNotFound() *GetDomainObservableNotFound {
	return &GetDomainObservableNotFound{}
}

/*GetDomainObservableNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetDomainObservableUnprocessableEntity creates a GetDomainObservableUnprocessableEntity with default headers values
func NewGetDomainObservableUnprocessableEntity() *GetDomainObservableUnprocessableEntity {
	return &GetDomainObservableUnprocessableEntity{}
}

/*GetDomainObservableUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetDomainObservableInternalServerError creates a GetDomainObservableInternalServerError with default headers values
func NewGetDomainObservableInternalServerError() *GetDomainObservableInternalServerError {
	return &GetDomainObservableInternalServerError{}
}

/*GetDomainObservableInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetDomainObservableInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

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

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

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