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

// GetCanSignalsExportReader is a Reader for the GetCanSignalsExport structure.
type GetCanSignalsExportReader struct {
	formats strfmt.Registry
	writer  io.Writer
}

// ReadResponse reads a server response into the received o.
func (o *GetCanSignalsExportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCanSignalsExportOK(o.writer)
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetCanSignalsExportBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetCanSignalsExportUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetCanSignalsExportServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /can_signals_export] GetCanSignalsExport", response, response.Code())
	}
}

// NewGetCanSignalsExportOK creates a GetCanSignalsExportOK with default headers values
func NewGetCanSignalsExportOK(writer io.Writer) *GetCanSignalsExportOK {
	return &GetCanSignalsExportOK{

		Payload: writer,
	}
}

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

OK
*/
type GetCanSignalsExportOK struct {
	Payload io.Writer
}

// IsSuccess returns true when this get can signals export o k response has a 2xx status code
func (o *GetCanSignalsExportOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get can signals export o k response has a 3xx status code
func (o *GetCanSignalsExportOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get can signals export o k response has a 4xx status code
func (o *GetCanSignalsExportOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get can signals export o k response has a 5xx status code
func (o *GetCanSignalsExportOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get can signals export o k response a status code equal to that given
func (o *GetCanSignalsExportOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get can signals export o k response
func (o *GetCanSignalsExportOK) Code() int {
	return 200
}

func (o *GetCanSignalsExportOK) Error() string {
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportOK", 200)
}

func (o *GetCanSignalsExportOK) String() string {
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportOK", 200)
}

func (o *GetCanSignalsExportOK) GetPayload() io.Writer {
	return o.Payload
}

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

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

	return nil
}

// NewGetCanSignalsExportBadRequest creates a GetCanSignalsExportBadRequest with default headers values
func NewGetCanSignalsExportBadRequest() *GetCanSignalsExportBadRequest {
	return &GetCanSignalsExportBadRequest{}
}

/*
GetCanSignalsExportBadRequest describes a response with status code 400, with default header values.

Bad request
*/
type GetCanSignalsExportBadRequest struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get can signals export bad request response has a 2xx status code
func (o *GetCanSignalsExportBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get can signals export bad request response has a 3xx status code
func (o *GetCanSignalsExportBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get can signals export bad request response has a 4xx status code
func (o *GetCanSignalsExportBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get can signals export bad request response has a 5xx status code
func (o *GetCanSignalsExportBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this get can signals export bad request response a status code equal to that given
func (o *GetCanSignalsExportBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the get can signals export bad request response
func (o *GetCanSignalsExportBadRequest) Code() int {
	return 400
}

func (o *GetCanSignalsExportBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportBadRequest %s", 400, payload)
}

func (o *GetCanSignalsExportBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportBadRequest %s", 400, payload)
}

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

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

// NewGetCanSignalsExportUnauthorized creates a GetCanSignalsExportUnauthorized with default headers values
func NewGetCanSignalsExportUnauthorized() *GetCanSignalsExportUnauthorized {
	return &GetCanSignalsExportUnauthorized{}
}

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

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

// IsSuccess returns true when this get can signals export unauthorized response has a 2xx status code
func (o *GetCanSignalsExportUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get can signals export unauthorized response has a 3xx status code
func (o *GetCanSignalsExportUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get can signals export unauthorized response has a 4xx status code
func (o *GetCanSignalsExportUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get can signals export unauthorized response has a 5xx status code
func (o *GetCanSignalsExportUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get can signals export unauthorized response a status code equal to that given
func (o *GetCanSignalsExportUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get can signals export unauthorized response
func (o *GetCanSignalsExportUnauthorized) Code() int {
	return 401
}

func (o *GetCanSignalsExportUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportUnauthorized %s", 401, payload)
}

func (o *GetCanSignalsExportUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportUnauthorized %s", 401, payload)
}

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

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

// NewGetCanSignalsExportServiceUnavailable creates a GetCanSignalsExportServiceUnavailable with default headers values
func NewGetCanSignalsExportServiceUnavailable() *GetCanSignalsExportServiceUnavailable {
	return &GetCanSignalsExportServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get can signals export service unavailable response has a 2xx status code
func (o *GetCanSignalsExportServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get can signals export service unavailable response has a 3xx status code
func (o *GetCanSignalsExportServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get can signals export service unavailable response has a 4xx status code
func (o *GetCanSignalsExportServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get can signals export service unavailable response has a 5xx status code
func (o *GetCanSignalsExportServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get can signals export service unavailable response a status code equal to that given
func (o *GetCanSignalsExportServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the get can signals export service unavailable response
func (o *GetCanSignalsExportServiceUnavailable) Code() int {
	return 503
}

func (o *GetCanSignalsExportServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportServiceUnavailable %s", 503, payload)
}

func (o *GetCanSignalsExportServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /can_signals_export][%d] getCanSignalsExportServiceUnavailable %s", 503, payload)
}

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

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