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

192 lines
4.8 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 (
"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"
)
// NewGetOrderParams creates a new GetOrderParams object
// with the default values initialized.
func NewGetOrderParams() *GetOrderParams {
var ()
return &GetOrderParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetOrderParamsWithTimeout creates a new GetOrderParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetOrderParamsWithTimeout(timeout time.Duration) *GetOrderParams {
var ()
return &GetOrderParams{
timeout: timeout,
}
}
// NewGetOrderParamsWithContext creates a new GetOrderParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetOrderParamsWithContext(ctx context.Context) *GetOrderParams {
var ()
return &GetOrderParams{
Context: ctx,
}
}
// NewGetOrderParamsWithHTTPClient creates a new GetOrderParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetOrderParamsWithHTTPClient(client *http.Client) *GetOrderParams {
var ()
return &GetOrderParams{
HTTPClient: client,
}
}
/*GetOrderParams contains all the parameters to send to the API endpoint
for the get order operation typically these are written to a http.Request
*/
type GetOrderParams struct {
/*Authorization
OAuth 2.0 Bearer Access Token
*/
Authorization string
/*ID
The FDC order Id
*/
ID string
/*MerchantID
Providing your `merchantId` indicates the `id` is your `merchantOrderId`. Although it is not necessary to provide this it will speed up your results when using your `merchantOrderId` however it will slow your results when using the FDC provided `id`
*/
MerchantID *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get order params
func (o *GetOrderParams) WithTimeout(timeout time.Duration) *GetOrderParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get order params
func (o *GetOrderParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get order params
func (o *GetOrderParams) WithContext(ctx context.Context) *GetOrderParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get order params
func (o *GetOrderParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get order params
func (o *GetOrderParams) WithHTTPClient(client *http.Client) *GetOrderParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get order params
func (o *GetOrderParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAuthorization adds the authorization to the get order params
func (o *GetOrderParams) WithAuthorization(authorization string) *GetOrderParams {
o.SetAuthorization(authorization)
return o
}
// SetAuthorization adds the authorization to the get order params
func (o *GetOrderParams) SetAuthorization(authorization string) {
o.Authorization = authorization
}
// WithID adds the id to the get order params
func (o *GetOrderParams) WithID(id string) *GetOrderParams {
o.SetID(id)
return o
}
// SetID adds the id to the get order params
func (o *GetOrderParams) SetID(id string) {
o.ID = id
}
// WithMerchantID adds the merchantID to the get order params
func (o *GetOrderParams) WithMerchantID(merchantID *int64) *GetOrderParams {
o.SetMerchantID(merchantID)
return o
}
// SetMerchantID adds the merchantId to the get order params
func (o *GetOrderParams) SetMerchantID(merchantID *int64) {
o.MerchantID = merchantID
}
// WriteToRequest writes these params to a swagger request
func (o *GetOrderParams) 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
}
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if o.MerchantID != nil {
// query param merchantId
var qrMerchantID int64
if o.MerchantID != nil {
qrMerchantID = *o.MerchantID
}
qMerchantID := swag.FormatInt64(qrMerchantID)
if qMerchantID != "" {
if err := r.SetQueryParam("merchantId", qMerchantID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}