All checks were successful
continuous-integration/drone/push Build is passing
597 lines
14 KiB
Go
597 lines
14 KiB
Go
// 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"
|
|
)
|
|
|
|
// NewAdminAccountsGetV2Params creates a new AdminAccountsGetV2Params 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 NewAdminAccountsGetV2Params() *AdminAccountsGetV2Params {
|
|
return &AdminAccountsGetV2Params{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminAccountsGetV2ParamsWithTimeout creates a new AdminAccountsGetV2Params object
|
|
// with the ability to set a timeout on a request.
|
|
func NewAdminAccountsGetV2ParamsWithTimeout(timeout time.Duration) *AdminAccountsGetV2Params {
|
|
return &AdminAccountsGetV2Params{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminAccountsGetV2ParamsWithContext creates a new AdminAccountsGetV2Params object
|
|
// with the ability to set a context for a request.
|
|
func NewAdminAccountsGetV2ParamsWithContext(ctx context.Context) *AdminAccountsGetV2Params {
|
|
return &AdminAccountsGetV2Params{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewAdminAccountsGetV2ParamsWithHTTPClient creates a new AdminAccountsGetV2Params object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewAdminAccountsGetV2ParamsWithHTTPClient(client *http.Client) *AdminAccountsGetV2Params {
|
|
return &AdminAccountsGetV2Params{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
AdminAccountsGetV2Params contains all the parameters to send to the API endpoint
|
|
|
|
for the admin accounts get v2 operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type AdminAccountsGetV2Params struct {
|
|
|
|
/* ByDomain.
|
|
|
|
Filter by the given domain.
|
|
*/
|
|
ByDomain *string
|
|
|
|
/* DisplayName.
|
|
|
|
Search for the given display name.
|
|
*/
|
|
DisplayName *string
|
|
|
|
/* Email.
|
|
|
|
Lookup a user with this email.
|
|
*/
|
|
Email *string
|
|
|
|
/* InvitedBy.
|
|
|
|
Lookup users invited by the account with this ID.
|
|
*/
|
|
InvitedBy *string
|
|
|
|
/* IP.
|
|
|
|
Lookup users with this IP address.
|
|
*/
|
|
IP *string
|
|
|
|
/* Limit.
|
|
|
|
Maximum number of results to return.
|
|
|
|
Default: 50
|
|
*/
|
|
Limit *int64
|
|
|
|
/* 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
|
|
|
|
/* Origin.
|
|
|
|
Filter for `local` or `remote` accounts.
|
|
*/
|
|
Origin *string
|
|
|
|
/* Permissions.
|
|
|
|
Filter for accounts with staff permissions (users that can manage reports).
|
|
*/
|
|
Permissions *string
|
|
|
|
/* RoleIds.
|
|
|
|
Filter for users with these roles.
|
|
*/
|
|
RoleIds []string
|
|
|
|
/* Status.
|
|
|
|
Filter for `active`, `pending`, `disabled`, `silenced`, or `suspended` accounts.
|
|
*/
|
|
Status *string
|
|
|
|
/* 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 v2 params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminAccountsGetV2Params) WithDefaults() *AdminAccountsGetV2Params {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the admin accounts get v2 params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminAccountsGetV2Params) SetDefaults() {
|
|
var (
|
|
limitDefault = int64(50)
|
|
)
|
|
|
|
val := AdminAccountsGetV2Params{
|
|
Limit: &limitDefault,
|
|
}
|
|
|
|
val.timeout = o.timeout
|
|
val.Context = o.Context
|
|
val.HTTPClient = o.HTTPClient
|
|
*o = val
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithTimeout(timeout time.Duration) *AdminAccountsGetV2Params {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithContext(ctx context.Context) *AdminAccountsGetV2Params {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithHTTPClient(client *http.Client) *AdminAccountsGetV2Params {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithByDomain adds the byDomain to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithByDomain(byDomain *string) *AdminAccountsGetV2Params {
|
|
o.SetByDomain(byDomain)
|
|
return o
|
|
}
|
|
|
|
// SetByDomain adds the byDomain to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetByDomain(byDomain *string) {
|
|
o.ByDomain = byDomain
|
|
}
|
|
|
|
// WithDisplayName adds the displayName to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithDisplayName(displayName *string) *AdminAccountsGetV2Params {
|
|
o.SetDisplayName(displayName)
|
|
return o
|
|
}
|
|
|
|
// SetDisplayName adds the displayName to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetDisplayName(displayName *string) {
|
|
o.DisplayName = displayName
|
|
}
|
|
|
|
// WithEmail adds the email to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithEmail(email *string) *AdminAccountsGetV2Params {
|
|
o.SetEmail(email)
|
|
return o
|
|
}
|
|
|
|
// SetEmail adds the email to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetEmail(email *string) {
|
|
o.Email = email
|
|
}
|
|
|
|
// WithInvitedBy adds the invitedBy to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithInvitedBy(invitedBy *string) *AdminAccountsGetV2Params {
|
|
o.SetInvitedBy(invitedBy)
|
|
return o
|
|
}
|
|
|
|
// SetInvitedBy adds the invitedBy to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetInvitedBy(invitedBy *string) {
|
|
o.InvitedBy = invitedBy
|
|
}
|
|
|
|
// WithIP adds the ip to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithIP(ip *string) *AdminAccountsGetV2Params {
|
|
o.SetIP(ip)
|
|
return o
|
|
}
|
|
|
|
// SetIP adds the ip to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetIP(ip *string) {
|
|
o.IP = ip
|
|
}
|
|
|
|
// WithLimit adds the limit to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithLimit(limit *int64) *AdminAccountsGetV2Params {
|
|
o.SetLimit(limit)
|
|
return o
|
|
}
|
|
|
|
// SetLimit adds the limit to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetLimit(limit *int64) {
|
|
o.Limit = limit
|
|
}
|
|
|
|
// WithMaxID adds the maxID to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithMaxID(maxID *string) *AdminAccountsGetV2Params {
|
|
o.SetMaxID(maxID)
|
|
return o
|
|
}
|
|
|
|
// SetMaxID adds the maxId to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetMaxID(maxID *string) {
|
|
o.MaxID = maxID
|
|
}
|
|
|
|
// WithMinID adds the minID to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithMinID(minID *string) *AdminAccountsGetV2Params {
|
|
o.SetMinID(minID)
|
|
return o
|
|
}
|
|
|
|
// SetMinID adds the minId to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetMinID(minID *string) {
|
|
o.MinID = minID
|
|
}
|
|
|
|
// WithOrigin adds the origin to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithOrigin(origin *string) *AdminAccountsGetV2Params {
|
|
o.SetOrigin(origin)
|
|
return o
|
|
}
|
|
|
|
// SetOrigin adds the origin to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetOrigin(origin *string) {
|
|
o.Origin = origin
|
|
}
|
|
|
|
// WithPermissions adds the permissions to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithPermissions(permissions *string) *AdminAccountsGetV2Params {
|
|
o.SetPermissions(permissions)
|
|
return o
|
|
}
|
|
|
|
// SetPermissions adds the permissions to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetPermissions(permissions *string) {
|
|
o.Permissions = permissions
|
|
}
|
|
|
|
// WithRoleIds adds the roleIds to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithRoleIds(roleIds []string) *AdminAccountsGetV2Params {
|
|
o.SetRoleIds(roleIds)
|
|
return o
|
|
}
|
|
|
|
// SetRoleIds adds the roleIds to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetRoleIds(roleIds []string) {
|
|
o.RoleIds = roleIds
|
|
}
|
|
|
|
// WithStatus adds the status to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithStatus(status *string) *AdminAccountsGetV2Params {
|
|
o.SetStatus(status)
|
|
return o
|
|
}
|
|
|
|
// SetStatus adds the status to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetStatus(status *string) {
|
|
o.Status = status
|
|
}
|
|
|
|
// WithUsername adds the username to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) WithUsername(username *string) *AdminAccountsGetV2Params {
|
|
o.SetUsername(username)
|
|
return o
|
|
}
|
|
|
|
// SetUsername adds the username to the admin accounts get v2 params
|
|
func (o *AdminAccountsGetV2Params) SetUsername(username *string) {
|
|
o.Username = username
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *AdminAccountsGetV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
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.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.InvitedBy != nil {
|
|
|
|
// query param invited_by
|
|
var qrInvitedBy string
|
|
|
|
if o.InvitedBy != nil {
|
|
qrInvitedBy = *o.InvitedBy
|
|
}
|
|
qInvitedBy := qrInvitedBy
|
|
if qInvitedBy != "" {
|
|
|
|
if err := r.SetQueryParam("invited_by", qInvitedBy); 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.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.Origin != nil {
|
|
|
|
// query param origin
|
|
var qrOrigin string
|
|
|
|
if o.Origin != nil {
|
|
qrOrigin = *o.Origin
|
|
}
|
|
qOrigin := qrOrigin
|
|
if qOrigin != "" {
|
|
|
|
if err := r.SetQueryParam("origin", qOrigin); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.Permissions != nil {
|
|
|
|
// query param permissions
|
|
var qrPermissions string
|
|
|
|
if o.Permissions != nil {
|
|
qrPermissions = *o.Permissions
|
|
}
|
|
qPermissions := qrPermissions
|
|
if qPermissions != "" {
|
|
|
|
if err := r.SetQueryParam("permissions", qPermissions); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.RoleIds != nil {
|
|
|
|
// binding items for role_ids[]
|
|
joinedRoleIds := o.bindParamRoleIds(reg)
|
|
|
|
// query array param role_ids[]
|
|
if err := r.SetQueryParam("role_ids[]", joinedRoleIds...); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if o.Status != nil {
|
|
|
|
// query param status
|
|
var qrStatus string
|
|
|
|
if o.Status != nil {
|
|
qrStatus = *o.Status
|
|
}
|
|
qStatus := qrStatus
|
|
if qStatus != "" {
|
|
|
|
if err := r.SetQueryParam("status", qStatus); 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
|
|
}
|
|
|
|
// bindParamAdminAccountsGetV2 binds the parameter role_ids[]
|
|
func (o *AdminAccountsGetV2Params) bindParamRoleIds(formats strfmt.Registry) []string {
|
|
roleIdsIR := o.RoleIds
|
|
|
|
var roleIdsIC []string
|
|
for _, roleIdsIIR := range roleIdsIR { // explode []string
|
|
|
|
roleIdsIIV := roleIdsIIR // string as string
|
|
roleIdsIC = append(roleIdsIC, roleIdsIIV)
|
|
}
|
|
|
|
// items.CollectionFormat: ""
|
|
roleIdsIS := swag.JoinByFormat(roleIdsIC, "")
|
|
|
|
return roleIdsIS
|
|
}
|