// Code generated by go-swagger; DO NOT EDIT. package control // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel" ) // NewSubscribeControlParams creates a new SubscribeControlParams object // with the default values initialized. func NewSubscribeControlParams() *SubscribeControlParams { var () return &SubscribeControlParams{ timeout: cr.DefaultTimeout, } } // NewSubscribeControlParamsWithTimeout creates a new SubscribeControlParams object // with the default values initialized, and the ability to set a timeout on a request func NewSubscribeControlParamsWithTimeout(timeout time.Duration) *SubscribeControlParams { var () return &SubscribeControlParams{ timeout: timeout, } } // NewSubscribeControlParamsWithContext creates a new SubscribeControlParams object // with the default values initialized, and the ability to set a context for a request func NewSubscribeControlParamsWithContext(ctx context.Context) *SubscribeControlParams { var () return &SubscribeControlParams{ Context: ctx, } } // NewSubscribeControlParamsWithHTTPClient creates a new SubscribeControlParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request func NewSubscribeControlParamsWithHTTPClient(client *http.Client) *SubscribeControlParams { var () return &SubscribeControlParams{ HTTPClient: client, } } /*SubscribeControlParams contains all the parameters to send to the API endpoint for the subscribe control operation typically these are written to a http.Request */ type SubscribeControlParams struct { /*ControlParams Subscription control parameters */ ControlParams *clientmodel.ControlParams timeout time.Duration Context context.Context HTTPClient *http.Client } // WithTimeout adds the timeout to the subscribe control params func (o *SubscribeControlParams) WithTimeout(timeout time.Duration) *SubscribeControlParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the subscribe control params func (o *SubscribeControlParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the subscribe control params func (o *SubscribeControlParams) WithContext(ctx context.Context) *SubscribeControlParams { o.SetContext(ctx) return o } // SetContext adds the context to the subscribe control params func (o *SubscribeControlParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the subscribe control params func (o *SubscribeControlParams) WithHTTPClient(client *http.Client) *SubscribeControlParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the subscribe control params func (o *SubscribeControlParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithControlParams adds the controlParams to the subscribe control params func (o *SubscribeControlParams) WithControlParams(controlParams *clientmodel.ControlParams) *SubscribeControlParams { o.SetControlParams(controlParams) return o } // SetControlParams adds the controlParams to the subscribe control params func (o *SubscribeControlParams) SetControlParams(controlParams *clientmodel.ControlParams) { o.ControlParams = controlParams } // WriteToRequest writes these params to a swagger request func (o *SubscribeControlParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.ControlParams != nil { if err := r.SetBodyParam(o.ControlParams); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }