// Code generated by go-swagger; DO NOT EDIT. package user // 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" ) // NewGetAPIUsersParams creates a new GetAPIUsersParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetAPIUsersParams() *GetAPIUsersParams { return &GetAPIUsersParams{ timeout: cr.DefaultTimeout, } } // NewGetAPIUsersParamsWithTimeout creates a new GetAPIUsersParams object // with the ability to set a timeout on a request. func NewGetAPIUsersParamsWithTimeout(timeout time.Duration) *GetAPIUsersParams { return &GetAPIUsersParams{ timeout: timeout, } } // NewGetAPIUsersParamsWithContext creates a new GetAPIUsersParams object // with the ability to set a context for a request. func NewGetAPIUsersParamsWithContext(ctx context.Context) *GetAPIUsersParams { return &GetAPIUsersParams{ Context: ctx, } } // NewGetAPIUsersParamsWithHTTPClient creates a new GetAPIUsersParams object // with the ability to set a custom HTTPClient for a request. func NewGetAPIUsersParamsWithHTTPClient(client *http.Client) *GetAPIUsersParams { return &GetAPIUsersParams{ HTTPClient: client, } } /* GetAPIUsersParams contains all the parameters to send to the API endpoint for the get API users operation. Typically these are written to a http.Request. */ type GetAPIUsersParams struct { /* Order. The result order. Allowed values: ASC, DESC (default: ASC) */ Order string /* OrderBy. The field by which results will be ordered. Allowed values: id, username, alias, email (default: username) */ OrderBy string /* Term. Free search term */ Term *string /* Visible. Visibility status to filter users. Allowed values: 1=visible, 2=hidden, 3=all (default: 1) */ Visible string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the get API users params (not the query body). // // All values with no default are reset to their zero value. func (o *GetAPIUsersParams) WithDefaults() *GetAPIUsersParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the get API users params (not the query body). // // All values with no default are reset to their zero value. func (o *GetAPIUsersParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the get API users params func (o *GetAPIUsersParams) WithTimeout(timeout time.Duration) *GetAPIUsersParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the get API users params func (o *GetAPIUsersParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the get API users params func (o *GetAPIUsersParams) WithContext(ctx context.Context) *GetAPIUsersParams { o.SetContext(ctx) return o } // SetContext adds the context to the get API users params func (o *GetAPIUsersParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the get API users params func (o *GetAPIUsersParams) WithHTTPClient(client *http.Client) *GetAPIUsersParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the get API users params func (o *GetAPIUsersParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithOrder adds the order to the get API users params func (o *GetAPIUsersParams) WithOrder(order string) *GetAPIUsersParams { o.SetOrder(order) return o } // SetOrder adds the order to the get API users params func (o *GetAPIUsersParams) SetOrder(order string) { o.Order = order } // WithOrderBy adds the orderBy to the get API users params func (o *GetAPIUsersParams) WithOrderBy(orderBy string) *GetAPIUsersParams { o.SetOrderBy(orderBy) return o } // SetOrderBy adds the orderBy to the get API users params func (o *GetAPIUsersParams) SetOrderBy(orderBy string) { o.OrderBy = orderBy } // WithTerm adds the term to the get API users params func (o *GetAPIUsersParams) WithTerm(term *string) *GetAPIUsersParams { o.SetTerm(term) return o } // SetTerm adds the term to the get API users params func (o *GetAPIUsersParams) SetTerm(term *string) { o.Term = term } // WithVisible adds the visible to the get API users params func (o *GetAPIUsersParams) WithVisible(visible string) *GetAPIUsersParams { o.SetVisible(visible) return o } // SetVisible adds the visible to the get API users params func (o *GetAPIUsersParams) SetVisible(visible string) { o.Visible = visible } // WriteToRequest writes these params to a swagger request func (o *GetAPIUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error // query param order qrOrder := o.Order qOrder := qrOrder if err := r.SetQueryParam("order", qOrder); err != nil { return err } // query param orderBy qrOrderBy := o.OrderBy qOrderBy := qrOrderBy if err := r.SetQueryParam("orderBy", qOrderBy); err != nil { return err } if o.Term != nil { // query param term var qrTerm string if o.Term != nil { qrTerm = *o.Term } qTerm := qrTerm if qTerm != "" { if err := r.SetQueryParam("term", qTerm); err != nil { return err } } } // query param visible qrVisible := o.Visible qVisible := qrVisible if err := r.SetQueryParam("visible", qVisible); err != nil { return err } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }