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

// GetDashboardGuestTokenReader is a Reader for the GetDashboardGuestToken structure.
type GetDashboardGuestTokenReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetDashboardGuestTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetDashboardGuestTokenOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetDashboardGuestTokenUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetDashboardGuestTokenServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /dashboard/guest-token] GetDashboardGuestToken", response, response.Code())
	}
}

// NewGetDashboardGuestTokenOK creates a GetDashboardGuestTokenOK with default headers values
func NewGetDashboardGuestTokenOK() *GetDashboardGuestTokenOK {
	return &GetDashboardGuestTokenOK{}
}

/*
GetDashboardGuestTokenOK describes a response with status code 200, with default header values.

OK
*/
type GetDashboardGuestTokenOK struct {
	Payload *models.HandlersGuestTokenResp
}

// IsSuccess returns true when this get dashboard guest token o k response has a 2xx status code
func (o *GetDashboardGuestTokenOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get dashboard guest token o k response has a 3xx status code
func (o *GetDashboardGuestTokenOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get dashboard guest token o k response has a 4xx status code
func (o *GetDashboardGuestTokenOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get dashboard guest token o k response has a 5xx status code
func (o *GetDashboardGuestTokenOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get dashboard guest token o k response a status code equal to that given
func (o *GetDashboardGuestTokenOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get dashboard guest token o k response
func (o *GetDashboardGuestTokenOK) Code() int {
	return 200
}

func (o *GetDashboardGuestTokenOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/guest-token][%d] getDashboardGuestTokenOK %s", 200, payload)
}

func (o *GetDashboardGuestTokenOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /dashboard/guest-token][%d] getDashboardGuestTokenOK %s", 200, payload)
}

func (o *GetDashboardGuestTokenOK) GetPayload() *models.HandlersGuestTokenResp {
	return o.Payload
}

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

	o.Payload = new(models.HandlersGuestTokenResp)

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

	return nil
}

// NewGetDashboardGuestTokenUnauthorized creates a GetDashboardGuestTokenUnauthorized with default headers values
func NewGetDashboardGuestTokenUnauthorized() *GetDashboardGuestTokenUnauthorized {
	return &GetDashboardGuestTokenUnauthorized{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get dashboard guest token unauthorized response
func (o *GetDashboardGuestTokenUnauthorized) Code() int {
	return 401
}

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

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

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

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

// NewGetDashboardGuestTokenServiceUnavailable creates a GetDashboardGuestTokenServiceUnavailable with default headers values
func NewGetDashboardGuestTokenServiceUnavailable() *GetDashboardGuestTokenServiceUnavailable {
	return &GetDashboardGuestTokenServiceUnavailable{}
}

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

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

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

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

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

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

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

// Code gets the status code for the get dashboard guest token service unavailable response
func (o *GetDashboardGuestTokenServiceUnavailable) Code() int {
	return 503
}

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

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

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

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