339 lines
8.5 KiB
Go
339 lines
8.5 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package activity
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewGetAPIActivitiesParams creates a new GetAPIActivitiesParams 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 NewGetAPIActivitiesParams() *GetAPIActivitiesParams {
|
|
return &GetAPIActivitiesParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewGetAPIActivitiesParamsWithTimeout creates a new GetAPIActivitiesParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewGetAPIActivitiesParamsWithTimeout(timeout time.Duration) *GetAPIActivitiesParams {
|
|
return &GetAPIActivitiesParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewGetAPIActivitiesParamsWithContext creates a new GetAPIActivitiesParams object
|
|
// with the ability to set a context for a request.
|
|
func NewGetAPIActivitiesParamsWithContext(ctx context.Context) *GetAPIActivitiesParams {
|
|
return &GetAPIActivitiesParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewGetAPIActivitiesParamsWithHTTPClient creates a new GetAPIActivitiesParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewGetAPIActivitiesParamsWithHTTPClient(client *http.Client) *GetAPIActivitiesParams {
|
|
return &GetAPIActivitiesParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
GetAPIActivitiesParams contains all the parameters to send to the API endpoint
|
|
|
|
for the get API activities operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type GetAPIActivitiesParams struct {
|
|
|
|
/* Globals.
|
|
|
|
Use if you want to fetch only global activities. Allowed values: true (default: false)
|
|
*/
|
|
Globals string
|
|
|
|
/* GlobalsFirst.
|
|
|
|
Deprecated parameter, value is not used any more
|
|
*/
|
|
GlobalsFirst string
|
|
|
|
/* Order.
|
|
|
|
The result order. Allowed values: ASC, DESC (default: ASC)
|
|
*/
|
|
Order string
|
|
|
|
/* OrderBy.
|
|
|
|
The field by which results will be ordered. Allowed values: id, name, project (default: name)
|
|
*/
|
|
OrderBy string
|
|
|
|
/* Project.
|
|
|
|
Project ID to filter activities
|
|
*/
|
|
Project string
|
|
|
|
/* Projects.
|
|
|
|
Comma separated list of project IDs to filter activities
|
|
*/
|
|
Projects string
|
|
|
|
/* Term.
|
|
|
|
Free search term
|
|
*/
|
|
Term *string
|
|
|
|
/* Visible.
|
|
|
|
Visibility status to filter activities. 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 activities params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *GetAPIActivitiesParams) WithDefaults() *GetAPIActivitiesParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the get API activities params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *GetAPIActivitiesParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithTimeout(timeout time.Duration) *GetAPIActivitiesParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithContext(ctx context.Context) *GetAPIActivitiesParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithHTTPClient(client *http.Client) *GetAPIActivitiesParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithGlobals adds the globals to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithGlobals(globals string) *GetAPIActivitiesParams {
|
|
o.SetGlobals(globals)
|
|
return o
|
|
}
|
|
|
|
// SetGlobals adds the globals to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetGlobals(globals string) {
|
|
o.Globals = globals
|
|
}
|
|
|
|
// WithGlobalsFirst adds the globalsFirst to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithGlobalsFirst(globalsFirst string) *GetAPIActivitiesParams {
|
|
o.SetGlobalsFirst(globalsFirst)
|
|
return o
|
|
}
|
|
|
|
// SetGlobalsFirst adds the globalsFirst to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetGlobalsFirst(globalsFirst string) {
|
|
o.GlobalsFirst = globalsFirst
|
|
}
|
|
|
|
// WithOrder adds the order to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithOrder(order string) *GetAPIActivitiesParams {
|
|
o.SetOrder(order)
|
|
return o
|
|
}
|
|
|
|
// SetOrder adds the order to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetOrder(order string) {
|
|
o.Order = order
|
|
}
|
|
|
|
// WithOrderBy adds the orderBy to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithOrderBy(orderBy string) *GetAPIActivitiesParams {
|
|
o.SetOrderBy(orderBy)
|
|
return o
|
|
}
|
|
|
|
// SetOrderBy adds the orderBy to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetOrderBy(orderBy string) {
|
|
o.OrderBy = orderBy
|
|
}
|
|
|
|
// WithProject adds the project to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithProject(project string) *GetAPIActivitiesParams {
|
|
o.SetProject(project)
|
|
return o
|
|
}
|
|
|
|
// SetProject adds the project to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetProject(project string) {
|
|
o.Project = project
|
|
}
|
|
|
|
// WithProjects adds the projects to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithProjects(projects string) *GetAPIActivitiesParams {
|
|
o.SetProjects(projects)
|
|
return o
|
|
}
|
|
|
|
// SetProjects adds the projects to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetProjects(projects string) {
|
|
o.Projects = projects
|
|
}
|
|
|
|
// WithTerm adds the term to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithTerm(term *string) *GetAPIActivitiesParams {
|
|
o.SetTerm(term)
|
|
return o
|
|
}
|
|
|
|
// SetTerm adds the term to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetTerm(term *string) {
|
|
o.Term = term
|
|
}
|
|
|
|
// WithVisible adds the visible to the get API activities params
|
|
func (o *GetAPIActivitiesParams) WithVisible(visible string) *GetAPIActivitiesParams {
|
|
o.SetVisible(visible)
|
|
return o
|
|
}
|
|
|
|
// SetVisible adds the visible to the get API activities params
|
|
func (o *GetAPIActivitiesParams) SetVisible(visible string) {
|
|
o.Visible = visible
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *GetAPIActivitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
// query param globals
|
|
qrGlobals := o.Globals
|
|
qGlobals := qrGlobals
|
|
|
|
if err := r.SetQueryParam("globals", qGlobals); err != nil {
|
|
return err
|
|
}
|
|
|
|
// query param globalsFirst
|
|
qrGlobalsFirst := o.GlobalsFirst
|
|
qGlobalsFirst := qrGlobalsFirst
|
|
|
|
if err := r.SetQueryParam("globalsFirst", qGlobalsFirst); err != nil {
|
|
return err
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// query param project
|
|
qrProject := o.Project
|
|
qProject := qrProject
|
|
|
|
if err := r.SetQueryParam("project", qProject); err != nil {
|
|
return err
|
|
}
|
|
|
|
// query param projects
|
|
qrProjects := o.Projects
|
|
qProjects := qrProjects
|
|
|
|
if err := r.SetQueryParam("projects", qProjects); 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
|
|
}
|