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

// GetFlashpackVersionEcuMappingsModelTrimYearFlashpackReader is a Reader for the GetFlashpackVersionEcuMappingsModelTrimYearFlashpack structure.
type GetFlashpackVersionEcuMappingsModelTrimYearFlashpackReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}] GetFlashpackVersionEcuMappingsModelTrimYearFlashpack", response, response.Code())
	}
}

// NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK creates a GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK with default headers values
func NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK() *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK {
	return &GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK{}
}

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

Get flashpack ecu mappings result
*/
type GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK struct {
	Payload *models.CommonJSONDBQueryResult
}

// IsSuccess returns true when this get flashpack version ecu mappings model trim year flashpack o k response has a 2xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get flashpack version ecu mappings model trim year flashpack o k response has a 3xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get flashpack version ecu mappings model trim year flashpack o k response has a 4xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get flashpack version ecu mappings model trim year flashpack o k response has a 5xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get flashpack version ecu mappings model trim year flashpack o k response a status code equal to that given
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get flashpack version ecu mappings model trim year flashpack o k response
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) Code() int {
	return 200
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackOK %s", 200, payload)
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackOK %s", 200, payload)
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackOK) GetPayload() *models.CommonJSONDBQueryResult {
	return o.Payload
}

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

	o.Payload = new(models.CommonJSONDBQueryResult)

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

	return nil
}

// NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest creates a GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest with default headers values
func NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest() *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest {
	return &GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest{}
}

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

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

// IsSuccess returns true when this get flashpack version ecu mappings model trim year flashpack bad request response has a 2xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get flashpack version ecu mappings model trim year flashpack bad request response has a 3xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get flashpack version ecu mappings model trim year flashpack bad request response has a 4xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get flashpack version ecu mappings model trim year flashpack bad request response has a 5xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this get flashpack version ecu mappings model trim year flashpack bad request response a status code equal to that given
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the get flashpack version ecu mappings model trim year flashpack bad request response
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) Code() int {
	return 400
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest %s", 400, payload)
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackBadRequest %s", 400, payload)
}

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

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

// NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized creates a GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized with default headers values
func NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized() *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized {
	return &GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized{}
}

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

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

// IsSuccess returns true when this get flashpack version ecu mappings model trim year flashpack unauthorized response has a 2xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get flashpack version ecu mappings model trim year flashpack unauthorized response has a 3xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get flashpack version ecu mappings model trim year flashpack unauthorized response has a 4xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get flashpack version ecu mappings model trim year flashpack unauthorized response has a 5xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get flashpack version ecu mappings model trim year flashpack unauthorized response a status code equal to that given
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get flashpack version ecu mappings model trim year flashpack unauthorized response
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) Code() int {
	return 401
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized %s", 401, payload)
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackUnauthorized %s", 401, payload)
}

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

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

// NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable creates a GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable with default headers values
func NewGetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable() *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable {
	return &GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get flashpack version ecu mappings model trim year flashpack service unavailable response has a 2xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get flashpack version ecu mappings model trim year flashpack service unavailable response has a 3xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get flashpack version ecu mappings model trim year flashpack service unavailable response has a 4xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get flashpack version ecu mappings model trim year flashpack service unavailable response has a 5xx status code
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get flashpack version ecu mappings model trim year flashpack service unavailable response a status code equal to that given
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the get flashpack version ecu mappings model trim year flashpack service unavailable response
func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) Code() int {
	return 503
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable %s", 503, payload)
}

func (o *GetFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /flashpack_version_ecu_mappings/{model}/{trim}/{year}/{flashpack}][%d] getFlashpackVersionEcuMappingsModelTrimYearFlashpackServiceUnavailable %s", 503, payload)
}

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

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