mirror of
https://github.com/hanzoai/go-fulfillment.git
synced 2026-11-02 15:17:26 +00:00
96 lines
2.5 KiB
Go
96 lines
2.5 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"
|
|
)
|
|
|
|
// PutOrdersIDStatusReader is a Reader for the PutOrdersIDStatus structure.
|
|
type PutOrdersIDStatusReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PutOrdersIDStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewPutOrdersIDStatusOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 404:
|
|
result := NewPutOrdersIDStatusNotFound()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPutOrdersIDStatusOK creates a PutOrdersIDStatusOK with default headers values
|
|
func NewPutOrdersIDStatusOK() *PutOrdersIDStatusOK {
|
|
return &PutOrdersIDStatusOK{}
|
|
}
|
|
|
|
/*PutOrdersIDStatusOK handles this case with default header values.
|
|
|
|
Order Found
|
|
*/
|
|
type PutOrdersIDStatusOK struct {
|
|
Payload *models.Order
|
|
}
|
|
|
|
func (o *PutOrdersIDStatusOK) Error() string {
|
|
return fmt.Sprintf("[PUT /orders/{id}/status][%d] putOrdersIdStatusOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutOrdersIDStatusOK) 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
|
|
}
|
|
|
|
// NewPutOrdersIDStatusNotFound creates a PutOrdersIDStatusNotFound with default headers values
|
|
func NewPutOrdersIDStatusNotFound() *PutOrdersIDStatusNotFound {
|
|
return &PutOrdersIDStatusNotFound{}
|
|
}
|
|
|
|
/*PutOrdersIDStatusNotFound handles this case with default header values.
|
|
|
|
Order not found
|
|
*/
|
|
type PutOrdersIDStatusNotFound struct {
|
|
}
|
|
|
|
func (o *PutOrdersIDStatusNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /orders/{id}/status][%d] putOrdersIdStatusNotFound ", 404)
|
|
}
|
|
|
|
func (o *PutOrdersIDStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|