333 lines
10 KiB
Go
333 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"
|
|
|
|
"fiskerinc.com/modules/ota_api/models"
|
|
)
|
|
|
|
// PostVehiclePathsReader is a Reader for the PostVehiclePaths structure.
|
|
type PostVehiclePathsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PostVehiclePathsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewPostVehiclePathsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 400:
|
|
result := NewPostVehiclePathsBadRequest()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 401:
|
|
result := NewPostVehiclePathsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 503:
|
|
result := NewPostVehiclePathsServiceUnavailable()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[POST /vehicle_paths] PostVehiclePaths", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewPostVehiclePathsOK creates a PostVehiclePathsOK with default headers values
|
|
func NewPostVehiclePathsOK() *PostVehiclePathsOK {
|
|
return &PostVehiclePathsOK{}
|
|
}
|
|
|
|
/*
|
|
PostVehiclePathsOK describes a response with status code 200, with default header values.
|
|
|
|
OK
|
|
*/
|
|
type PostVehiclePathsOK struct {
|
|
Payload models.CommonGpsPaths
|
|
}
|
|
|
|
// IsSuccess returns true when this post vehicle paths o k response has a 2xx status code
|
|
func (o *PostVehiclePathsOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this post vehicle paths o k response has a 3xx status code
|
|
func (o *PostVehiclePathsOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post vehicle paths o k response has a 4xx status code
|
|
func (o *PostVehiclePathsOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this post vehicle paths o k response has a 5xx status code
|
|
func (o *PostVehiclePathsOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post vehicle paths o k response a status code equal to that given
|
|
func (o *PostVehiclePathsOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the post vehicle paths o k response
|
|
func (o *PostVehiclePathsOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *PostVehiclePathsOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsOK) GetPayload() models.CommonGpsPaths {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostVehiclePathsOK) 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
|
|
}
|
|
|
|
// NewPostVehiclePathsBadRequest creates a PostVehiclePathsBadRequest with default headers values
|
|
func NewPostVehiclePathsBadRequest() *PostVehiclePathsBadRequest {
|
|
return &PostVehiclePathsBadRequest{}
|
|
}
|
|
|
|
/*
|
|
PostVehiclePathsBadRequest describes a response with status code 400, with default header values.
|
|
|
|
Bad request
|
|
*/
|
|
type PostVehiclePathsBadRequest struct {
|
|
Payload *models.CommonJSONError
|
|
}
|
|
|
|
// IsSuccess returns true when this post vehicle paths bad request response has a 2xx status code
|
|
func (o *PostVehiclePathsBadRequest) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post vehicle paths bad request response has a 3xx status code
|
|
func (o *PostVehiclePathsBadRequest) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post vehicle paths bad request response has a 4xx status code
|
|
func (o *PostVehiclePathsBadRequest) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post vehicle paths bad request response has a 5xx status code
|
|
func (o *PostVehiclePathsBadRequest) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post vehicle paths bad request response a status code equal to that given
|
|
func (o *PostVehiclePathsBadRequest) IsCode(code int) bool {
|
|
return code == 400
|
|
}
|
|
|
|
// Code gets the status code for the post vehicle paths bad request response
|
|
func (o *PostVehiclePathsBadRequest) Code() int {
|
|
return 400
|
|
}
|
|
|
|
func (o *PostVehiclePathsBadRequest) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsBadRequest %s", 400, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsBadRequest) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsBadRequest %s", 400, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsBadRequest) GetPayload() *models.CommonJSONError {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostVehiclePathsBadRequest) 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
|
|
}
|
|
|
|
// NewPostVehiclePathsUnauthorized creates a PostVehiclePathsUnauthorized with default headers values
|
|
func NewPostVehiclePathsUnauthorized() *PostVehiclePathsUnauthorized {
|
|
return &PostVehiclePathsUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
PostVehiclePathsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Unauthorized
|
|
*/
|
|
type PostVehiclePathsUnauthorized struct {
|
|
Payload *models.CommonJSONError
|
|
}
|
|
|
|
// IsSuccess returns true when this post vehicle paths unauthorized response has a 2xx status code
|
|
func (o *PostVehiclePathsUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post vehicle paths unauthorized response has a 3xx status code
|
|
func (o *PostVehiclePathsUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post vehicle paths unauthorized response has a 4xx status code
|
|
func (o *PostVehiclePathsUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post vehicle paths unauthorized response has a 5xx status code
|
|
func (o *PostVehiclePathsUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post vehicle paths unauthorized response a status code equal to that given
|
|
func (o *PostVehiclePathsUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the post vehicle paths unauthorized response
|
|
func (o *PostVehiclePathsUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *PostVehiclePathsUnauthorized) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsUnauthorized %s", 401, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsUnauthorized) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsUnauthorized %s", 401, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsUnauthorized) GetPayload() *models.CommonJSONError {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostVehiclePathsUnauthorized) 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
|
|
}
|
|
|
|
// NewPostVehiclePathsServiceUnavailable creates a PostVehiclePathsServiceUnavailable with default headers values
|
|
func NewPostVehiclePathsServiceUnavailable() *PostVehiclePathsServiceUnavailable {
|
|
return &PostVehiclePathsServiceUnavailable{}
|
|
}
|
|
|
|
/*
|
|
PostVehiclePathsServiceUnavailable describes a response with status code 503, with default header values.
|
|
|
|
Service unavailable
|
|
*/
|
|
type PostVehiclePathsServiceUnavailable struct {
|
|
Payload *models.CommonJSONError
|
|
}
|
|
|
|
// IsSuccess returns true when this post vehicle paths service unavailable response has a 2xx status code
|
|
func (o *PostVehiclePathsServiceUnavailable) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post vehicle paths service unavailable response has a 3xx status code
|
|
func (o *PostVehiclePathsServiceUnavailable) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post vehicle paths service unavailable response has a 4xx status code
|
|
func (o *PostVehiclePathsServiceUnavailable) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this post vehicle paths service unavailable response has a 5xx status code
|
|
func (o *PostVehiclePathsServiceUnavailable) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this post vehicle paths service unavailable response a status code equal to that given
|
|
func (o *PostVehiclePathsServiceUnavailable) IsCode(code int) bool {
|
|
return code == 503
|
|
}
|
|
|
|
// Code gets the status code for the post vehicle paths service unavailable response
|
|
func (o *PostVehiclePathsServiceUnavailable) Code() int {
|
|
return 503
|
|
}
|
|
|
|
func (o *PostVehiclePathsServiceUnavailable) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsServiceUnavailable %s", 503, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsServiceUnavailable) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /vehicle_paths][%d] postVehiclePathsServiceUnavailable %s", 503, payload)
|
|
}
|
|
|
|
func (o *PostVehiclePathsServiceUnavailable) GetPayload() *models.CommonJSONError {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostVehiclePathsServiceUnavailable) 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
|
|
}
|