mirror of
https://github.com/hanzoai/go-fulfillment.git
synced 2026-10-30 18:36:06 +00:00
91 lines
2.4 KiB
Go
91 lines
2.4 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 (
|
|
"github.com/go-openapi/runtime"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// New creates a new partners API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
/*
|
|
Client for partners API
|
|
*/
|
|
type Client struct {
|
|
transport runtime.ClientTransport
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
/*
|
|
PutOrdersIDStatus updates order status
|
|
|
|
Note, this API is used to update orders and is reserved for our shipping partners.
|
|
*/
|
|
func (a *Client) PutOrdersIDStatus(params *PutOrdersIDStatusParams) (*PutOrdersIDStatusOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewPutOrdersIDStatusParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "PutOrdersIDStatus",
|
|
Method: "PUT",
|
|
PathPattern: "/orders/{id}/status",
|
|
ProducesMediaTypes: []string{""},
|
|
ConsumesMediaTypes: []string{""},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &PutOrdersIDStatusReader{formats: a.formats},
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*PutOrdersIDStatusOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
OrderShip ships an order
|
|
|
|
Note, this API is used to update orders and is reserved for our shipping partners.
|
|
*/
|
|
func (a *Client) OrderShip(params *OrderShipParams) (*OrderShipOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewOrderShipParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "orderShip",
|
|
Method: "PUT",
|
|
PathPattern: "/orders/{id}/ship",
|
|
ProducesMediaTypes: []string{""},
|
|
ConsumesMediaTypes: []string{""},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &OrderShipReader{formats: a.formats},
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*OrderShipOK), nil
|
|
|
|
}
|
|
|
|
// SetTransport changes the transport on the client
|
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
|
a.transport = transport
|
|
}
|