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

// GetVehicleVinTrexLogsLinkReader is a Reader for the GetVehicleVinTrexLogsLink structure.
type GetVehicleVinTrexLogsLinkReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetVehicleVinTrexLogsLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetVehicleVinTrexLogsLinkOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetVehicleVinTrexLogsLinkBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetVehicleVinTrexLogsLinkUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetVehicleVinTrexLogsLinkNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 503:
		result := NewGetVehicleVinTrexLogsLinkServiceUnavailable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /vehicle/{vin}/trex-logs-link] GetVehicleVinTrexLogsLink", response, response.Code())
	}
}

// NewGetVehicleVinTrexLogsLinkOK creates a GetVehicleVinTrexLogsLinkOK with default headers values
func NewGetVehicleVinTrexLogsLinkOK() *GetVehicleVinTrexLogsLinkOK {
	return &GetVehicleVinTrexLogsLinkOK{}
}

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

OK
*/
type GetVehicleVinTrexLogsLinkOK struct {
	Payload *models.HandlersLinkResponse
}

// IsSuccess returns true when this get vehicle vin trex logs link o k response has a 2xx status code
func (o *GetVehicleVinTrexLogsLinkOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get vehicle vin trex logs link o k response has a 3xx status code
func (o *GetVehicleVinTrexLogsLinkOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin trex logs link o k response has a 4xx status code
func (o *GetVehicleVinTrexLogsLinkOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get vehicle vin trex logs link o k response has a 5xx status code
func (o *GetVehicleVinTrexLogsLinkOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get vehicle vin trex logs link o k response a status code equal to that given
func (o *GetVehicleVinTrexLogsLinkOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get vehicle vin trex logs link o k response
func (o *GetVehicleVinTrexLogsLinkOK) Code() int {
	return 200
}

func (o *GetVehicleVinTrexLogsLinkOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkOK %s", 200, payload)
}

func (o *GetVehicleVinTrexLogsLinkOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkOK %s", 200, payload)
}

func (o *GetVehicleVinTrexLogsLinkOK) GetPayload() *models.HandlersLinkResponse {
	return o.Payload
}

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

	o.Payload = new(models.HandlersLinkResponse)

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

	return nil
}

// NewGetVehicleVinTrexLogsLinkBadRequest creates a GetVehicleVinTrexLogsLinkBadRequest with default headers values
func NewGetVehicleVinTrexLogsLinkBadRequest() *GetVehicleVinTrexLogsLinkBadRequest {
	return &GetVehicleVinTrexLogsLinkBadRequest{}
}

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

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

// IsSuccess returns true when this get vehicle vin trex logs link bad request response has a 2xx status code
func (o *GetVehicleVinTrexLogsLinkBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehicle vin trex logs link bad request response has a 3xx status code
func (o *GetVehicleVinTrexLogsLinkBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin trex logs link bad request response has a 4xx status code
func (o *GetVehicleVinTrexLogsLinkBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehicle vin trex logs link bad request response has a 5xx status code
func (o *GetVehicleVinTrexLogsLinkBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this get vehicle vin trex logs link bad request response a status code equal to that given
func (o *GetVehicleVinTrexLogsLinkBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the get vehicle vin trex logs link bad request response
func (o *GetVehicleVinTrexLogsLinkBadRequest) Code() int {
	return 400
}

func (o *GetVehicleVinTrexLogsLinkBadRequest) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkBadRequest %s", 400, payload)
}

func (o *GetVehicleVinTrexLogsLinkBadRequest) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkBadRequest %s", 400, payload)
}

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

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

// NewGetVehicleVinTrexLogsLinkUnauthorized creates a GetVehicleVinTrexLogsLinkUnauthorized with default headers values
func NewGetVehicleVinTrexLogsLinkUnauthorized() *GetVehicleVinTrexLogsLinkUnauthorized {
	return &GetVehicleVinTrexLogsLinkUnauthorized{}
}

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

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

// IsSuccess returns true when this get vehicle vin trex logs link unauthorized response has a 2xx status code
func (o *GetVehicleVinTrexLogsLinkUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehicle vin trex logs link unauthorized response has a 3xx status code
func (o *GetVehicleVinTrexLogsLinkUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin trex logs link unauthorized response has a 4xx status code
func (o *GetVehicleVinTrexLogsLinkUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehicle vin trex logs link unauthorized response has a 5xx status code
func (o *GetVehicleVinTrexLogsLinkUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get vehicle vin trex logs link unauthorized response a status code equal to that given
func (o *GetVehicleVinTrexLogsLinkUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get vehicle vin trex logs link unauthorized response
func (o *GetVehicleVinTrexLogsLinkUnauthorized) Code() int {
	return 401
}

func (o *GetVehicleVinTrexLogsLinkUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkUnauthorized %s", 401, payload)
}

func (o *GetVehicleVinTrexLogsLinkUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkUnauthorized %s", 401, payload)
}

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

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

// NewGetVehicleVinTrexLogsLinkNotFound creates a GetVehicleVinTrexLogsLinkNotFound with default headers values
func NewGetVehicleVinTrexLogsLinkNotFound() *GetVehicleVinTrexLogsLinkNotFound {
	return &GetVehicleVinTrexLogsLinkNotFound{}
}

/*
GetVehicleVinTrexLogsLinkNotFound describes a response with status code 404, with default header values.

Status not found
*/
type GetVehicleVinTrexLogsLinkNotFound struct {
	Payload *models.CommonJSONError
}

// IsSuccess returns true when this get vehicle vin trex logs link not found response has a 2xx status code
func (o *GetVehicleVinTrexLogsLinkNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehicle vin trex logs link not found response has a 3xx status code
func (o *GetVehicleVinTrexLogsLinkNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin trex logs link not found response has a 4xx status code
func (o *GetVehicleVinTrexLogsLinkNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get vehicle vin trex logs link not found response has a 5xx status code
func (o *GetVehicleVinTrexLogsLinkNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get vehicle vin trex logs link not found response a status code equal to that given
func (o *GetVehicleVinTrexLogsLinkNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get vehicle vin trex logs link not found response
func (o *GetVehicleVinTrexLogsLinkNotFound) Code() int {
	return 404
}

func (o *GetVehicleVinTrexLogsLinkNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkNotFound %s", 404, payload)
}

func (o *GetVehicleVinTrexLogsLinkNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkNotFound %s", 404, payload)
}

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

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

// NewGetVehicleVinTrexLogsLinkServiceUnavailable creates a GetVehicleVinTrexLogsLinkServiceUnavailable with default headers values
func NewGetVehicleVinTrexLogsLinkServiceUnavailable() *GetVehicleVinTrexLogsLinkServiceUnavailable {
	return &GetVehicleVinTrexLogsLinkServiceUnavailable{}
}

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

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

// IsSuccess returns true when this get vehicle vin trex logs link service unavailable response has a 2xx status code
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get vehicle vin trex logs link service unavailable response has a 3xx status code
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get vehicle vin trex logs link service unavailable response has a 4xx status code
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) IsClientError() bool {
	return false
}

// IsServerError returns true when this get vehicle vin trex logs link service unavailable response has a 5xx status code
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) IsServerError() bool {
	return true
}

// IsCode returns true when this get vehicle vin trex logs link service unavailable response a status code equal to that given
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) IsCode(code int) bool {
	return code == 503
}

// Code gets the status code for the get vehicle vin trex logs link service unavailable response
func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) Code() int {
	return 503
}

func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkServiceUnavailable %s", 503, payload)
}

func (o *GetVehicleVinTrexLogsLinkServiceUnavailable) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /vehicle/{vin}/trex-logs-link][%d] getVehicleVinTrexLogsLinkServiceUnavailable %s", 503, payload)
}

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

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