fix: support empty query params on timesheets endpoint

See https://github.com/go-swagger/go-swagger/issues/174
This commit is contained in:
decentral1se 2023-01-19 12:19:12 +01:00
parent adcc0c7317
commit 925e2fbf4a
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
2 changed files with 342 additions and 171 deletions

View File

@ -65,19 +65,19 @@ type GetAPITimesheetsParams struct {
Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all) Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all)
*/ */
Active string Active *string
/* Activities. /* Activities.
Comma separated list of activity IDs to filter timesheets Comma separated list of activity IDs to filter timesheets
*/ */
Activities string Activities *string
/* Activity. /* Activity.
DEPRECATED: Activity ID to filter timesheets (will be removed with 2.0) DEPRECATED: Activity ID to filter timesheets (will be removed with 2.0)
*/ */
Activity string Activity *string
/* Begin. /* Begin.
@ -85,25 +85,25 @@ type GetAPITimesheetsParams struct {
Format: DateTime Format: DateTime
*/ */
Begin string Begin *string
/* Billable. /* Billable.
Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all) Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all)
*/ */
Billable string Billable *string
/* Customer. /* Customer.
DEPRECATED: Customer ID to filter timesheets (will be removed with 2.0) DEPRECATED: Customer ID to filter timesheets (will be removed with 2.0)
*/ */
Customer string Customer *string
/* Customers. /* Customers.
Comma separated list of customer IDs to filter timesheets Comma separated list of customer IDs to filter timesheets
*/ */
Customers string Customers *string
/* End. /* End.
@ -111,19 +111,19 @@ type GetAPITimesheetsParams struct {
Format: DateTime Format: DateTime
*/ */
End string End *string
/* Exported. /* Exported.
Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all) Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)
*/ */
Exported string Exported *string
/* Full. /* Full.
Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false) Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false)
*/ */
Full string Full *string
/* ModifiedAfter. /* ModifiedAfter.
@ -131,49 +131,49 @@ type GetAPITimesheetsParams struct {
Format: DateTime Format: DateTime
*/ */
ModifiedAfter string ModifiedAfter *string
/* Order. /* Order.
The result order. Allowed values: ASC, DESC (default: DESC) The result order. Allowed values: ASC, DESC (default: DESC)
*/ */
Order string Order *string
/* OrderBy. /* OrderBy.
The field by which results will be ordered. Allowed values: id, begin, end, rate (default: begin) The field by which results will be ordered. Allowed values: id, begin, end, rate (default: begin)
*/ */
OrderBy string OrderBy *string
/* Page. /* Page.
The page to display, renders a 404 if not found (default: 1) The page to display, renders a 404 if not found (default: 1)
*/ */
Page string Page *string
/* Project. /* Project.
DEPRECATED: Project ID to filter timesheets (will be removed with 2.0) DEPRECATED: Project ID to filter timesheets (will be removed with 2.0)
*/ */
Project string Project *string
/* Projects. /* Projects.
Comma separated list of project IDs to filter timesheets Comma separated list of project IDs to filter timesheets
*/ */
Projects string Projects *string
/* Size. /* Size.
The amount of entries for each page (default: 50) The amount of entries for each page (default: 50)
*/ */
Size string Size *string
/* Tags. /* Tags.
Comma separated list of tag names Comma separated list of tag names
*/ */
Tags string Tags *string
/* Term. /* Term.
@ -185,7 +185,7 @@ type GetAPITimesheetsParams struct {
User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user) User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user)
*/ */
User string User *string
timeout time.Duration timeout time.Duration
Context context.Context Context context.Context
@ -241,200 +241,200 @@ func (o *GetAPITimesheetsParams) SetHTTPClient(client *http.Client) {
} }
// WithActive adds the active to the get API timesheets params // WithActive adds the active to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActive(active string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithActive(active *string) *GetAPITimesheetsParams {
o.SetActive(active) o.SetActive(active)
return o return o
} }
// SetActive adds the active to the get API timesheets params // SetActive adds the active to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActive(active string) { func (o *GetAPITimesheetsParams) SetActive(active *string) {
o.Active = active o.Active = active
} }
// WithActivities adds the activities to the get API timesheets params // WithActivities adds the activities to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActivities(activities string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithActivities(activities *string) *GetAPITimesheetsParams {
o.SetActivities(activities) o.SetActivities(activities)
return o return o
} }
// SetActivities adds the activities to the get API timesheets params // SetActivities adds the activities to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActivities(activities string) { func (o *GetAPITimesheetsParams) SetActivities(activities *string) {
o.Activities = activities o.Activities = activities
} }
// WithActivity adds the activity to the get API timesheets params // WithActivity adds the activity to the get API timesheets params
func (o *GetAPITimesheetsParams) WithActivity(activity string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithActivity(activity *string) *GetAPITimesheetsParams {
o.SetActivity(activity) o.SetActivity(activity)
return o return o
} }
// SetActivity adds the activity to the get API timesheets params // SetActivity adds the activity to the get API timesheets params
func (o *GetAPITimesheetsParams) SetActivity(activity string) { func (o *GetAPITimesheetsParams) SetActivity(activity *string) {
o.Activity = activity o.Activity = activity
} }
// WithBegin adds the begin to the get API timesheets params // WithBegin adds the begin to the get API timesheets params
func (o *GetAPITimesheetsParams) WithBegin(begin string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithBegin(begin *string) *GetAPITimesheetsParams {
o.SetBegin(begin) o.SetBegin(begin)
return o return o
} }
// SetBegin adds the begin to the get API timesheets params // SetBegin adds the begin to the get API timesheets params
func (o *GetAPITimesheetsParams) SetBegin(begin string) { func (o *GetAPITimesheetsParams) SetBegin(begin *string) {
o.Begin = begin o.Begin = begin
} }
// WithBillable adds the billable to the get API timesheets params // WithBillable adds the billable to the get API timesheets params
func (o *GetAPITimesheetsParams) WithBillable(billable string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithBillable(billable *string) *GetAPITimesheetsParams {
o.SetBillable(billable) o.SetBillable(billable)
return o return o
} }
// SetBillable adds the billable to the get API timesheets params // SetBillable adds the billable to the get API timesheets params
func (o *GetAPITimesheetsParams) SetBillable(billable string) { func (o *GetAPITimesheetsParams) SetBillable(billable *string) {
o.Billable = billable o.Billable = billable
} }
// WithCustomer adds the customer to the get API timesheets params // WithCustomer adds the customer to the get API timesheets params
func (o *GetAPITimesheetsParams) WithCustomer(customer string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithCustomer(customer *string) *GetAPITimesheetsParams {
o.SetCustomer(customer) o.SetCustomer(customer)
return o return o
} }
// SetCustomer adds the customer to the get API timesheets params // SetCustomer adds the customer to the get API timesheets params
func (o *GetAPITimesheetsParams) SetCustomer(customer string) { func (o *GetAPITimesheetsParams) SetCustomer(customer *string) {
o.Customer = customer o.Customer = customer
} }
// WithCustomers adds the customers to the get API timesheets params // WithCustomers adds the customers to the get API timesheets params
func (o *GetAPITimesheetsParams) WithCustomers(customers string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithCustomers(customers *string) *GetAPITimesheetsParams {
o.SetCustomers(customers) o.SetCustomers(customers)
return o return o
} }
// SetCustomers adds the customers to the get API timesheets params // SetCustomers adds the customers to the get API timesheets params
func (o *GetAPITimesheetsParams) SetCustomers(customers string) { func (o *GetAPITimesheetsParams) SetCustomers(customers *string) {
o.Customers = customers o.Customers = customers
} }
// WithEnd adds the end to the get API timesheets params // WithEnd adds the end to the get API timesheets params
func (o *GetAPITimesheetsParams) WithEnd(end string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithEnd(end *string) *GetAPITimesheetsParams {
o.SetEnd(end) o.SetEnd(end)
return o return o
} }
// SetEnd adds the end to the get API timesheets params // SetEnd adds the end to the get API timesheets params
func (o *GetAPITimesheetsParams) SetEnd(end string) { func (o *GetAPITimesheetsParams) SetEnd(end *string) {
o.End = end o.End = end
} }
// WithExported adds the exported to the get API timesheets params // WithExported adds the exported to the get API timesheets params
func (o *GetAPITimesheetsParams) WithExported(exported string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithExported(exported *string) *GetAPITimesheetsParams {
o.SetExported(exported) o.SetExported(exported)
return o return o
} }
// SetExported adds the exported to the get API timesheets params // SetExported adds the exported to the get API timesheets params
func (o *GetAPITimesheetsParams) SetExported(exported string) { func (o *GetAPITimesheetsParams) SetExported(exported *string) {
o.Exported = exported o.Exported = exported
} }
// WithFull adds the full to the get API timesheets params // WithFull adds the full to the get API timesheets params
func (o *GetAPITimesheetsParams) WithFull(full string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithFull(full *string) *GetAPITimesheetsParams {
o.SetFull(full) o.SetFull(full)
return o return o
} }
// SetFull adds the full to the get API timesheets params // SetFull adds the full to the get API timesheets params
func (o *GetAPITimesheetsParams) SetFull(full string) { func (o *GetAPITimesheetsParams) SetFull(full *string) {
o.Full = full o.Full = full
} }
// WithModifiedAfter adds the modifiedAfter to the get API timesheets params // WithModifiedAfter adds the modifiedAfter to the get API timesheets params
func (o *GetAPITimesheetsParams) WithModifiedAfter(modifiedAfter string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithModifiedAfter(modifiedAfter *string) *GetAPITimesheetsParams {
o.SetModifiedAfter(modifiedAfter) o.SetModifiedAfter(modifiedAfter)
return o return o
} }
// SetModifiedAfter adds the modifiedAfter to the get API timesheets params // SetModifiedAfter adds the modifiedAfter to the get API timesheets params
func (o *GetAPITimesheetsParams) SetModifiedAfter(modifiedAfter string) { func (o *GetAPITimesheetsParams) SetModifiedAfter(modifiedAfter *string) {
o.ModifiedAfter = modifiedAfter o.ModifiedAfter = modifiedAfter
} }
// WithOrder adds the order to the get API timesheets params // WithOrder adds the order to the get API timesheets params
func (o *GetAPITimesheetsParams) WithOrder(order string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithOrder(order *string) *GetAPITimesheetsParams {
o.SetOrder(order) o.SetOrder(order)
return o return o
} }
// SetOrder adds the order to the get API timesheets params // SetOrder adds the order to the get API timesheets params
func (o *GetAPITimesheetsParams) SetOrder(order string) { func (o *GetAPITimesheetsParams) SetOrder(order *string) {
o.Order = order o.Order = order
} }
// WithOrderBy adds the orderBy to the get API timesheets params // WithOrderBy adds the orderBy to the get API timesheets params
func (o *GetAPITimesheetsParams) WithOrderBy(orderBy string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithOrderBy(orderBy *string) *GetAPITimesheetsParams {
o.SetOrderBy(orderBy) o.SetOrderBy(orderBy)
return o return o
} }
// SetOrderBy adds the orderBy to the get API timesheets params // SetOrderBy adds the orderBy to the get API timesheets params
func (o *GetAPITimesheetsParams) SetOrderBy(orderBy string) { func (o *GetAPITimesheetsParams) SetOrderBy(orderBy *string) {
o.OrderBy = orderBy o.OrderBy = orderBy
} }
// WithPage adds the page to the get API timesheets params // WithPage adds the page to the get API timesheets params
func (o *GetAPITimesheetsParams) WithPage(page string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithPage(page *string) *GetAPITimesheetsParams {
o.SetPage(page) o.SetPage(page)
return o return o
} }
// SetPage adds the page to the get API timesheets params // SetPage adds the page to the get API timesheets params
func (o *GetAPITimesheetsParams) SetPage(page string) { func (o *GetAPITimesheetsParams) SetPage(page *string) {
o.Page = page o.Page = page
} }
// WithProject adds the project to the get API timesheets params // WithProject adds the project to the get API timesheets params
func (o *GetAPITimesheetsParams) WithProject(project string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithProject(project *string) *GetAPITimesheetsParams {
o.SetProject(project) o.SetProject(project)
return o return o
} }
// SetProject adds the project to the get API timesheets params // SetProject adds the project to the get API timesheets params
func (o *GetAPITimesheetsParams) SetProject(project string) { func (o *GetAPITimesheetsParams) SetProject(project *string) {
o.Project = project o.Project = project
} }
// WithProjects adds the projects to the get API timesheets params // WithProjects adds the projects to the get API timesheets params
func (o *GetAPITimesheetsParams) WithProjects(projects string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithProjects(projects *string) *GetAPITimesheetsParams {
o.SetProjects(projects) o.SetProjects(projects)
return o return o
} }
// SetProjects adds the projects to the get API timesheets params // SetProjects adds the projects to the get API timesheets params
func (o *GetAPITimesheetsParams) SetProjects(projects string) { func (o *GetAPITimesheetsParams) SetProjects(projects *string) {
o.Projects = projects o.Projects = projects
} }
// WithSize adds the size to the get API timesheets params // WithSize adds the size to the get API timesheets params
func (o *GetAPITimesheetsParams) WithSize(size string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithSize(size *string) *GetAPITimesheetsParams {
o.SetSize(size) o.SetSize(size)
return o return o
} }
// SetSize adds the size to the get API timesheets params // SetSize adds the size to the get API timesheets params
func (o *GetAPITimesheetsParams) SetSize(size string) { func (o *GetAPITimesheetsParams) SetSize(size *string) {
o.Size = size o.Size = size
} }
// WithTags adds the tags to the get API timesheets params // WithTags adds the tags to the get API timesheets params
func (o *GetAPITimesheetsParams) WithTags(tags string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithTags(tags *string) *GetAPITimesheetsParams {
o.SetTags(tags) o.SetTags(tags)
return o return o
} }
// SetTags adds the tags to the get API timesheets params // SetTags adds the tags to the get API timesheets params
func (o *GetAPITimesheetsParams) SetTags(tags string) { func (o *GetAPITimesheetsParams) SetTags(tags *string) {
o.Tags = tags o.Tags = tags
} }
@ -450,13 +450,13 @@ func (o *GetAPITimesheetsParams) SetTerm(term *string) {
} }
// WithUser adds the user to the get API timesheets params // WithUser adds the user to the get API timesheets params
func (o *GetAPITimesheetsParams) WithUser(user string) *GetAPITimesheetsParams { func (o *GetAPITimesheetsParams) WithUser(user *string) *GetAPITimesheetsParams {
o.SetUser(user) o.SetUser(user)
return o return o
} }
// SetUser adds the user to the get API timesheets params // SetUser adds the user to the get API timesheets params
func (o *GetAPITimesheetsParams) SetUser(user string) { func (o *GetAPITimesheetsParams) SetUser(user *string) {
o.User = user o.User = user
} }
@ -468,148 +468,310 @@ func (o *GetAPITimesheetsParams) WriteToRequest(r runtime.ClientRequest, reg str
} }
var res []error var res []error
// query param active if o.Active != nil {
qrActive := o.Active
qActive := qrActive
if err := r.SetQueryParam("active", qActive); err != nil { // query param active
return err var qrActive string
if o.Active != nil {
qrActive = *o.Active
}
qActive := qrActive
if qActive != "" {
if err := r.SetQueryParam("active", qActive); err != nil {
return err
}
}
} }
// query param activities if o.Activities != nil {
qrActivities := o.Activities
qActivities := qrActivities
if err := r.SetQueryParam("activities", qActivities); err != nil { // query param activities
return err var qrActivities string
if o.Activities != nil {
qrActivities = *o.Activities
}
qActivities := qrActivities
if qActivities != "" {
if err := r.SetQueryParam("activities", qActivities); err != nil {
return err
}
}
} }
// query param activity if o.Activity != nil {
qrActivity := o.Activity
qActivity := qrActivity
if err := r.SetQueryParam("activity", qActivity); err != nil { // query param activity
return err var qrActivity string
if o.Activity != nil {
qrActivity = *o.Activity
}
qActivity := qrActivity
if qActivity != "" {
if err := r.SetQueryParam("activity", qActivity); err != nil {
return err
}
}
} }
// query param begin if o.Begin != nil {
qrBegin := o.Begin
qBegin := qrBegin
if err := r.SetQueryParam("begin", qBegin); err != nil { // query param begin
return err var qrBegin string
if o.Begin != nil {
qrBegin = *o.Begin
}
qBegin := qrBegin
if qBegin != "" {
if err := r.SetQueryParam("begin", qBegin); err != nil {
return err
}
}
} }
// query param billable if o.Billable != nil {
qrBillable := o.Billable
qBillable := qrBillable
if err := r.SetQueryParam("billable", qBillable); err != nil { // query param billable
return err var qrBillable string
if o.Billable != nil {
qrBillable = *o.Billable
}
qBillable := qrBillable
if qBillable != "" {
if err := r.SetQueryParam("billable", qBillable); err != nil {
return err
}
}
} }
// query param customer if o.Customer != nil {
qrCustomer := o.Customer
qCustomer := qrCustomer
if err := r.SetQueryParam("customer", qCustomer); err != nil { // query param customer
return err var qrCustomer string
if o.Customer != nil {
qrCustomer = *o.Customer
}
qCustomer := qrCustomer
if qCustomer != "" {
if err := r.SetQueryParam("customer", qCustomer); err != nil {
return err
}
}
} }
// query param customers if o.Customers != nil {
qrCustomers := o.Customers
qCustomers := qrCustomers
if err := r.SetQueryParam("customers", qCustomers); err != nil { // query param customers
return err var qrCustomers string
if o.Customers != nil {
qrCustomers = *o.Customers
}
qCustomers := qrCustomers
if qCustomers != "" {
if err := r.SetQueryParam("customers", qCustomers); err != nil {
return err
}
}
} }
// query param end if o.End != nil {
qrEnd := o.End
qEnd := qrEnd
if err := r.SetQueryParam("end", qEnd); err != nil { // query param end
return err var qrEnd string
if o.End != nil {
qrEnd = *o.End
}
qEnd := qrEnd
if qEnd != "" {
if err := r.SetQueryParam("end", qEnd); err != nil {
return err
}
}
} }
// query param exported if o.Exported != nil {
qrExported := o.Exported
qExported := qrExported
if err := r.SetQueryParam("exported", qExported); err != nil { // query param exported
return err var qrExported string
if o.Exported != nil {
qrExported = *o.Exported
}
qExported := qrExported
if qExported != "" {
if err := r.SetQueryParam("exported", qExported); err != nil {
return err
}
}
} }
// query param full if o.Full != nil {
qrFull := o.Full
qFull := qrFull
if err := r.SetQueryParam("full", qFull); err != nil { // query param full
return err var qrFull string
if o.Full != nil {
qrFull = *o.Full
}
qFull := qrFull
if qFull != "" {
if err := r.SetQueryParam("full", qFull); err != nil {
return err
}
}
} }
// query param modified_after if o.ModifiedAfter != nil {
qrModifiedAfter := o.ModifiedAfter
qModifiedAfter := qrModifiedAfter
if err := r.SetQueryParam("modified_after", qModifiedAfter); err != nil { // query param modified_after
return err 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
}
}
} }
// query param order if o.Order != nil {
qrOrder := o.Order
qOrder := qrOrder
if err := r.SetQueryParam("order", qOrder); err != nil { // query param order
return err var qrOrder string
if o.Order != nil {
qrOrder = *o.Order
}
qOrder := qrOrder
if qOrder != "" {
if err := r.SetQueryParam("order", qOrder); err != nil {
return err
}
}
} }
// query param orderBy if o.OrderBy != nil {
qrOrderBy := o.OrderBy
qOrderBy := qrOrderBy
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil { // query param orderBy
return err var qrOrderBy string
if o.OrderBy != nil {
qrOrderBy = *o.OrderBy
}
qOrderBy := qrOrderBy
if qOrderBy != "" {
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil {
return err
}
}
} }
// query param page if o.Page != nil {
qrPage := o.Page
qPage := qrPage
if err := r.SetQueryParam("page", qPage); err != nil { // query param page
return err var qrPage string
if o.Page != nil {
qrPage = *o.Page
}
qPage := qrPage
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
} }
// query param project if o.Project != nil {
qrProject := o.Project
qProject := qrProject
if err := r.SetQueryParam("project", qProject); err != nil { // query param project
return err var qrProject string
if o.Project != nil {
qrProject = *o.Project
}
qProject := qrProject
if qProject != "" {
if err := r.SetQueryParam("project", qProject); err != nil {
return err
}
}
} }
// query param projects if o.Projects != nil {
qrProjects := o.Projects
qProjects := qrProjects
if err := r.SetQueryParam("projects", qProjects); err != nil { // query param projects
return err var qrProjects string
if o.Projects != nil {
qrProjects = *o.Projects
}
qProjects := qrProjects
if qProjects != "" {
if err := r.SetQueryParam("projects", qProjects); err != nil {
return err
}
}
} }
// query param size if o.Size != nil {
qrSize := o.Size
qSize := qrSize
if err := r.SetQueryParam("size", qSize); err != nil { // query param size
return err var qrSize string
if o.Size != nil {
qrSize = *o.Size
}
qSize := qrSize
if qSize != "" {
if err := r.SetQueryParam("size", qSize); err != nil {
return err
}
}
} }
// query param tags if o.Tags != nil {
qrTags := o.Tags
qTags := qrTags
if err := r.SetQueryParam("tags", qTags); err != nil { // query param tags
return err var qrTags string
if o.Tags != nil {
qrTags = *o.Tags
}
qTags := qrTags
if qTags != "" {
if err := r.SetQueryParam("tags", qTags); err != nil {
return err
}
}
} }
if o.Term != nil { if o.Term != nil {
@ -629,12 +791,21 @@ func (o *GetAPITimesheetsParams) WriteToRequest(r runtime.ClientRequest, reg str
} }
} }
// query param user if o.User != nil {
qrUser := o.User
qUser := qrUser
if err := r.SetQueryParam("user", qUser); err != nil { // query param user
return err var qrUser string
if o.User != nil {
qrUser = *o.User
}
qUser := qrUser
if qUser != "" {
if err := r.SetQueryParam("user", qUser); err != nil {
return err
}
}
} }
if len(res) > 0 { if len(res) > 0 {

View File

@ -2092,7 +2092,7 @@
{ {
"name": "user", "name": "user",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user)", "description": "User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user)",
"type": "string", "type": "string",
@ -2101,7 +2101,7 @@
{ {
"name": "customer", "name": "customer",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "DEPRECATED: Customer ID to filter timesheets (will be removed with 2.0)", "description": "DEPRECATED: Customer ID to filter timesheets (will be removed with 2.0)",
"type": "string", "type": "string",
@ -2110,7 +2110,7 @@
{ {
"name": "customers", "name": "customers",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Comma separated list of customer IDs to filter timesheets", "description": "Comma separated list of customer IDs to filter timesheets",
"type": "string", "type": "string",
@ -2119,7 +2119,7 @@
{ {
"name": "project", "name": "project",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "DEPRECATED: Project ID to filter timesheets (will be removed with 2.0)", "description": "DEPRECATED: Project ID to filter timesheets (will be removed with 2.0)",
"type": "string", "type": "string",
@ -2128,7 +2128,7 @@
{ {
"name": "projects", "name": "projects",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Comma separated list of project IDs to filter timesheets", "description": "Comma separated list of project IDs to filter timesheets",
"type": "string", "type": "string",
@ -2137,7 +2137,7 @@
{ {
"name": "activity", "name": "activity",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "DEPRECATED: Activity ID to filter timesheets (will be removed with 2.0)", "description": "DEPRECATED: Activity ID to filter timesheets (will be removed with 2.0)",
"type": "string", "type": "string",
@ -2146,7 +2146,7 @@
{ {
"name": "activities", "name": "activities",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Comma separated list of activity IDs to filter timesheets", "description": "Comma separated list of activity IDs to filter timesheets",
"type": "string", "type": "string",
@ -2155,7 +2155,7 @@
{ {
"name": "page", "name": "page",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "The page to display, renders a 404 if not found (default: 1)", "description": "The page to display, renders a 404 if not found (default: 1)",
"type": "string", "type": "string",
@ -2164,7 +2164,7 @@
{ {
"name": "size", "name": "size",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "The amount of entries for each page (default: 50)", "description": "The amount of entries for each page (default: 50)",
"type": "string", "type": "string",
@ -2173,7 +2173,7 @@
{ {
"name": "tags", "name": "tags",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Comma separated list of tag names", "description": "Comma separated list of tag names",
"type": "string" "type": "string"
@ -2181,7 +2181,7 @@
{ {
"name": "orderBy", "name": "orderBy",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "The field by which results will be ordered. Allowed values: id, begin, end, rate (default: begin)", "description": "The field by which results will be ordered. Allowed values: id, begin, end, rate (default: begin)",
"type": "string", "type": "string",
@ -2190,7 +2190,7 @@
{ {
"name": "order", "name": "order",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "The result order. Allowed values: ASC, DESC (default: DESC)", "description": "The result order. Allowed values: ASC, DESC (default: DESC)",
"type": "string", "type": "string",
@ -2199,7 +2199,7 @@
{ {
"name": "begin", "name": "begin",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Only records after this date will be included (format: HTML5)", "description": "Only records after this date will be included (format: HTML5)",
"type": "string", "type": "string",
@ -2208,7 +2208,7 @@
{ {
"name": "end", "name": "end",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Only records before this date will be included (format: HTML5)", "description": "Only records before this date will be included (format: HTML5)",
"type": "string", "type": "string",
@ -2217,7 +2217,7 @@
{ {
"name": "exported", "name": "exported",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)", "description": "Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)",
"type": "string", "type": "string",
@ -2226,7 +2226,7 @@
{ {
"name": "active", "name": "active",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all)", "description": "Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all)",
"type": "string", "type": "string",
@ -2235,7 +2235,7 @@
{ {
"name": "billable", "name": "billable",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all)", "description": "Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all)",
"type": "string", "type": "string",
@ -2244,7 +2244,7 @@
{ {
"name": "full", "name": "full",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false)", "description": "Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false)",
"type": "string", "type": "string",
@ -2261,7 +2261,7 @@
{ {
"name": "modified_after", "name": "modified_after",
"in": "query", "in": "query",
"allowEmptyValue": true, "allowEmptyValue": false,
"required": false, "required": false,
"description": "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.", "description": "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.",
"type": "string", "type": "string",