// Code generated by go-swagger; DO NOT EDIT. package event_management // 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" "github.com/go-openapi/strfmt" "github.com/Cyclops-Labs/cyclops-4-hpc.git/services/eventsengine/models" ) // NewAddEventParams creates a new AddEventParams object // with the default values initialized. func NewAddEventParams() *AddEventParams { var () return &AddEventParams{ timeout: cr.DefaultTimeout, } } // NewAddEventParamsWithTimeout creates a new AddEventParams object // with the default values initialized, and the ability to set a timeout on a request func NewAddEventParamsWithTimeout(timeout time.Duration) *AddEventParams { var () return &AddEventParams{ timeout: timeout, } } // NewAddEventParamsWithContext creates a new AddEventParams object // with the default values initialized, and the ability to set a context for a request func NewAddEventParamsWithContext(ctx context.Context) *AddEventParams { var () return &AddEventParams{ Context: ctx, } } // NewAddEventParamsWithHTTPClient creates a new AddEventParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAddEventParamsWithHTTPClient(client *http.Client) *AddEventParams { var () return &AddEventParams{ HTTPClient: client, } } /*AddEventParams contains all the parameters to send to the API endpoint for the add event operation typically these are written to a http.Request */ type AddEventParams struct { /*Event Event to be added to the system */ Event *models.Event timeout time.Duration Context context.Context HTTPClient *http.Client } // WithTimeout adds the timeout to the add event params func (o *AddEventParams) WithTimeout(timeout time.Duration) *AddEventParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the add event params func (o *AddEventParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the add event params func (o *AddEventParams) WithContext(ctx context.Context) *AddEventParams { o.SetContext(ctx) return o } // SetContext adds the context to the add event params func (o *AddEventParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the add event params func (o *AddEventParams) WithHTTPClient(client *http.Client) *AddEventParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the add event params func (o *AddEventParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithEvent adds the event to the add event params func (o *AddEventParams) WithEvent(event *models.Event) *AddEventParams { o.SetEvent(event) return o } // SetEvent adds the event to the add event params func (o *AddEventParams) SetEvent(event *models.Event) { o.Event = event } // WriteToRequest writes these params to a swagger request func (o *AddEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Event != nil { if err := r.SetBodyParam(o.Event); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }