go-kimai/client/timesheet/get_api_timesheets_parameters.go

816 lines
18 KiB
Go
Raw Normal View History

2023-01-14 14:14:06 +00:00
// Code generated by go-swagger; DO NOT EDIT.
package timesheet
// 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"
)
// NewGetAPITimesheetsParams creates a new GetAPITimesheetsParams 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 NewGetAPITimesheetsParams() *GetAPITimesheetsParams {
return &GetAPITimesheetsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAPITimesheetsParamsWithTimeout creates a new GetAPITimesheetsParams object
// with the ability to set a timeout on a request.
func NewGetAPITimesheetsParamsWithTimeout(timeout time.Duration) *GetAPITimesheetsParams {
return &GetAPITimesheetsParams{
timeout: timeout,
}
}
// NewGetAPITimesheetsParamsWithContext creates a new GetAPITimesheetsParams object
// with the ability to set a context for a request.
func NewGetAPITimesheetsParamsWithContext(ctx context.Context) *GetAPITimesheetsParams {
return &GetAPITimesheetsParams{
Context: ctx,
}
}
// NewGetAPITimesheetsParamsWithHTTPClient creates a new GetAPITimesheetsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAPITimesheetsParamsWithHTTPClient(client *http.Client) *GetAPITimesheetsParams {
return &GetAPITimesheetsParams{
HTTPClient: client,
}
}
/*
GetAPITimesheetsParams contains all the parameters to send to the API endpoint
for the get API timesheets operation.
Typically these are written to a http.Request.
*/
type GetAPITimesheetsParams struct {
/* Active.
Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all)
*/
Active *string
2023-01-14 14:14:06 +00:00
/* Activities.
Comma separated list of activity IDs to filter timesheets
*/
Activities *string
2023-01-14 14:14:06 +00:00
/* Activity.
DEPRECATED: Activity ID to filter timesheets (will be removed with 2.0)
*/
Activity *string
2023-01-14 14:14:06 +00:00
/* Begin.
Only records after this date will be included (format: HTML5)
Format: DateTime
*/
Begin *string
2023-01-14 14:14:06 +00:00
/* Billable.
Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all)
*/
Billable *string
2023-01-14 14:14:06 +00:00
/* Customer.
DEPRECATED: Customer ID to filter timesheets (will be removed with 2.0)
*/
Customer *string
2023-01-14 14:14:06 +00:00
/* Customers.
Comma separated list of customer IDs to filter timesheets
*/
Customers *string
2023-01-14 14:14:06 +00:00
/* End.
Only records before this date will be included (format: HTML5)
Format: DateTime
*/
End *string
2023-01-14 14:14:06 +00:00
/* Exported.
Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)
*/
Exported *string
2023-01-14 14:14:06 +00:00
/* Full.
Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false)
*/
Full *string
2023-01-14 14:14:06 +00:00
/* ModifiedAfter.
Only records changed after this date will be included (format: HTML5). Available since Kimai 1.10 and works only for records that were created/updated since then.
Format: DateTime
*/
ModifiedAfter *string
2023-01-14 14:14:06 +00:00
/* Order.
The result order. Allowed values: ASC, DESC (default: DESC)
*/
Order *string
2023-01-14 14:14:06 +00:00
/* OrderBy.
The field by which results will be ordered. Allowed values: id, begin, end, rate (default: begin)
*/
OrderBy *string
2023-01-14 14:14:06 +00:00
/* Page.
The page to display, renders a 404 if not found (default: 1)
*/
Page *string
2023-01-14 14:14:06 +00:00
/* Project.
DEPRECATED: Project ID to filter timesheets (will be removed with 2.0)
*/
Project *string
2023-01-14 14:14:06 +00:00
/* Projects.
Comma separated list of project IDs to filter timesheets
*/
Projects *string
2023-01-14 14:14:06 +00:00
/* Size.
The amount of entries for each page (default: 50)
*/
Size *string
2023-01-14 14:14:06 +00:00
/* Tags.
Comma separated list of tag names
*/
Tags *string
2023-01-14 14:14:06 +00:00
/* Term.
Free search term
*/
Term *string
/* User.
User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user)
*/
User *string
2023-01-14 14:14:06 +00:00
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get API timesheets params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPITimesheetsParams) WithDefaults() *GetAPITimesheetsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get API timesheets params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPITimesheetsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get API timesheets params
func (o *GetAPITimesheetsParams) WithTimeout(timeout time.Duration) *GetAPITimesheetsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get API timesheets params
func (o *GetAPITimesheetsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get API timesheets params
func (o *GetAPITimesheetsParams) WithContext(ctx context.Context) *GetAPITimesheetsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get API timesheets params
func (o *GetAPITimesheetsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get API timesheets params
func (o *GetAPITimesheetsParams) WithHTTPClient(client *http.Client) *GetAPITimesheetsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get API timesheets params
func (o *GetAPITimesheetsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithActive adds the active to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActive(active *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetActive(active)
return o
}
// SetActive adds the active to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActive(active *string) {
2023-01-14 14:14:06 +00:00
o.Active = active
}
// WithActivities adds the activities to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActivities(activities *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetActivities(activities)
return o
}
// SetActivities adds the activities to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActivities(activities *string) {
2023-01-14 14:14:06 +00:00
o.Activities = activities
}
// WithActivity adds the activity to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActivity(activity *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetActivity(activity)
return o
}
// SetActivity adds the activity to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActivity(activity *string) {
2023-01-14 14:14:06 +00:00
o.Activity = activity
}
// WithBegin adds the begin to the get API timesheets params
func (o *GetAPITimesheetsParams) WithBegin(begin *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetBegin(begin)
return o
}
// SetBegin adds the begin to the get API timesheets params
func (o *GetAPITimesheetsParams) SetBegin(begin *string) {
2023-01-14 14:14:06 +00:00
o.Begin = begin
}
// WithBillable adds the billable to the get API timesheets params
func (o *GetAPITimesheetsParams) WithBillable(billable *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetBillable(billable)
return o
}
// SetBillable adds the billable to the get API timesheets params
func (o *GetAPITimesheetsParams) SetBillable(billable *string) {
2023-01-14 14:14:06 +00:00
o.Billable = billable
}
// WithCustomer adds the customer to the get API timesheets params
func (o *GetAPITimesheetsParams) WithCustomer(customer *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetCustomer(customer)
return o
}
// SetCustomer adds the customer to the get API timesheets params
func (o *GetAPITimesheetsParams) SetCustomer(customer *string) {
2023-01-14 14:14:06 +00:00
o.Customer = customer
}
// WithCustomers adds the customers to the get API timesheets params
func (o *GetAPITimesheetsParams) WithCustomers(customers *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetCustomers(customers)
return o
}
// SetCustomers adds the customers to the get API timesheets params
func (o *GetAPITimesheetsParams) SetCustomers(customers *string) {
2023-01-14 14:14:06 +00:00
o.Customers = customers
}
// WithEnd adds the end to the get API timesheets params
func (o *GetAPITimesheetsParams) WithEnd(end *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetEnd(end)
return o
}
// SetEnd adds the end to the get API timesheets params
func (o *GetAPITimesheetsParams) SetEnd(end *string) {
2023-01-14 14:14:06 +00:00
o.End = end
}
// WithExported adds the exported to the get API timesheets params
func (o *GetAPITimesheetsParams) WithExported(exported *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetExported(exported)
return o
}
// SetExported adds the exported to the get API timesheets params
func (o *GetAPITimesheetsParams) SetExported(exported *string) {
2023-01-14 14:14:06 +00:00
o.Exported = exported
}
// WithFull adds the full to the get API timesheets params
func (o *GetAPITimesheetsParams) WithFull(full *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetFull(full)
return o
}
// SetFull adds the full to the get API timesheets params
func (o *GetAPITimesheetsParams) SetFull(full *string) {
2023-01-14 14:14:06 +00:00
o.Full = full
}
// WithModifiedAfter adds the modifiedAfter to the get API timesheets params
func (o *GetAPITimesheetsParams) WithModifiedAfter(modifiedAfter *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetModifiedAfter(modifiedAfter)
return o
}
// SetModifiedAfter adds the modifiedAfter to the get API timesheets params
func (o *GetAPITimesheetsParams) SetModifiedAfter(modifiedAfter *string) {
2023-01-14 14:14:06 +00:00
o.ModifiedAfter = modifiedAfter
}
// WithOrder adds the order to the get API timesheets params
func (o *GetAPITimesheetsParams) WithOrder(order *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetOrder(order)
return o
}
// SetOrder adds the order to the get API timesheets params
func (o *GetAPITimesheetsParams) SetOrder(order *string) {
2023-01-14 14:14:06 +00:00
o.Order = order
}
// WithOrderBy adds the orderBy to the get API timesheets params
func (o *GetAPITimesheetsParams) WithOrderBy(orderBy *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetOrderBy(orderBy)
return o
}
// SetOrderBy adds the orderBy to the get API timesheets params
func (o *GetAPITimesheetsParams) SetOrderBy(orderBy *string) {
2023-01-14 14:14:06 +00:00
o.OrderBy = orderBy
}
// WithPage adds the page to the get API timesheets params
func (o *GetAPITimesheetsParams) WithPage(page *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetPage(page)
return o
}
// SetPage adds the page to the get API timesheets params
func (o *GetAPITimesheetsParams) SetPage(page *string) {
2023-01-14 14:14:06 +00:00
o.Page = page
}
// WithProject adds the project to the get API timesheets params
func (o *GetAPITimesheetsParams) WithProject(project *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetProject(project)
return o
}
// SetProject adds the project to the get API timesheets params
func (o *GetAPITimesheetsParams) SetProject(project *string) {
2023-01-14 14:14:06 +00:00
o.Project = project
}
// WithProjects adds the projects to the get API timesheets params
func (o *GetAPITimesheetsParams) WithProjects(projects *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetProjects(projects)
return o
}
// SetProjects adds the projects to the get API timesheets params
func (o *GetAPITimesheetsParams) SetProjects(projects *string) {
2023-01-14 14:14:06 +00:00
o.Projects = projects
}
// WithSize adds the size to the get API timesheets params
func (o *GetAPITimesheetsParams) WithSize(size *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetSize(size)
return o
}
// SetSize adds the size to the get API timesheets params
func (o *GetAPITimesheetsParams) SetSize(size *string) {
2023-01-14 14:14:06 +00:00
o.Size = size
}
// WithTags adds the tags to the get API timesheets params
func (o *GetAPITimesheetsParams) WithTags(tags *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetTags(tags)
return o
}
// SetTags adds the tags to the get API timesheets params
func (o *GetAPITimesheetsParams) SetTags(tags *string) {
2023-01-14 14:14:06 +00:00
o.Tags = tags
}
// WithTerm adds the term to the get API timesheets params
func (o *GetAPITimesheetsParams) WithTerm(term *string) *GetAPITimesheetsParams {
o.SetTerm(term)
return o
}
// SetTerm adds the term to the get API timesheets params
func (o *GetAPITimesheetsParams) SetTerm(term *string) {
o.Term = term
}
// WithUser adds the user to the get API timesheets params
func (o *GetAPITimesheetsParams) WithUser(user *string) *GetAPITimesheetsParams {
2023-01-14 14:14:06 +00:00
o.SetUser(user)
return o
}
// SetUser adds the user to the get API timesheets params
func (o *GetAPITimesheetsParams) SetUser(user *string) {
2023-01-14 14:14:06 +00:00
o.User = user
}
// WriteToRequest writes these params to a swagger request
func (o *GetAPITimesheetsParams) 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 {
2023-01-14 14:14:06 +00:00
// query param active
var qrActive string
if o.Active != nil {
qrActive = *o.Active
}
qActive := qrActive
if qActive != "" {
if err := r.SetQueryParam("active", qActive); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Activities != nil {
2023-01-14 14:14:06 +00:00
// query param activities
var qrActivities string
if o.Activities != nil {
qrActivities = *o.Activities
}
qActivities := qrActivities
if qActivities != "" {
if err := r.SetQueryParam("activities", qActivities); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Activity != nil {
2023-01-14 14:14:06 +00:00
// query param activity
var qrActivity string
if o.Activity != nil {
qrActivity = *o.Activity
}
qActivity := qrActivity
if qActivity != "" {
if err := r.SetQueryParam("activity", qActivity); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Begin != nil {
2023-01-14 14:14:06 +00:00
// query param begin
var qrBegin string
if o.Begin != nil {
qrBegin = *o.Begin
}
qBegin := qrBegin
if qBegin != "" {
if err := r.SetQueryParam("begin", qBegin); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Billable != nil {
2023-01-14 14:14:06 +00:00
// query param billable
var qrBillable string
if o.Billable != nil {
qrBillable = *o.Billable
}
qBillable := qrBillable
if qBillable != "" {
if err := r.SetQueryParam("billable", qBillable); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Customer != nil {
2023-01-14 14:14:06 +00:00
// query param customer
var qrCustomer string
if o.Customer != nil {
qrCustomer = *o.Customer
}
qCustomer := qrCustomer
if qCustomer != "" {
if err := r.SetQueryParam("customer", qCustomer); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Customers != nil {
2023-01-14 14:14:06 +00:00
// query param customers
var qrCustomers string
if o.Customers != nil {
qrCustomers = *o.Customers
}
qCustomers := qrCustomers
if qCustomers != "" {
if err := r.SetQueryParam("customers", qCustomers); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.End != nil {
2023-01-14 14:14:06 +00:00
// query param end
var qrEnd string
if o.End != nil {
qrEnd = *o.End
}
qEnd := qrEnd
if qEnd != "" {
if err := r.SetQueryParam("end", qEnd); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Exported != nil {
2023-01-14 14:14:06 +00:00
// query param exported
var qrExported string
if o.Exported != nil {
qrExported = *o.Exported
}
qExported := qrExported
if qExported != "" {
if err := r.SetQueryParam("exported", qExported); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Full != nil {
2023-01-14 14:14:06 +00:00
// query param full
var qrFull string
if o.Full != nil {
qrFull = *o.Full
}
qFull := qrFull
if qFull != "" {
if err := r.SetQueryParam("full", qFull); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.ModifiedAfter != nil {
2023-01-14 14:14:06 +00:00
// query param modified_after
var qrModifiedAfter string
if o.ModifiedAfter != nil {
qrModifiedAfter = *o.ModifiedAfter
}
qModifiedAfter := qrModifiedAfter
if qModifiedAfter != "" {
if err := r.SetQueryParam("modified_after", qModifiedAfter); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Order != nil {
2023-01-14 14:14:06 +00:00
// query param order
var qrOrder string
if o.Order != nil {
qrOrder = *o.Order
}
qOrder := qrOrder
if qOrder != "" {
if err := r.SetQueryParam("order", qOrder); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.OrderBy != nil {
2023-01-14 14:14:06 +00:00
// query param orderBy
var qrOrderBy string
if o.OrderBy != nil {
qrOrderBy = *o.OrderBy
}
qOrderBy := qrOrderBy
if qOrderBy != "" {
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Page != nil {
2023-01-14 14:14:06 +00:00
// query param page
var qrPage string
if o.Page != nil {
qrPage = *o.Page
}
qPage := qrPage
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Project != nil {
2023-01-14 14:14:06 +00:00
// query param project
var qrProject string
if o.Project != nil {
qrProject = *o.Project
}
qProject := qrProject
if qProject != "" {
if err := r.SetQueryParam("project", qProject); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Projects != nil {
2023-01-14 14:14:06 +00:00
// query param projects
var qrProjects string
if o.Projects != nil {
qrProjects = *o.Projects
}
qProjects := qrProjects
if qProjects != "" {
if err := r.SetQueryParam("projects", qProjects); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Size != nil {
2023-01-14 14:14:06 +00:00
// query param size
var qrSize string
if o.Size != nil {
qrSize = *o.Size
}
qSize := qrSize
if qSize != "" {
if err := r.SetQueryParam("size", qSize); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if o.Tags != nil {
2023-01-14 14:14:06 +00:00
// query param tags
var qrTags string
if o.Tags != nil {
qrTags = *o.Tags
}
qTags := qrTags
if qTags != "" {
if err := r.SetQueryParam("tags", qTags); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
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
}
}
}
if o.User != nil {
2023-01-14 14:14:06 +00:00
// query param user
var qrUser string
if o.User != nil {
qrUser = *o.User
}
qUser := qrUser
if qUser != "" {
if err := r.SetQueryParam("user", qUser); err != nil {
return err
}
}
2023-01-14 14:14:06 +00:00
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}