feat: init
This commit is contained in:
237
client/default_operations/default_operations_client.go
Normal file
237
client/default_operations/default_operations_client.go
Normal file
@ -0,0 +1,237 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new default operations API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for default operations API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
GetAPIConfigI18n(params *GetAPIConfigI18nParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIConfigI18nOK, error)
|
||||
|
||||
GetAPIConfigTimesheet(params *GetAPIConfigTimesheetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIConfigTimesheetOK, error)
|
||||
|
||||
GetAPIPing(params *GetAPIPingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error
|
||||
|
||||
GetAPIPlugins(params *GetAPIPluginsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIPluginsOK, error)
|
||||
|
||||
GetAPIVersion(params *GetAPIVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIVersionOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigI18n returns the user specific locale configuration
|
||||
*/
|
||||
func (a *Client) GetAPIConfigI18n(params *GetAPIConfigI18nParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIConfigI18nOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIConfigI18nParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIConfigI18n",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/config/i18n",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIConfigI18nReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPIConfigI18nOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPIConfigI18n: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigTimesheet returns the timesheet configuration
|
||||
*/
|
||||
func (a *Client) GetAPIConfigTimesheet(params *GetAPIConfigTimesheetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIConfigTimesheetOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIConfigTimesheetParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIConfigTimesheet",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/config/timesheet",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIConfigTimesheetReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPIConfigTimesheetOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPIConfigTimesheet: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPing as testing route for the API
|
||||
*/
|
||||
func (a *Client) GetAPIPing(params *GetAPIPingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) error {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIPingParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIPing",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/ping",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIPingReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
_, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPlugins returns information about installed plugins
|
||||
*/
|
||||
func (a *Client) GetAPIPlugins(params *GetAPIPluginsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIPluginsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIPluginsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIPlugins",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/plugins",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIPluginsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPIPluginsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPIPlugins: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIVersion returns information about the kimai release
|
||||
*/
|
||||
func (a *Client) GetAPIVersion(params *GetAPIVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIVersionOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIVersionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIVersion",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/version",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIVersionReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPIVersionOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPIVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
128
client/default_operations/get_api_config_i18n_parameters.go
Normal file
128
client/default_operations/get_api_config_i18n_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIConfigI18nParams creates a new GetAPIConfigI18nParams 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 NewGetAPIConfigI18nParams() *GetAPIConfigI18nParams {
|
||||
return &GetAPIConfigI18nParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigI18nParamsWithTimeout creates a new GetAPIConfigI18nParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIConfigI18nParamsWithTimeout(timeout time.Duration) *GetAPIConfigI18nParams {
|
||||
return &GetAPIConfigI18nParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigI18nParamsWithContext creates a new GetAPIConfigI18nParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIConfigI18nParamsWithContext(ctx context.Context) *GetAPIConfigI18nParams {
|
||||
return &GetAPIConfigI18nParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigI18nParamsWithHTTPClient creates a new GetAPIConfigI18nParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIConfigI18nParamsWithHTTPClient(client *http.Client) *GetAPIConfigI18nParams {
|
||||
return &GetAPIConfigI18nParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigI18nParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API config i18n operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIConfigI18nParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API config i18n params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIConfigI18nParams) WithDefaults() *GetAPIConfigI18nParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API config i18n params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIConfigI18nParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) WithTimeout(timeout time.Duration) *GetAPIConfigI18nParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) WithContext(ctx context.Context) *GetAPIConfigI18nParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) WithHTTPClient(client *http.Client) *GetAPIConfigI18nParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API config i18n params
|
||||
func (o *GetAPIConfigI18nParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIConfigI18nParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/default_operations/get_api_config_i18n_responses.go
Normal file
98
client/default_operations/get_api_config_i18n_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPIConfigI18nReader is a Reader for the GetAPIConfigI18n structure.
|
||||
type GetAPIConfigI18nReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIConfigI18nReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIConfigI18nOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigI18nOK creates a GetAPIConfigI18nOK with default headers values
|
||||
func NewGetAPIConfigI18nOK() *GetAPIConfigI18nOK {
|
||||
return &GetAPIConfigI18nOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigI18nOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the locale specific configurations for this user
|
||||
*/
|
||||
type GetAPIConfigI18nOK struct {
|
||||
Payload *models.I18nConfig
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api config i18n o k response has a 2xx status code
|
||||
func (o *GetAPIConfigI18nOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api config i18n o k response has a 3xx status code
|
||||
func (o *GetAPIConfigI18nOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api config i18n o k response has a 4xx status code
|
||||
func (o *GetAPIConfigI18nOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api config i18n o k response has a 5xx status code
|
||||
func (o *GetAPIConfigI18nOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api config i18n o k response a status code equal to that given
|
||||
func (o *GetAPIConfigI18nOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigI18nOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/config/i18n][%d] getApiConfigI18nOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigI18nOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/config/i18n][%d] getApiConfigI18nOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigI18nOK) GetPayload() *models.I18nConfig {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigI18nOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.I18nConfig)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
128
client/default_operations/get_api_config_timesheet_parameters.go
Normal file
128
client/default_operations/get_api_config_timesheet_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIConfigTimesheetParams creates a new GetAPIConfigTimesheetParams 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 NewGetAPIConfigTimesheetParams() *GetAPIConfigTimesheetParams {
|
||||
return &GetAPIConfigTimesheetParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigTimesheetParamsWithTimeout creates a new GetAPIConfigTimesheetParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIConfigTimesheetParamsWithTimeout(timeout time.Duration) *GetAPIConfigTimesheetParams {
|
||||
return &GetAPIConfigTimesheetParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigTimesheetParamsWithContext creates a new GetAPIConfigTimesheetParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIConfigTimesheetParamsWithContext(ctx context.Context) *GetAPIConfigTimesheetParams {
|
||||
return &GetAPIConfigTimesheetParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigTimesheetParamsWithHTTPClient creates a new GetAPIConfigTimesheetParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIConfigTimesheetParamsWithHTTPClient(client *http.Client) *GetAPIConfigTimesheetParams {
|
||||
return &GetAPIConfigTimesheetParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigTimesheetParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API config timesheet operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIConfigTimesheetParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API config timesheet params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIConfigTimesheetParams) WithDefaults() *GetAPIConfigTimesheetParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API config timesheet params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIConfigTimesheetParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) WithTimeout(timeout time.Duration) *GetAPIConfigTimesheetParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) WithContext(ctx context.Context) *GetAPIConfigTimesheetParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) WithHTTPClient(client *http.Client) *GetAPIConfigTimesheetParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API config timesheet params
|
||||
func (o *GetAPIConfigTimesheetParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIConfigTimesheetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPIConfigTimesheetReader is a Reader for the GetAPIConfigTimesheet structure.
|
||||
type GetAPIConfigTimesheetReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIConfigTimesheetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIConfigTimesheetOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIConfigTimesheetOK creates a GetAPIConfigTimesheetOK with default headers values
|
||||
func NewGetAPIConfigTimesheetOK() *GetAPIConfigTimesheetOK {
|
||||
return &GetAPIConfigTimesheetOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIConfigTimesheetOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the instance specific timesheet configuration
|
||||
*/
|
||||
type GetAPIConfigTimesheetOK struct {
|
||||
Payload *models.TimesheetConfig
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api config timesheet o k response has a 2xx status code
|
||||
func (o *GetAPIConfigTimesheetOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api config timesheet o k response has a 3xx status code
|
||||
func (o *GetAPIConfigTimesheetOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api config timesheet o k response has a 4xx status code
|
||||
func (o *GetAPIConfigTimesheetOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api config timesheet o k response has a 5xx status code
|
||||
func (o *GetAPIConfigTimesheetOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api config timesheet o k response a status code equal to that given
|
||||
func (o *GetAPIConfigTimesheetOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigTimesheetOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/config/timesheet][%d] getApiConfigTimesheetOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigTimesheetOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/config/timesheet][%d] getApiConfigTimesheetOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigTimesheetOK) GetPayload() *models.TimesheetConfig {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIConfigTimesheetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.TimesheetConfig)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
128
client/default_operations/get_api_ping_parameters.go
Normal file
128
client/default_operations/get_api_ping_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIPingParams creates a new GetAPIPingParams 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 NewGetAPIPingParams() *GetAPIPingParams {
|
||||
return &GetAPIPingParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPingParamsWithTimeout creates a new GetAPIPingParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIPingParamsWithTimeout(timeout time.Duration) *GetAPIPingParams {
|
||||
return &GetAPIPingParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPingParamsWithContext creates a new GetAPIPingParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIPingParamsWithContext(ctx context.Context) *GetAPIPingParams {
|
||||
return &GetAPIPingParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPingParamsWithHTTPClient creates a new GetAPIPingParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIPingParamsWithHTTPClient(client *http.Client) *GetAPIPingParams {
|
||||
return &GetAPIPingParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPingParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API ping operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIPingParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API ping params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIPingParams) WithDefaults() *GetAPIPingParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API ping params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIPingParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API ping params
|
||||
func (o *GetAPIPingParams) WithTimeout(timeout time.Duration) *GetAPIPingParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API ping params
|
||||
func (o *GetAPIPingParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API ping params
|
||||
func (o *GetAPIPingParams) WithContext(ctx context.Context) *GetAPIPingParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API ping params
|
||||
func (o *GetAPIPingParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API ping params
|
||||
func (o *GetAPIPingParams) WithHTTPClient(client *http.Client) *GetAPIPingParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API ping params
|
||||
func (o *GetAPIPingParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIPingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
89
client/default_operations/get_api_ping_responses.go
Normal file
89
client/default_operations/get_api_ping_responses.go
Normal file
@ -0,0 +1,89 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetAPIPingReader is a Reader for the GetAPIPing structure.
|
||||
type GetAPIPingReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIPingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
result := NewGetAPIPingDefault(response.Code())
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code()/100 == 2 {
|
||||
return result, nil
|
||||
}
|
||||
return nil, result
|
||||
}
|
||||
|
||||
// NewGetAPIPingDefault creates a GetAPIPingDefault with default headers values
|
||||
func NewGetAPIPingDefault(code int) *GetAPIPingDefault {
|
||||
return &GetAPIPingDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPingDefault describes a response with status code -1, with default header values.
|
||||
|
||||
GetAPIPingDefault get API ping default
|
||||
*/
|
||||
type GetAPIPingDefault struct {
|
||||
_statusCode int
|
||||
}
|
||||
|
||||
// Code gets the status code for the get API ping default response
|
||||
func (o *GetAPIPingDefault) Code() int {
|
||||
return o._statusCode
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get API ping default response has a 2xx status code
|
||||
func (o *GetAPIPingDefault) IsSuccess() bool {
|
||||
return o._statusCode/100 == 2
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get API ping default response has a 3xx status code
|
||||
func (o *GetAPIPingDefault) IsRedirect() bool {
|
||||
return o._statusCode/100 == 3
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get API ping default response has a 4xx status code
|
||||
func (o *GetAPIPingDefault) IsClientError() bool {
|
||||
return o._statusCode/100 == 4
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get API ping default response has a 5xx status code
|
||||
func (o *GetAPIPingDefault) IsServerError() bool {
|
||||
return o._statusCode/100 == 5
|
||||
}
|
||||
|
||||
// IsCode returns true when this get API ping default response a status code equal to that given
|
||||
func (o *GetAPIPingDefault) IsCode(code int) bool {
|
||||
return o._statusCode == code
|
||||
}
|
||||
|
||||
func (o *GetAPIPingDefault) Error() string {
|
||||
return fmt.Sprintf("[GET /api/ping][%d] GetAPIPing default ", o._statusCode)
|
||||
}
|
||||
|
||||
func (o *GetAPIPingDefault) String() string {
|
||||
return fmt.Sprintf("[GET /api/ping][%d] GetAPIPing default ", o._statusCode)
|
||||
}
|
||||
|
||||
func (o *GetAPIPingDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
128
client/default_operations/get_api_plugins_parameters.go
Normal file
128
client/default_operations/get_api_plugins_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIPluginsParams creates a new GetAPIPluginsParams 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 NewGetAPIPluginsParams() *GetAPIPluginsParams {
|
||||
return &GetAPIPluginsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPluginsParamsWithTimeout creates a new GetAPIPluginsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIPluginsParamsWithTimeout(timeout time.Duration) *GetAPIPluginsParams {
|
||||
return &GetAPIPluginsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPluginsParamsWithContext creates a new GetAPIPluginsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIPluginsParamsWithContext(ctx context.Context) *GetAPIPluginsParams {
|
||||
return &GetAPIPluginsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPluginsParamsWithHTTPClient creates a new GetAPIPluginsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIPluginsParamsWithHTTPClient(client *http.Client) *GetAPIPluginsParams {
|
||||
return &GetAPIPluginsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPluginsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API plugins operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIPluginsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API plugins params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIPluginsParams) WithDefaults() *GetAPIPluginsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API plugins params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIPluginsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) WithTimeout(timeout time.Duration) *GetAPIPluginsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) WithContext(ctx context.Context) *GetAPIPluginsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) WithHTTPClient(client *http.Client) *GetAPIPluginsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API plugins params
|
||||
func (o *GetAPIPluginsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIPluginsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/default_operations/get_api_plugins_responses.go
Normal file
96
client/default_operations/get_api_plugins_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPIPluginsReader is a Reader for the GetAPIPlugins structure.
|
||||
type GetAPIPluginsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIPluginsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIPluginsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIPluginsOK creates a GetAPIPluginsOK with default headers values
|
||||
func NewGetAPIPluginsOK() *GetAPIPluginsOK {
|
||||
return &GetAPIPluginsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIPluginsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a list of plugin names and versions
|
||||
*/
|
||||
type GetAPIPluginsOK struct {
|
||||
Payload []*models.Plugin
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api plugins o k response has a 2xx status code
|
||||
func (o *GetAPIPluginsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api plugins o k response has a 3xx status code
|
||||
func (o *GetAPIPluginsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api plugins o k response has a 4xx status code
|
||||
func (o *GetAPIPluginsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api plugins o k response has a 5xx status code
|
||||
func (o *GetAPIPluginsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api plugins o k response a status code equal to that given
|
||||
func (o *GetAPIPluginsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIPluginsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/plugins][%d] getApiPluginsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIPluginsOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/plugins][%d] getApiPluginsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIPluginsOK) GetPayload() []*models.Plugin {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIPluginsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
128
client/default_operations/get_api_version_parameters.go
Normal file
128
client/default_operations/get_api_version_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIVersionParams creates a new GetAPIVersionParams 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 NewGetAPIVersionParams() *GetAPIVersionParams {
|
||||
return &GetAPIVersionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIVersionParamsWithTimeout creates a new GetAPIVersionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIVersionParamsWithTimeout(timeout time.Duration) *GetAPIVersionParams {
|
||||
return &GetAPIVersionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIVersionParamsWithContext creates a new GetAPIVersionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIVersionParamsWithContext(ctx context.Context) *GetAPIVersionParams {
|
||||
return &GetAPIVersionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIVersionParamsWithHTTPClient creates a new GetAPIVersionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIVersionParamsWithHTTPClient(client *http.Client) *GetAPIVersionParams {
|
||||
return &GetAPIVersionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIVersionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API version operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIVersionParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API version params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIVersionParams) WithDefaults() *GetAPIVersionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API version params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIVersionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API version params
|
||||
func (o *GetAPIVersionParams) WithTimeout(timeout time.Duration) *GetAPIVersionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API version params
|
||||
func (o *GetAPIVersionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API version params
|
||||
func (o *GetAPIVersionParams) WithContext(ctx context.Context) *GetAPIVersionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API version params
|
||||
func (o *GetAPIVersionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API version params
|
||||
func (o *GetAPIVersionParams) WithHTTPClient(client *http.Client) *GetAPIVersionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API version params
|
||||
func (o *GetAPIVersionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/default_operations/get_api_version_responses.go
Normal file
98
client/default_operations/get_api_version_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package default_operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPIVersionReader is a Reader for the GetAPIVersion structure.
|
||||
type GetAPIVersionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIVersionOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIVersionOK creates a GetAPIVersionOK with default headers values
|
||||
func NewGetAPIVersionOK() *GetAPIVersionOK {
|
||||
return &GetAPIVersionOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIVersionOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns version information about the current release
|
||||
*/
|
||||
type GetAPIVersionOK struct {
|
||||
Payload *models.Version
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api version o k response has a 2xx status code
|
||||
func (o *GetAPIVersionOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api version o k response has a 3xx status code
|
||||
func (o *GetAPIVersionOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api version o k response has a 4xx status code
|
||||
func (o *GetAPIVersionOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api version o k response has a 5xx status code
|
||||
func (o *GetAPIVersionOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api version o k response a status code equal to that given
|
||||
func (o *GetAPIVersionOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIVersionOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/version][%d] getApiVersionOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIVersionOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/version][%d] getApiVersionOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIVersionOK) GetPayload() *models.Version {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Version)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user