All checks were successful
continuous-integration/drone/push Build is passing
382 lines
8.9 KiB
Go
382 lines
8.9 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"
|
|
)
|
|
|
|
// NewAdminReportsParams creates a new AdminReportsParams 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 NewAdminReportsParams() *AdminReportsParams {
|
|
return &AdminReportsParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminReportsParamsWithTimeout creates a new AdminReportsParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewAdminReportsParamsWithTimeout(timeout time.Duration) *AdminReportsParams {
|
|
return &AdminReportsParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewAdminReportsParamsWithContext creates a new AdminReportsParams object
|
|
// with the ability to set a context for a request.
|
|
func NewAdminReportsParamsWithContext(ctx context.Context) *AdminReportsParams {
|
|
return &AdminReportsParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewAdminReportsParamsWithHTTPClient creates a new AdminReportsParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewAdminReportsParamsWithHTTPClient(client *http.Client) *AdminReportsParams {
|
|
return &AdminReportsParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
AdminReportsParams contains all the parameters to send to the API endpoint
|
|
|
|
for the admin reports operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type AdminReportsParams struct {
|
|
|
|
/* AccountID.
|
|
|
|
Return only reports created by the given account id.
|
|
*/
|
|
AccountID *string
|
|
|
|
/* Limit.
|
|
|
|
Number of reports to return.
|
|
|
|
Default: 20
|
|
*/
|
|
Limit *int64
|
|
|
|
/* MaxID.
|
|
|
|
Return only reports *OLDER* than the given max ID (for paging downwards). The report with the specified ID will not be included in the response.
|
|
*/
|
|
MaxID *string
|
|
|
|
/* MinID.
|
|
|
|
Return only reports immediately *NEWER* than the given min ID (for paging upwards). The report with the specified ID will not be included in the response.
|
|
*/
|
|
MinID *string
|
|
|
|
/* Resolved.
|
|
|
|
If set to true, only resolved reports will be returned. If false, only unresolved reports will be returned. If unset, reports will not be filtered on their resolved status.
|
|
*/
|
|
Resolved *bool
|
|
|
|
/* SinceID.
|
|
|
|
Return only reports *NEWER* than the given since ID. The report with the specified ID will not be included in the response.
|
|
*/
|
|
SinceID *string
|
|
|
|
/* TargetAccountID.
|
|
|
|
Return only reports that target the given account id.
|
|
*/
|
|
TargetAccountID *string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the admin reports params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminReportsParams) WithDefaults() *AdminReportsParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the admin reports params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AdminReportsParams) SetDefaults() {
|
|
var (
|
|
limitDefault = int64(20)
|
|
)
|
|
|
|
val := AdminReportsParams{
|
|
Limit: &limitDefault,
|
|
}
|
|
|
|
val.timeout = o.timeout
|
|
val.Context = o.Context
|
|
val.HTTPClient = o.HTTPClient
|
|
*o = val
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the admin reports params
|
|
func (o *AdminReportsParams) WithTimeout(timeout time.Duration) *AdminReportsParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the admin reports params
|
|
func (o *AdminReportsParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the admin reports params
|
|
func (o *AdminReportsParams) WithContext(ctx context.Context) *AdminReportsParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the admin reports params
|
|
func (o *AdminReportsParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the admin reports params
|
|
func (o *AdminReportsParams) WithHTTPClient(client *http.Client) *AdminReportsParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the admin reports params
|
|
func (o *AdminReportsParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithAccountID adds the accountID to the admin reports params
|
|
func (o *AdminReportsParams) WithAccountID(accountID *string) *AdminReportsParams {
|
|
o.SetAccountID(accountID)
|
|
return o
|
|
}
|
|
|
|
// SetAccountID adds the accountId to the admin reports params
|
|
func (o *AdminReportsParams) SetAccountID(accountID *string) {
|
|
o.AccountID = accountID
|
|
}
|
|
|
|
// WithLimit adds the limit to the admin reports params
|
|
func (o *AdminReportsParams) WithLimit(limit *int64) *AdminReportsParams {
|
|
o.SetLimit(limit)
|
|
return o
|
|
}
|
|
|
|
// SetLimit adds the limit to the admin reports params
|
|
func (o *AdminReportsParams) SetLimit(limit *int64) {
|
|
o.Limit = limit
|
|
}
|
|
|
|
// WithMaxID adds the maxID to the admin reports params
|
|
func (o *AdminReportsParams) WithMaxID(maxID *string) *AdminReportsParams {
|
|
o.SetMaxID(maxID)
|
|
return o
|
|
}
|
|
|
|
// SetMaxID adds the maxId to the admin reports params
|
|
func (o *AdminReportsParams) SetMaxID(maxID *string) {
|
|
o.MaxID = maxID
|
|
}
|
|
|
|
// WithMinID adds the minID to the admin reports params
|
|
func (o *AdminReportsParams) WithMinID(minID *string) *AdminReportsParams {
|
|
o.SetMinID(minID)
|
|
return o
|
|
}
|
|
|
|
// SetMinID adds the minId to the admin reports params
|
|
func (o *AdminReportsParams) SetMinID(minID *string) {
|
|
o.MinID = minID
|
|
}
|
|
|
|
// WithResolved adds the resolved to the admin reports params
|
|
func (o *AdminReportsParams) WithResolved(resolved *bool) *AdminReportsParams {
|
|
o.SetResolved(resolved)
|
|
return o
|
|
}
|
|
|
|
// SetResolved adds the resolved to the admin reports params
|
|
func (o *AdminReportsParams) SetResolved(resolved *bool) {
|
|
o.Resolved = resolved
|
|
}
|
|
|
|
// WithSinceID adds the sinceID to the admin reports params
|
|
func (o *AdminReportsParams) WithSinceID(sinceID *string) *AdminReportsParams {
|
|
o.SetSinceID(sinceID)
|
|
return o
|
|
}
|
|
|
|
// SetSinceID adds the sinceId to the admin reports params
|
|
func (o *AdminReportsParams) SetSinceID(sinceID *string) {
|
|
o.SinceID = sinceID
|
|
}
|
|
|
|
// WithTargetAccountID adds the targetAccountID to the admin reports params
|
|
func (o *AdminReportsParams) WithTargetAccountID(targetAccountID *string) *AdminReportsParams {
|
|
o.SetTargetAccountID(targetAccountID)
|
|
return o
|
|
}
|
|
|
|
// SetTargetAccountID adds the targetAccountId to the admin reports params
|
|
func (o *AdminReportsParams) SetTargetAccountID(targetAccountID *string) {
|
|
o.TargetAccountID = targetAccountID
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *AdminReportsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.AccountID != nil {
|
|
|
|
// query param account_id
|
|
var qrAccountID string
|
|
|
|
if o.AccountID != nil {
|
|
qrAccountID = *o.AccountID
|
|
}
|
|
qAccountID := qrAccountID
|
|
if qAccountID != "" {
|
|
|
|
if err := r.SetQueryParam("account_id", qAccountID); 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.Resolved != nil {
|
|
|
|
// query param resolved
|
|
var qrResolved bool
|
|
|
|
if o.Resolved != nil {
|
|
qrResolved = *o.Resolved
|
|
}
|
|
qResolved := swag.FormatBool(qrResolved)
|
|
if qResolved != "" {
|
|
|
|
if err := r.SetQueryParam("resolved", qResolved); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.SinceID != nil {
|
|
|
|
// query param since_id
|
|
var qrSinceID string
|
|
|
|
if o.SinceID != nil {
|
|
qrSinceID = *o.SinceID
|
|
}
|
|
qSinceID := qrSinceID
|
|
if qSinceID != "" {
|
|
|
|
if err := r.SetQueryParam("since_id", qSinceID); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.TargetAccountID != nil {
|
|
|
|
// query param target_account_id
|
|
var qrTargetAccountID string
|
|
|
|
if o.TargetAccountID != nil {
|
|
qrTargetAccountID = *o.TargetAccountID
|
|
}
|
|
qTargetAccountID := qrTargetAccountID
|
|
if qTargetAccountID != "" {
|
|
|
|
if err := r.SetQueryParam("target_account_id", qTargetAccountID); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|