go-kimai/client/project/get_api_projects_parameters.go

393 lines
9.8 KiB
Go
Raw Normal View History

2023-01-14 14:14:06 +00:00
// Code generated by go-swagger; DO NOT EDIT.
package project
// 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"
)
// NewGetAPIProjectsParams creates a new GetAPIProjectsParams 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 NewGetAPIProjectsParams() *GetAPIProjectsParams {
return &GetAPIProjectsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAPIProjectsParamsWithTimeout creates a new GetAPIProjectsParams object
// with the ability to set a timeout on a request.
func NewGetAPIProjectsParamsWithTimeout(timeout time.Duration) *GetAPIProjectsParams {
return &GetAPIProjectsParams{
timeout: timeout,
}
}
// NewGetAPIProjectsParamsWithContext creates a new GetAPIProjectsParams object
// with the ability to set a context for a request.
func NewGetAPIProjectsParamsWithContext(ctx context.Context) *GetAPIProjectsParams {
return &GetAPIProjectsParams{
Context: ctx,
}
}
// NewGetAPIProjectsParamsWithHTTPClient creates a new GetAPIProjectsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAPIProjectsParamsWithHTTPClient(client *http.Client) *GetAPIProjectsParams {
return &GetAPIProjectsParams{
HTTPClient: client,
}
}
/*
GetAPIProjectsParams contains all the parameters to send to the API endpoint
for the get API projects operation.
Typically these are written to a http.Request.
*/
type GetAPIProjectsParams struct {
/* Customer.
Customer ID to filter projects
*/
Customer string
/* Customers.
Comma separated list of customer IDs to filter projects
*/
Customers string
/* End.
Only projects that ended after this date will be included. Allowed format: HTML5 (default: now, if start is also empty)
Format: DateTime
*/
End string
/* GlobalActivities.
If given, filters projects by their 'global activity' support. Allowed values: 1 (supports global activities) and 0 (without global activities) (default: all)
*/
GlobalActivities string
/* IgnoreDates.
If set, start and end are completely ignored. Allowed values: 1 (default: off)
*/
IgnoreDates 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, customer (default: name)
*/
OrderBy string
/* Start.
Only projects that started before this date will be included. Allowed format: HTML5 (default: now, if end is also empty)
Format: DateTime
*/
Start string
/* Term.
Free search term
*/
Term *string
/* Visible.
Visibility status to filter projects. Allowed values: 1=visible, 2=hidden, 3=both (default: 1)
*/
Visible string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get API projects params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIProjectsParams) WithDefaults() *GetAPIProjectsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get API projects params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIProjectsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get API projects params
func (o *GetAPIProjectsParams) WithTimeout(timeout time.Duration) *GetAPIProjectsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get API projects params
func (o *GetAPIProjectsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get API projects params
func (o *GetAPIProjectsParams) WithContext(ctx context.Context) *GetAPIProjectsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get API projects params
func (o *GetAPIProjectsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get API projects params
func (o *GetAPIProjectsParams) WithHTTPClient(client *http.Client) *GetAPIProjectsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get API projects params
func (o *GetAPIProjectsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithCustomer adds the customer to the get API projects params
func (o *GetAPIProjectsParams) WithCustomer(customer string) *GetAPIProjectsParams {
o.SetCustomer(customer)
return o
}
// SetCustomer adds the customer to the get API projects params
func (o *GetAPIProjectsParams) SetCustomer(customer string) {
o.Customer = customer
}
// WithCustomers adds the customers to the get API projects params
func (o *GetAPIProjectsParams) WithCustomers(customers string) *GetAPIProjectsParams {
o.SetCustomers(customers)
return o
}
// SetCustomers adds the customers to the get API projects params
func (o *GetAPIProjectsParams) SetCustomers(customers string) {
o.Customers = customers
}
// WithEnd adds the end to the get API projects params
func (o *GetAPIProjectsParams) WithEnd(end string) *GetAPIProjectsParams {
o.SetEnd(end)
return o
}
// SetEnd adds the end to the get API projects params
func (o *GetAPIProjectsParams) SetEnd(end string) {
o.End = end
}
// WithGlobalActivities adds the globalActivities to the get API projects params
func (o *GetAPIProjectsParams) WithGlobalActivities(globalActivities string) *GetAPIProjectsParams {
o.SetGlobalActivities(globalActivities)
return o
}
// SetGlobalActivities adds the globalActivities to the get API projects params
func (o *GetAPIProjectsParams) SetGlobalActivities(globalActivities string) {
o.GlobalActivities = globalActivities
}
// WithIgnoreDates adds the ignoreDates to the get API projects params
func (o *GetAPIProjectsParams) WithIgnoreDates(ignoreDates string) *GetAPIProjectsParams {
o.SetIgnoreDates(ignoreDates)
return o
}
// SetIgnoreDates adds the ignoreDates to the get API projects params
func (o *GetAPIProjectsParams) SetIgnoreDates(ignoreDates string) {
o.IgnoreDates = ignoreDates
}
// WithOrder adds the order to the get API projects params
func (o *GetAPIProjectsParams) WithOrder(order string) *GetAPIProjectsParams {
o.SetOrder(order)
return o
}
// SetOrder adds the order to the get API projects params
func (o *GetAPIProjectsParams) SetOrder(order string) {
o.Order = order
}
// WithOrderBy adds the orderBy to the get API projects params
func (o *GetAPIProjectsParams) WithOrderBy(orderBy string) *GetAPIProjectsParams {
o.SetOrderBy(orderBy)
return o
}
// SetOrderBy adds the orderBy to the get API projects params
func (o *GetAPIProjectsParams) SetOrderBy(orderBy string) {
o.OrderBy = orderBy
}
// WithStart adds the start to the get API projects params
func (o *GetAPIProjectsParams) WithStart(start string) *GetAPIProjectsParams {
o.SetStart(start)
return o
}
// SetStart adds the start to the get API projects params
func (o *GetAPIProjectsParams) SetStart(start string) {
o.Start = start
}
// WithTerm adds the term to the get API projects params
func (o *GetAPIProjectsParams) WithTerm(term *string) *GetAPIProjectsParams {
o.SetTerm(term)
return o
}
// SetTerm adds the term to the get API projects params
func (o *GetAPIProjectsParams) SetTerm(term *string) {
o.Term = term
}
// WithVisible adds the visible to the get API projects params
func (o *GetAPIProjectsParams) WithVisible(visible string) *GetAPIProjectsParams {
o.SetVisible(visible)
return o
}
// SetVisible adds the visible to the get API projects params
func (o *GetAPIProjectsParams) SetVisible(visible string) {
o.Visible = visible
}
// WriteToRequest writes these params to a swagger request
func (o *GetAPIProjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param customer
qrCustomer := o.Customer
qCustomer := qrCustomer
if err := r.SetQueryParam("customer", qCustomer); err != nil {
return err
}
// query param customers
qrCustomers := o.Customers
qCustomers := qrCustomers
if err := r.SetQueryParam("customers", qCustomers); err != nil {
return err
}
// query param end
qrEnd := o.End
qEnd := qrEnd
if err := r.SetQueryParam("end", qEnd); err != nil {
return err
}
// query param globalActivities
qrGlobalActivities := o.GlobalActivities
qGlobalActivities := qrGlobalActivities
if err := r.SetQueryParam("globalActivities", qGlobalActivities); err != nil {
return err
}
// query param ignoreDates
qrIgnoreDates := o.IgnoreDates
qIgnoreDates := qrIgnoreDates
if err := r.SetQueryParam("ignoreDates", qIgnoreDates); 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 start
qrStart := o.Start
qStart := qrStart
if err := r.SetQueryParam("start", qStart); 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
}