// Code generated by go-swagger; DO NOT EDIT.

package operations

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/fiskerinc/cloud-services/pkg/ota_api/models"
)

// GetDashboardEmbeddedDashboardsReader is a Reader for the GetDashboardEmbeddedDashboards structure.
type GetDashboardEmbeddedDashboardsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetDashboardEmbeddedDashboardsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 301:
		result := NewGetDashboardEmbeddedDashboardsMovedPermanently()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetDashboardEmbeddedDashboardsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetDashboardEmbeddedDashboardsServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /dashboard/embedded-dashboards] GetDashboardEmbeddedDashboards", response, response.Code())
	}
}

// NewGetDashboardEmbeddedDashboardsMovedPermanently creates a GetDashboardEmbeddedDashboardsMovedPermanently with default headers values
func NewGetDashboardEmbeddedDashboardsMovedPermanently() *GetDashboardEmbeddedDashboardsMovedPermanently {
	return &GetDashboardEmbeddedDashboardsMovedPermanently{}
}

/*
GetDashboardEmbeddedDashboardsMovedPermanently describes a response with status code 301, with default header values.

Moved Permanently
*/
type GetDashboardEmbeddedDashboardsMovedPermanently struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get dashboard embedded dashboards moved permanently response has a 2xx status code
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard embedded dashboards moved permanently response has a 3xx status code
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) IsRedirect() bool {
	return true
}

// IsClientError returns true when this get dashboard embedded dashboards moved permanently response has a 4xx status code
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) IsClientError() bool {
	return false
}

// IsServerError returns true when this get dashboard embedded dashboards moved permanently response has a 5xx status code
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard embedded dashboards moved permanently response a status code equal to that given
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) IsCode(code int) bool {
	return code == 301
}

// Code gets the status code for the get dashboard embedded dashboards moved permanently response
func (o *GetDashboardEmbeddedDashboardsMovedPermanently) Code() int {
	return 301
}

func (o *GetDashboardEmbeddedDashboardsMovedPermanently) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsMovedPermanently %s", 301, payload)
}

func (o *GetDashboardEmbeddedDashboardsMovedPermanently) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsMovedPermanently %s", 301, payload)
}

func (o *GetDashboardEmbeddedDashboardsMovedPermanently) GetPayload() *models.CommonJSONError {
	return o.Payload
}

func (o *GetDashboardEmbeddedDashboardsMovedPermanently) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.CommonJSONError)

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

	return nil
}

// NewGetDashboardEmbeddedDashboardsUnauthorized creates a GetDashboardEmbeddedDashboardsUnauthorized with default headers values
func NewGetDashboardEmbeddedDashboardsUnauthorized() *GetDashboardEmbeddedDashboardsUnauthorized {
	return &GetDashboardEmbeddedDashboardsUnauthorized{}
}

/*
GetDashboardEmbeddedDashboardsUnauthorized describes a response with status code 401, with default header values.

Unauthorized
*/
type GetDashboardEmbeddedDashboardsUnauthorized struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get dashboard embedded dashboards unauthorized response has a 2xx status code
func (o *GetDashboardEmbeddedDashboardsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard embedded dashboards unauthorized response has a 3xx status code
func (o *GetDashboardEmbeddedDashboardsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard embedded dashboards unauthorized response has a 4xx status code
func (o *GetDashboardEmbeddedDashboardsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get dashboard embedded dashboards unauthorized response has a 5xx status code
func (o *GetDashboardEmbeddedDashboardsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard embedded dashboards unauthorized response a status code equal to that given
func (o *GetDashboardEmbeddedDashboardsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get dashboard embedded dashboards unauthorized response
func (o *GetDashboardEmbeddedDashboardsUnauthorized) Code() int {
	return 401
}

func (o *GetDashboardEmbeddedDashboardsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsUnauthorized %s", 401, payload)
}

func (o *GetDashboardEmbeddedDashboardsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsUnauthorized %s", 401, payload)
}

func (o *GetDashboardEmbeddedDashboardsUnauthorized) GetPayload() *models.CommonJSONError {
	return o.Payload
}

func (o *GetDashboardEmbeddedDashboardsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.CommonJSONError)

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

	return nil
}

// NewGetDashboardEmbeddedDashboardsServiceUnavailable creates a GetDashboardEmbeddedDashboardsServiceUnavailable with default headers values
func NewGetDashboardEmbeddedDashboardsServiceUnavailable() *GetDashboardEmbeddedDashboardsServiceUnavailable {
	return &GetDashboardEmbeddedDashboardsServiceUnavailable{}
}

/*
GetDashboardEmbeddedDashboardsServiceUnavailable describes a response with status code 503, with default header values.

Service unavailable
*/
type GetDashboardEmbeddedDashboardsServiceUnavailable struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get dashboard embedded dashboards service unavailable response has a 2xx status code
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get dashboard embedded dashboards service unavailable response has a 3xx status code
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard embedded dashboards service unavailable response has a 4xx status code
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get dashboard embedded dashboards service unavailable response has a 5xx status code
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get dashboard embedded dashboards service unavailable response a status code equal to that given
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the get dashboard embedded dashboards service unavailable response
func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) Code() int {
	return 503
}

func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsServiceUnavailable %s", 503, payload)
}

func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/embedded-dashboards][%d] getDashboardEmbeddedDashboardsServiceUnavailable %s", 503, payload)
}

func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) GetPayload() *models.CommonJSONError {
	return o.Payload
}

func (o *GetDashboardEmbeddedDashboardsServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.CommonJSONError)

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

	return nil
}
