Files
cloud-services/pkg/ota_api/client/operations/delete_vehicle_vin_responses.go

335 lines
10 KiB
Go

// 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"
)
// DeleteVehicleVinReader is a Reader for the DeleteVehicleVin structure.
type DeleteVehicleVinReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteVehicleVinReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteVehicleVinOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewDeleteVehicleVinBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewDeleteVehicleVinUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 503:
result := NewDeleteVehicleVinServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /vehicle/{vin}] DeleteVehicleVin", response, response.Code())
}
}
// NewDeleteVehicleVinOK creates a DeleteVehicleVinOK with default headers values
func NewDeleteVehicleVinOK() *DeleteVehicleVinOK {
return &DeleteVehicleVinOK{}
}
/*
DeleteVehicleVinOK describes a response with status code 200, with default header values.
OK
*/
type DeleteVehicleVinOK struct {
Payload *models.CommonJSONMessage
}
// IsSuccess returns true when this delete vehicle vin o k response has a 2xx status code
func (o *DeleteVehicleVinOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this delete vehicle vin o k response has a 3xx status code
func (o *DeleteVehicleVinOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete vehicle vin o k response has a 4xx status code
func (o *DeleteVehicleVinOK) IsClientError() bool {
return false
}
// IsServerError returns true when this delete vehicle vin o k response has a 5xx status code
func (o *DeleteVehicleVinOK) IsServerError() bool {
return false
}
// IsCode returns true when this delete vehicle vin o k response a status code equal to that given
func (o *DeleteVehicleVinOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the delete vehicle vin o k response
func (o *DeleteVehicleVinOK) Code() int {
return 200
}
func (o *DeleteVehicleVinOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinOK %s", 200, payload)
}
func (o *DeleteVehicleVinOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinOK %s", 200, payload)
}
func (o *DeleteVehicleVinOK) GetPayload() *models.CommonJSONMessage {
return o.Payload
}
func (o *DeleteVehicleVinOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.CommonJSONMessage)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteVehicleVinBadRequest creates a DeleteVehicleVinBadRequest with default headers values
func NewDeleteVehicleVinBadRequest() *DeleteVehicleVinBadRequest {
return &DeleteVehicleVinBadRequest{}
}
/*
DeleteVehicleVinBadRequest describes a response with status code 400, with default header values.
Bad request
*/
type DeleteVehicleVinBadRequest struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete vehicle vin bad request response has a 2xx status code
func (o *DeleteVehicleVinBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete vehicle vin bad request response has a 3xx status code
func (o *DeleteVehicleVinBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete vehicle vin bad request response has a 4xx status code
func (o *DeleteVehicleVinBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this delete vehicle vin bad request response has a 5xx status code
func (o *DeleteVehicleVinBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this delete vehicle vin bad request response a status code equal to that given
func (o *DeleteVehicleVinBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the delete vehicle vin bad request response
func (o *DeleteVehicleVinBadRequest) Code() int {
return 400
}
func (o *DeleteVehicleVinBadRequest) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinBadRequest %s", 400, payload)
}
func (o *DeleteVehicleVinBadRequest) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinBadRequest %s", 400, payload)
}
func (o *DeleteVehicleVinBadRequest) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteVehicleVinBadRequest) 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
}
// NewDeleteVehicleVinUnauthorized creates a DeleteVehicleVinUnauthorized with default headers values
func NewDeleteVehicleVinUnauthorized() *DeleteVehicleVinUnauthorized {
return &DeleteVehicleVinUnauthorized{}
}
/*
DeleteVehicleVinUnauthorized describes a response with status code 401, with default header values.
Unauthorized
*/
type DeleteVehicleVinUnauthorized struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete vehicle vin unauthorized response has a 2xx status code
func (o *DeleteVehicleVinUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete vehicle vin unauthorized response has a 3xx status code
func (o *DeleteVehicleVinUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete vehicle vin unauthorized response has a 4xx status code
func (o *DeleteVehicleVinUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this delete vehicle vin unauthorized response has a 5xx status code
func (o *DeleteVehicleVinUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this delete vehicle vin unauthorized response a status code equal to that given
func (o *DeleteVehicleVinUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the delete vehicle vin unauthorized response
func (o *DeleteVehicleVinUnauthorized) Code() int {
return 401
}
func (o *DeleteVehicleVinUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinUnauthorized %s", 401, payload)
}
func (o *DeleteVehicleVinUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinUnauthorized %s", 401, payload)
}
func (o *DeleteVehicleVinUnauthorized) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteVehicleVinUnauthorized) 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
}
// NewDeleteVehicleVinServiceUnavailable creates a DeleteVehicleVinServiceUnavailable with default headers values
func NewDeleteVehicleVinServiceUnavailable() *DeleteVehicleVinServiceUnavailable {
return &DeleteVehicleVinServiceUnavailable{}
}
/*
DeleteVehicleVinServiceUnavailable describes a response with status code 503, with default header values.
Service unavailable
*/
type DeleteVehicleVinServiceUnavailable struct {
Payload *models.CommonJSONError
}
// IsSuccess returns true when this delete vehicle vin service unavailable response has a 2xx status code
func (o *DeleteVehicleVinServiceUnavailable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete vehicle vin service unavailable response has a 3xx status code
func (o *DeleteVehicleVinServiceUnavailable) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete vehicle vin service unavailable response has a 4xx status code
func (o *DeleteVehicleVinServiceUnavailable) IsClientError() bool {
return false
}
// IsServerError returns true when this delete vehicle vin service unavailable response has a 5xx status code
func (o *DeleteVehicleVinServiceUnavailable) IsServerError() bool {
return true
}
// IsCode returns true when this delete vehicle vin service unavailable response a status code equal to that given
func (o *DeleteVehicleVinServiceUnavailable) IsCode(code int) bool {
return code == 503
}
// Code gets the status code for the delete vehicle vin service unavailable response
func (o *DeleteVehicleVinServiceUnavailable) Code() int {
return 503
}
func (o *DeleteVehicleVinServiceUnavailable) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinServiceUnavailable %s", 503, payload)
}
func (o *DeleteVehicleVinServiceUnavailable) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /vehicle/{vin}][%d] deleteVehicleVinServiceUnavailable %s", 503, payload)
}
func (o *DeleteVehicleVinServiceUnavailable) GetPayload() *models.CommonJSONError {
return o.Payload
}
func (o *DeleteVehicleVinServiceUnavailable) 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
}