go-kimai/client/expense/get_api_expenses_parameters.go

359 lines
8.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package expense
// 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"
)
// NewGetAPIExpensesParams creates a new GetAPIExpensesParams 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 NewGetAPIExpensesParams() *GetAPIExpensesParams {
return &GetAPIExpensesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAPIExpensesParamsWithTimeout creates a new GetAPIExpensesParams object
// with the ability to set a timeout on a request.
func NewGetAPIExpensesParamsWithTimeout(timeout time.Duration) *GetAPIExpensesParams {
return &GetAPIExpensesParams{
timeout: timeout,
}
}
// NewGetAPIExpensesParamsWithContext creates a new GetAPIExpensesParams object
// with the ability to set a context for a request.
func NewGetAPIExpensesParamsWithContext(ctx context.Context) *GetAPIExpensesParams {
return &GetAPIExpensesParams{
Context: ctx,
}
}
// NewGetAPIExpensesParamsWithHTTPClient creates a new GetAPIExpensesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAPIExpensesParamsWithHTTPClient(client *http.Client) *GetAPIExpensesParams {
return &GetAPIExpensesParams{
HTTPClient: client,
}
}
/*
GetAPIExpensesParams contains all the parameters to send to the API endpoint
for the get API expenses operation.
Typically these are written to a http.Request.
*/
type GetAPIExpensesParams struct {
/* Begin.
Only records after this date will be included (format: HTML5)
Format: DateTime
*/
Begin string
/* End.
Only records before this date will be included (format: HTML5)
Format: DateTime
*/
End string
/* Exported.
Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)
*/
Exported string
/* Order.
The result order. Allowed values: ASC, DESC (default: DESC)
*/
Order string
/* OrderBy.
The field by which results will be ordered. Allowed values: begin, end, duration, total, category, cost, user, customer, project, activity, description, exported, refundable, multiplier (default: begin)
*/
OrderBy string
/* Page.
The page to display, renders a 404 if not found (default: 1)
*/
Page string
/* Refundable.
Use this flag if you want to filter for refundable expenses. Allowed values: 0=not refundable, 1=refundable (default: all)
*/
Refundable string
/* Size.
The amount of entries for each page (default: 50)
*/
Size string
/* Term.
Free search term
*/
Term string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get API expenses params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIExpensesParams) WithDefaults() *GetAPIExpensesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get API expenses params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIExpensesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get API expenses params
func (o *GetAPIExpensesParams) WithTimeout(timeout time.Duration) *GetAPIExpensesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get API expenses params
func (o *GetAPIExpensesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get API expenses params
func (o *GetAPIExpensesParams) WithContext(ctx context.Context) *GetAPIExpensesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get API expenses params
func (o *GetAPIExpensesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get API expenses params
func (o *GetAPIExpensesParams) WithHTTPClient(client *http.Client) *GetAPIExpensesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get API expenses params
func (o *GetAPIExpensesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBegin adds the begin to the get API expenses params
func (o *GetAPIExpensesParams) WithBegin(begin string) *GetAPIExpensesParams {
o.SetBegin(begin)
return o
}
// SetBegin adds the begin to the get API expenses params
func (o *GetAPIExpensesParams) SetBegin(begin string) {
o.Begin = begin
}
// WithEnd adds the end to the get API expenses params
func (o *GetAPIExpensesParams) WithEnd(end string) *GetAPIExpensesParams {
o.SetEnd(end)
return o
}
// SetEnd adds the end to the get API expenses params
func (o *GetAPIExpensesParams) SetEnd(end string) {
o.End = end
}
// WithExported adds the exported to the get API expenses params
func (o *GetAPIExpensesParams) WithExported(exported string) *GetAPIExpensesParams {
o.SetExported(exported)
return o
}
// SetExported adds the exported to the get API expenses params
func (o *GetAPIExpensesParams) SetExported(exported string) {
o.Exported = exported
}
// WithOrder adds the order to the get API expenses params
func (o *GetAPIExpensesParams) WithOrder(order string) *GetAPIExpensesParams {
o.SetOrder(order)
return o
}
// SetOrder adds the order to the get API expenses params
func (o *GetAPIExpensesParams) SetOrder(order string) {
o.Order = order
}
// WithOrderBy adds the orderBy to the get API expenses params
func (o *GetAPIExpensesParams) WithOrderBy(orderBy string) *GetAPIExpensesParams {
o.SetOrderBy(orderBy)
return o
}
// SetOrderBy adds the orderBy to the get API expenses params
func (o *GetAPIExpensesParams) SetOrderBy(orderBy string) {
o.OrderBy = orderBy
}
// WithPage adds the page to the get API expenses params
func (o *GetAPIExpensesParams) WithPage(page string) *GetAPIExpensesParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the get API expenses params
func (o *GetAPIExpensesParams) SetPage(page string) {
o.Page = page
}
// WithRefundable adds the refundable to the get API expenses params
func (o *GetAPIExpensesParams) WithRefundable(refundable string) *GetAPIExpensesParams {
o.SetRefundable(refundable)
return o
}
// SetRefundable adds the refundable to the get API expenses params
func (o *GetAPIExpensesParams) SetRefundable(refundable string) {
o.Refundable = refundable
}
// WithSize adds the size to the get API expenses params
func (o *GetAPIExpensesParams) WithSize(size string) *GetAPIExpensesParams {
o.SetSize(size)
return o
}
// SetSize adds the size to the get API expenses params
func (o *GetAPIExpensesParams) SetSize(size string) {
o.Size = size
}
// WithTerm adds the term to the get API expenses params
func (o *GetAPIExpensesParams) WithTerm(term string) *GetAPIExpensesParams {
o.SetTerm(term)
return o
}
// SetTerm adds the term to the get API expenses params
func (o *GetAPIExpensesParams) SetTerm(term string) {
o.Term = term
}
// WriteToRequest writes these params to a swagger request
func (o *GetAPIExpensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param begin
qrBegin := o.Begin
qBegin := qrBegin
if err := r.SetQueryParam("begin", qBegin); err != nil {
return err
}
// query param end
qrEnd := o.End
qEnd := qrEnd
if err := r.SetQueryParam("end", qEnd); err != nil {
return err
}
// query param exported
qrExported := o.Exported
qExported := qrExported
if err := r.SetQueryParam("exported", qExported); 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 page
qrPage := o.Page
qPage := qrPage
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
// query param refundable
qrRefundable := o.Refundable
qRefundable := qrRefundable
if err := r.SetQueryParam("refundable", qRefundable); err != nil {
return err
}
// query param size
qrSize := o.Size
qSize := qrSize
if err := r.SetQueryParam("size", qSize); err != nil {
return err
}
// query param term
qrTerm := o.Term
qTerm := qrTerm
if err := r.SetQueryParam("term", qTerm); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}