Files
go-fulfillment/client/partners/order_ship_responses.go
2018-08-13 17:30:21 -05:00

96 lines
2.3 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package partners
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
models "go-fulfillment/models"
)
// OrderShipReader is a Reader for the OrderShip structure.
type OrderShipReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *OrderShipReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewOrderShipOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewOrderShipNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
}
}
// NewOrderShipOK creates a OrderShipOK with default headers values
func NewOrderShipOK() *OrderShipOK {
return &OrderShipOK{}
}
/*OrderShipOK handles this case with default header values.
Order Found
*/
type OrderShipOK struct {
Payload *models.Order
}
func (o *OrderShipOK) Error() string {
return fmt.Sprintf("[PUT /orders/{id}/ship][%d] orderShipOK %+v", 200, o.Payload)
}
func (o *OrderShipOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Order)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewOrderShipNotFound creates a OrderShipNotFound with default headers values
func NewOrderShipNotFound() *OrderShipNotFound {
return &OrderShipNotFound{}
}
/*OrderShipNotFound handles this case with default header values.
Order not found
*/
type OrderShipNotFound struct {
}
func (o *OrderShipNotFound) Error() string {
return fmt.Sprintf("[PUT /orders/{id}/ship][%d] orderShipNotFound ", 404)
}
func (o *OrderShipNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}