// Code generated by go-swagger; DO NOT EDIT. package admin // 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/go-openapi/swag" ) // NewAdminAccountsGetV1Params creates a new AdminAccountsGetV1Params 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 NewAdminAccountsGetV1Params() *AdminAccountsGetV1Params { return &AdminAccountsGetV1Params{ timeout: cr.DefaultTimeout, } } // NewAdminAccountsGetV1ParamsWithTimeout creates a new AdminAccountsGetV1Params object // with the ability to set a timeout on a request. func NewAdminAccountsGetV1ParamsWithTimeout(timeout time.Duration) *AdminAccountsGetV1Params { return &AdminAccountsGetV1Params{ timeout: timeout, } } // NewAdminAccountsGetV1ParamsWithContext creates a new AdminAccountsGetV1Params object // with the ability to set a context for a request. func NewAdminAccountsGetV1ParamsWithContext(ctx context.Context) *AdminAccountsGetV1Params { return &AdminAccountsGetV1Params{ Context: ctx, } } // NewAdminAccountsGetV1ParamsWithHTTPClient creates a new AdminAccountsGetV1Params object // with the ability to set a custom HTTPClient for a request. func NewAdminAccountsGetV1ParamsWithHTTPClient(client *http.Client) *AdminAccountsGetV1Params { return &AdminAccountsGetV1Params{ HTTPClient: client, } } /* AdminAccountsGetV1Params contains all the parameters to send to the API endpoint for the admin accounts get v1 operation. Typically these are written to a http.Request. */ type AdminAccountsGetV1Params struct { /* Active. Filter for currently active accounts. */ Active *bool /* ByDomain. Filter by the given domain. */ ByDomain *string /* Disabled. Filter for currently disabled accounts. */ Disabled *bool /* DisplayName. Search for the given display name. */ DisplayName *string /* Email. Lookup a user with this email. */ Email *string /* IP. Lookup users with this IP address. */ IP *string /* Limit. Maximum number of results to return. Default: 50 */ Limit *int64 /* Local. Filter for local accounts. */ Local *bool /* MaxID. max_id in the form `[domain]/@[username]`. All results returned will be later in the alphabet than `[domain]/@[username]`. For example, if max_id = `example.org/@someone` then returned entries might contain `example.org/@someone_else`, `later.example.org/@someone`, etc. Local account IDs in this form use an empty string for the `[domain]` part, for example local account with username `someone` would be `/@someone`. */ MaxID *string /* MinID. min_id in the form `[domain]/@[username]`. All results returned will be earlier in the alphabet than `[domain]/@[username]`. For example, if min_id = `example.org/@someone` then returned entries might contain `example.org/@earlier_account`, `earlier.example.org/@someone`, etc. Local account IDs in this form use an empty string for the `[domain]` part, for example local account with username `someone` would be `/@someone`. */ MinID *string /* Pending. Filter for currently pending accounts. */ Pending *bool /* Remote. Filter for remote accounts. */ Remote *bool /* Sensitized. Filter for accounts force-marked as sensitive. */ Sensitized *bool /* Silenced. Filter for currently silenced accounts. */ Silenced *bool /* Staff. Filter for staff accounts. */ Staff *bool /* Suspended. Filter for currently suspended accounts. */ Suspended *bool /* Username. Search for the given username. */ Username *string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the admin accounts get v1 params (not the query body). // // All values with no default are reset to their zero value. func (o *AdminAccountsGetV1Params) WithDefaults() *AdminAccountsGetV1Params { o.SetDefaults() return o } // SetDefaults hydrates default values in the admin accounts get v1 params (not the query body). // // All values with no default are reset to their zero value. func (o *AdminAccountsGetV1Params) SetDefaults() { var ( activeDefault = bool(false) disabledDefault = bool(false) limitDefault = int64(50) localDefault = bool(false) pendingDefault = bool(false) remoteDefault = bool(false) sensitizedDefault = bool(false) silencedDefault = bool(false) staffDefault = bool(false) suspendedDefault = bool(false) ) val := AdminAccountsGetV1Params{ Active: &activeDefault, Disabled: &disabledDefault, Limit: &limitDefault, Local: &localDefault, Pending: &pendingDefault, Remote: &remoteDefault, Sensitized: &sensitizedDefault, Silenced: &silencedDefault, Staff: &staffDefault, Suspended: &suspendedDefault, } val.timeout = o.timeout val.Context = o.Context val.HTTPClient = o.HTTPClient *o = val } // WithTimeout adds the timeout to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithTimeout(timeout time.Duration) *AdminAccountsGetV1Params { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithContext(ctx context.Context) *AdminAccountsGetV1Params { o.SetContext(ctx) return o } // SetContext adds the context to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithHTTPClient(client *http.Client) *AdminAccountsGetV1Params { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithActive adds the active to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithActive(active *bool) *AdminAccountsGetV1Params { o.SetActive(active) return o } // SetActive adds the active to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetActive(active *bool) { o.Active = active } // WithByDomain adds the byDomain to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithByDomain(byDomain *string) *AdminAccountsGetV1Params { o.SetByDomain(byDomain) return o } // SetByDomain adds the byDomain to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetByDomain(byDomain *string) { o.ByDomain = byDomain } // WithDisabled adds the disabled to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithDisabled(disabled *bool) *AdminAccountsGetV1Params { o.SetDisabled(disabled) return o } // SetDisabled adds the disabled to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetDisabled(disabled *bool) { o.Disabled = disabled } // WithDisplayName adds the displayName to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithDisplayName(displayName *string) *AdminAccountsGetV1Params { o.SetDisplayName(displayName) return o } // SetDisplayName adds the displayName to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetDisplayName(displayName *string) { o.DisplayName = displayName } // WithEmail adds the email to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithEmail(email *string) *AdminAccountsGetV1Params { o.SetEmail(email) return o } // SetEmail adds the email to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetEmail(email *string) { o.Email = email } // WithIP adds the ip to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithIP(ip *string) *AdminAccountsGetV1Params { o.SetIP(ip) return o } // SetIP adds the ip to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetIP(ip *string) { o.IP = ip } // WithLimit adds the limit to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithLimit(limit *int64) *AdminAccountsGetV1Params { o.SetLimit(limit) return o } // SetLimit adds the limit to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetLimit(limit *int64) { o.Limit = limit } // WithLocal adds the local to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithLocal(local *bool) *AdminAccountsGetV1Params { o.SetLocal(local) return o } // SetLocal adds the local to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetLocal(local *bool) { o.Local = local } // WithMaxID adds the maxID to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithMaxID(maxID *string) *AdminAccountsGetV1Params { o.SetMaxID(maxID) return o } // SetMaxID adds the maxId to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetMaxID(maxID *string) { o.MaxID = maxID } // WithMinID adds the minID to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithMinID(minID *string) *AdminAccountsGetV1Params { o.SetMinID(minID) return o } // SetMinID adds the minId to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetMinID(minID *string) { o.MinID = minID } // WithPending adds the pending to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithPending(pending *bool) *AdminAccountsGetV1Params { o.SetPending(pending) return o } // SetPending adds the pending to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetPending(pending *bool) { o.Pending = pending } // WithRemote adds the remote to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithRemote(remote *bool) *AdminAccountsGetV1Params { o.SetRemote(remote) return o } // SetRemote adds the remote to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetRemote(remote *bool) { o.Remote = remote } // WithSensitized adds the sensitized to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithSensitized(sensitized *bool) *AdminAccountsGetV1Params { o.SetSensitized(sensitized) return o } // SetSensitized adds the sensitized to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetSensitized(sensitized *bool) { o.Sensitized = sensitized } // WithSilenced adds the silenced to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithSilenced(silenced *bool) *AdminAccountsGetV1Params { o.SetSilenced(silenced) return o } // SetSilenced adds the silenced to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetSilenced(silenced *bool) { o.Silenced = silenced } // WithStaff adds the staff to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithStaff(staff *bool) *AdminAccountsGetV1Params { o.SetStaff(staff) return o } // SetStaff adds the staff to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetStaff(staff *bool) { o.Staff = staff } // WithSuspended adds the suspended to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithSuspended(suspended *bool) *AdminAccountsGetV1Params { o.SetSuspended(suspended) return o } // SetSuspended adds the suspended to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetSuspended(suspended *bool) { o.Suspended = suspended } // WithUsername adds the username to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) WithUsername(username *string) *AdminAccountsGetV1Params { o.SetUsername(username) return o } // SetUsername adds the username to the admin accounts get v1 params func (o *AdminAccountsGetV1Params) SetUsername(username *string) { o.Username = username } // WriteToRequest writes these params to a swagger request func (o *AdminAccountsGetV1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Active != nil { // query param active var qrActive bool if o.Active != nil { qrActive = *o.Active } qActive := swag.FormatBool(qrActive) if qActive != "" { if err := r.SetQueryParam("active", qActive); err != nil { return err } } } if o.ByDomain != nil { // query param by_domain var qrByDomain string if o.ByDomain != nil { qrByDomain = *o.ByDomain } qByDomain := qrByDomain if qByDomain != "" { if err := r.SetQueryParam("by_domain", qByDomain); err != nil { return err } } } if o.Disabled != nil { // query param disabled var qrDisabled bool if o.Disabled != nil { qrDisabled = *o.Disabled } qDisabled := swag.FormatBool(qrDisabled) if qDisabled != "" { if err := r.SetQueryParam("disabled", qDisabled); err != nil { return err } } } if o.DisplayName != nil { // query param display_name var qrDisplayName string if o.DisplayName != nil { qrDisplayName = *o.DisplayName } qDisplayName := qrDisplayName if qDisplayName != "" { if err := r.SetQueryParam("display_name", qDisplayName); err != nil { return err } } } if o.Email != nil { // query param email var qrEmail string if o.Email != nil { qrEmail = *o.Email } qEmail := qrEmail if qEmail != "" { if err := r.SetQueryParam("email", qEmail); err != nil { return err } } } if o.IP != nil { // query param ip var qrIP string if o.IP != nil { qrIP = *o.IP } qIP := qrIP if qIP != "" { if err := r.SetQueryParam("ip", qIP); err != nil { return err } } } if o.Limit != nil { // query param limit var qrLimit int64 if o.Limit != nil { qrLimit = *o.Limit } qLimit := swag.FormatInt64(qrLimit) if qLimit != "" { if err := r.SetQueryParam("limit", qLimit); err != nil { return err } } } if o.Local != nil { // query param local var qrLocal bool if o.Local != nil { qrLocal = *o.Local } qLocal := swag.FormatBool(qrLocal) if qLocal != "" { if err := r.SetQueryParam("local", qLocal); err != nil { return err } } } if o.MaxID != nil { // query param max_id var qrMaxID string if o.MaxID != nil { qrMaxID = *o.MaxID } qMaxID := qrMaxID if qMaxID != "" { if err := r.SetQueryParam("max_id", qMaxID); err != nil { return err } } } if o.MinID != nil { // query param min_id var qrMinID string if o.MinID != nil { qrMinID = *o.MinID } qMinID := qrMinID if qMinID != "" { if err := r.SetQueryParam("min_id", qMinID); err != nil { return err } } } if o.Pending != nil { // query param pending var qrPending bool if o.Pending != nil { qrPending = *o.Pending } qPending := swag.FormatBool(qrPending) if qPending != "" { if err := r.SetQueryParam("pending", qPending); err != nil { return err } } } if o.Remote != nil { // query param remote var qrRemote bool if o.Remote != nil { qrRemote = *o.Remote } qRemote := swag.FormatBool(qrRemote) if qRemote != "" { if err := r.SetQueryParam("remote", qRemote); err != nil { return err } } } if o.Sensitized != nil { // query param sensitized var qrSensitized bool if o.Sensitized != nil { qrSensitized = *o.Sensitized } qSensitized := swag.FormatBool(qrSensitized) if qSensitized != "" { if err := r.SetQueryParam("sensitized", qSensitized); err != nil { return err } } } if o.Silenced != nil { // query param silenced var qrSilenced bool if o.Silenced != nil { qrSilenced = *o.Silenced } qSilenced := swag.FormatBool(qrSilenced) if qSilenced != "" { if err := r.SetQueryParam("silenced", qSilenced); err != nil { return err } } } if o.Staff != nil { // query param staff var qrStaff bool if o.Staff != nil { qrStaff = *o.Staff } qStaff := swag.FormatBool(qrStaff) if qStaff != "" { if err := r.SetQueryParam("staff", qStaff); err != nil { return err } } } if o.Suspended != nil { // query param suspended var qrSuspended bool if o.Suspended != nil { qrSuspended = *o.Suspended } qSuspended := swag.FormatBool(qrSuspended) if qSuspended != "" { if err := r.SetQueryParam("suspended", qSuspended); err != nil { return err } } } if o.Username != nil { // query param username var qrUsername string if o.Username != nil { qrUsername = *o.Username } qUsername := qrUsername if qUsername != "" { if err := r.SetQueryParam("username", qUsername); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }