package user_interface // 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" ) // NewPostUIOpenwindowContractParams creates a new PostUIOpenwindowContractParams object // with the default values initialized. func NewPostUIOpenwindowContractParams() *PostUIOpenwindowContractParams { var ( datasourceDefault = string("tranquility") ) return &PostUIOpenwindowContractParams{ Datasource: &datasourceDefault, timeout: cr.DefaultTimeout, } } // NewPostUIOpenwindowContractParamsWithTimeout creates a new PostUIOpenwindowContractParams object // with the default values initialized, and the ability to set a timeout on a request func NewPostUIOpenwindowContractParamsWithTimeout(timeout time.Duration) *PostUIOpenwindowContractParams { var ( datasourceDefault = string("tranquility") ) return &PostUIOpenwindowContractParams{ Datasource: &datasourceDefault, timeout: timeout, } } // NewPostUIOpenwindowContractParamsWithContext creates a new PostUIOpenwindowContractParams object // with the default values initialized, and the ability to set a context for a request func NewPostUIOpenwindowContractParamsWithContext(ctx context.Context) *PostUIOpenwindowContractParams { var ( datasourceDefault = string("tranquility") ) return &PostUIOpenwindowContractParams{ Datasource: &datasourceDefault, Context: ctx, } } /*PostUIOpenwindowContractParams contains all the parameters to send to the API endpoint for the post ui openwindow contract operation typically these are written to a http.Request */ type PostUIOpenwindowContractParams struct { /*ContractID The contract to open */ ContractID int32 /*Datasource The server name you would like data from */ Datasource *string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithTimeout adds the timeout to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) WithTimeout(timeout time.Duration) *PostUIOpenwindowContractParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) WithContext(ctx context.Context) *PostUIOpenwindowContractParams { o.SetContext(ctx) return o } // SetContext adds the context to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) SetContext(ctx context.Context) { o.Context = ctx } // WithContractID adds the contractID to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) WithContractID(contractID int32) *PostUIOpenwindowContractParams { o.SetContractID(contractID) return o } // SetContractID adds the contractId to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) SetContractID(contractID int32) { o.ContractID = contractID } // WithDatasource adds the datasource to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) WithDatasource(datasource *string) *PostUIOpenwindowContractParams { o.SetDatasource(datasource) return o } // SetDatasource adds the datasource to the post ui openwindow contract params func (o *PostUIOpenwindowContractParams) SetDatasource(datasource *string) { o.Datasource = datasource } // WriteToRequest writes these params to a swagger request func (o *PostUIOpenwindowContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { r.SetTimeout(o.timeout) var res []error // query param contract_id qrContractID := o.ContractID qContractID := swag.FormatInt32(qrContractID) if qContractID != "" { if err := r.SetQueryParam("contract_id", qContractID); err != nil { return err } } if o.Datasource != nil { // query param datasource var qrDatasource string if o.Datasource != nil { qrDatasource = *o.Datasource } qDatasource := qrDatasource if qDatasource != "" { if err := r.SetQueryParam("datasource", qDatasource); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }