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

184 lines
4.9 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"
)
// NewPutOrdersIDStatusParams creates a new PutOrdersIDStatusParams object
// with the default values initialized.
func NewPutOrdersIDStatusParams() *PutOrdersIDStatusParams {
var ()
return &PutOrdersIDStatusParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutOrdersIDStatusParamsWithTimeout creates a new PutOrdersIDStatusParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutOrdersIDStatusParamsWithTimeout(timeout time.Duration) *PutOrdersIDStatusParams {
var ()
return &PutOrdersIDStatusParams{
timeout: timeout,
}
}
// NewPutOrdersIDStatusParamsWithContext creates a new PutOrdersIDStatusParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutOrdersIDStatusParamsWithContext(ctx context.Context) *PutOrdersIDStatusParams {
var ()
return &PutOrdersIDStatusParams{
Context: ctx,
}
}
// NewPutOrdersIDStatusParamsWithHTTPClient creates a new PutOrdersIDStatusParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutOrdersIDStatusParamsWithHTTPClient(client *http.Client) *PutOrdersIDStatusParams {
var ()
return &PutOrdersIDStatusParams{
HTTPClient: client,
}
}
/*PutOrdersIDStatusParams contains all the parameters to send to the API endpoint
for the put orders ID status operation typically these are written to a http.Request
*/
type PutOrdersIDStatusParams struct {
/*Authorization
OAuth 2.0 Bearer Access Token
*/
Authorization string
/*Body
New status event
*/
Body *models.StatusTypeSimple
/*ID
The FDC order Id
*/
ID int32
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithTimeout(timeout time.Duration) *PutOrdersIDStatusParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithContext(ctx context.Context) *PutOrdersIDStatusParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithHTTPClient(client *http.Client) *PutOrdersIDStatusParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAuthorization adds the authorization to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithAuthorization(authorization string) *PutOrdersIDStatusParams {
o.SetAuthorization(authorization)
return o
}
// SetAuthorization adds the authorization to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetAuthorization(authorization string) {
o.Authorization = authorization
}
// WithBody adds the body to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithBody(body *models.StatusTypeSimple) *PutOrdersIDStatusParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetBody(body *models.StatusTypeSimple) {
o.Body = body
}
// WithID adds the id to the put orders ID status params
func (o *PutOrdersIDStatusParams) WithID(id int32) *PutOrdersIDStatusParams {
o.SetID(id)
return o
}
// SetID adds the id to the put orders ID status params
func (o *PutOrdersIDStatusParams) SetID(id int32) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *PutOrdersIDStatusParams) 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
}