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

96 lines
2.2 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package orders
// 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"
)
// GetOrderReader is a Reader for the GetOrder structure.
type GetOrderReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetOrderOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewGetOrderNotFound()
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())
}
}
// NewGetOrderOK creates a GetOrderOK with default headers values
func NewGetOrderOK() *GetOrderOK {
return &GetOrderOK{}
}
/*GetOrderOK handles this case with default header values.
Order Found
*/
type GetOrderOK struct {
Payload *models.Order
}
func (o *GetOrderOK) Error() string {
return fmt.Sprintf("[GET /orders/{id}][%d] getOrderOK %+v", 200, o.Payload)
}
func (o *GetOrderOK) 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
}
// NewGetOrderNotFound creates a GetOrderNotFound with default headers values
func NewGetOrderNotFound() *GetOrderNotFound {
return &GetOrderNotFound{}
}
/*GetOrderNotFound handles this case with default header values.
Order not found
*/
type GetOrderNotFound struct {
}
func (o *GetOrderNotFound) Error() string {
return fmt.Sprintf("[GET /orders/{id}][%d] getOrderNotFound ", 404)
}
func (o *GetOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}