X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fclientapi%2Fcontrol%2Fsubscribe_control_parameters.go;fp=pkg%2Fclientapi%2Fcontrol%2Fsubscribe_control_parameters.go;h=81a535511e803f07d5c9e84bdaa013d8ad287d1e;hb=3895a8c8775ef96652e6473414fdd7366c59f404;hp=0000000000000000000000000000000000000000;hpb=5120ec103eead26427b977f4b2456c2ce57b36ac;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/clientapi/control/subscribe_control_parameters.go b/pkg/clientapi/control/subscribe_control_parameters.go new file mode 100644 index 0000000..81a5355 --- /dev/null +++ b/pkg/clientapi/control/subscribe_control_parameters.go @@ -0,0 +1,139 @@ +// 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 +}