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

184 lines
4.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 (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
models "go-fulfillment/models"
)
// NewOrderShipParams creates a new OrderShipParams object
// with the default values initialized.
func NewOrderShipParams() *OrderShipParams {
var ()
return &OrderShipParams{
timeout: cr.DefaultTimeout,
}
}
// NewOrderShipParamsWithTimeout creates a new OrderShipParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewOrderShipParamsWithTimeout(timeout time.Duration) *OrderShipParams {
var ()
return &OrderShipParams{
timeout: timeout,
}
}
// NewOrderShipParamsWithContext creates a new OrderShipParams object
// with the default values initialized, and the ability to set a context for a request
func NewOrderShipParamsWithContext(ctx context.Context) *OrderShipParams {
var ()
return &OrderShipParams{
Context: ctx,
}
}
// NewOrderShipParamsWithHTTPClient creates a new OrderShipParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewOrderShipParamsWithHTTPClient(client *http.Client) *OrderShipParams {
var ()
return &OrderShipParams{
HTTPClient: client,
}
}
/*OrderShipParams contains all the parameters to send to the API endpoint
for the order ship operation typically these are written to a http.Request
*/
type OrderShipParams struct {
/*Authorization
OAuth 2.0 Bearer Access Token
*/
Authorization string
/*Body
Shipping Details
*/
Body *models.OrderShip
/*ID
The FDC order Id
*/
ID int32
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the order ship params
func (o *OrderShipParams) WithTimeout(timeout time.Duration) *OrderShipParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the order ship params
func (o *OrderShipParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the order ship params
func (o *OrderShipParams) WithContext(ctx context.Context) *OrderShipParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the order ship params
func (o *OrderShipParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the order ship params
func (o *OrderShipParams) WithHTTPClient(client *http.Client) *OrderShipParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the order ship params
func (o *OrderShipParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAuthorization adds the authorization to the order ship params
func (o *OrderShipParams) WithAuthorization(authorization string) *OrderShipParams {
o.SetAuthorization(authorization)
return o
}
// SetAuthorization adds the authorization to the order ship params
func (o *OrderShipParams) SetAuthorization(authorization string) {
o.Authorization = authorization
}
// WithBody adds the body to the order ship params
func (o *OrderShipParams) WithBody(body *models.OrderShip) *OrderShipParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the order ship params
func (o *OrderShipParams) SetBody(body *models.OrderShip) {
o.Body = body
}
// WithID adds the id to the order ship params
func (o *OrderShipParams) WithID(id int32) *OrderShipParams {
o.SetID(id)
return o
}
// SetID adds the id to the order ship params
func (o *OrderShipParams) SetID(id int32) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *OrderShipParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// header param Authorization
if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil {
return err
}
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
// path param id
if err := r.SetPathParam("id", swag.FormatInt32(o.ID)); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}