go-kimai/client/meta_field/get_api_metafields_parameters.go

157 lines
4.5 KiB
Go
Raw Normal View History

2023-01-14 14:14:06 +00:00
// Code generated by go-swagger; DO NOT EDIT.
package meta_field
// 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"
)
// NewGetAPIMetafieldsParams creates a new GetAPIMetafieldsParams 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 NewGetAPIMetafieldsParams() *GetAPIMetafieldsParams {
return &GetAPIMetafieldsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAPIMetafieldsParamsWithTimeout creates a new GetAPIMetafieldsParams object
// with the ability to set a timeout on a request.
func NewGetAPIMetafieldsParamsWithTimeout(timeout time.Duration) *GetAPIMetafieldsParams {
return &GetAPIMetafieldsParams{
timeout: timeout,
}
}
// NewGetAPIMetafieldsParamsWithContext creates a new GetAPIMetafieldsParams object
// with the ability to set a context for a request.
func NewGetAPIMetafieldsParamsWithContext(ctx context.Context) *GetAPIMetafieldsParams {
return &GetAPIMetafieldsParams{
Context: ctx,
}
}
// NewGetAPIMetafieldsParamsWithHTTPClient creates a new GetAPIMetafieldsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAPIMetafieldsParamsWithHTTPClient(client *http.Client) *GetAPIMetafieldsParams {
return &GetAPIMetafieldsParams{
HTTPClient: client,
}
}
/*
GetAPIMetafieldsParams contains all the parameters to send to the API endpoint
for the get API metafields operation.
Typically these are written to a http.Request.
*/
type GetAPIMetafieldsParams struct {
/* Entity.
The type of object to fetch meta-fields for. Allowed values: timesheet, customer, project, activity, user, expense - returns all if not given (default: all)
Format: MetaFieldExternalType
*/
Entity string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get API metafields params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIMetafieldsParams) WithDefaults() *GetAPIMetafieldsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get API metafields params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAPIMetafieldsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get API metafields params
func (o *GetAPIMetafieldsParams) WithTimeout(timeout time.Duration) *GetAPIMetafieldsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get API metafields params
func (o *GetAPIMetafieldsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get API metafields params
func (o *GetAPIMetafieldsParams) WithContext(ctx context.Context) *GetAPIMetafieldsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get API metafields params
func (o *GetAPIMetafieldsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get API metafields params
func (o *GetAPIMetafieldsParams) WithHTTPClient(client *http.Client) *GetAPIMetafieldsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get API metafields params
func (o *GetAPIMetafieldsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEntity adds the entity to the get API metafields params
func (o *GetAPIMetafieldsParams) WithEntity(entity string) *GetAPIMetafieldsParams {
o.SetEntity(entity)
return o
}
// SetEntity adds the entity to the get API metafields params
func (o *GetAPIMetafieldsParams) SetEntity(entity string) {
o.Entity = entity
}
// WriteToRequest writes these params to a swagger request
func (o *GetAPIMetafieldsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param entity
qrEntity := o.Entity
qEntity := qrEntity
if err := r.SetQueryParam("entity", qEntity); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}