feat: init
This commit is contained in:
371
client/activity/activity_client.go
Normal file
371
client/activity/activity_client.go
Normal file
@ -0,0 +1,371 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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 activity API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for activity 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 {
|
||||
DeleteAPIActivitiesIDRatesRateID(params *DeleteAPIActivitiesIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPIActivitiesIDRatesRateIDNoContent, error)
|
||||
|
||||
GetAPIActivities(params *GetAPIActivitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesOK, error)
|
||||
|
||||
GetAPIActivitiesID(params *GetAPIActivitiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesIDOK, error)
|
||||
|
||||
GetAPIActivitiesIDRates(params *GetAPIActivitiesIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesIDRatesOK, error)
|
||||
|
||||
PatchAPIActivitiesID(params *PatchAPIActivitiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIActivitiesIDOK, error)
|
||||
|
||||
PatchAPIActivitiesIDMeta(params *PatchAPIActivitiesIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIActivitiesIDMetaOK, error)
|
||||
|
||||
PostAPIActivities(params *PostAPIActivitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIActivitiesOK, error)
|
||||
|
||||
PostAPIActivitiesIDRates(params *PostAPIActivitiesIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIActivitiesIDRatesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIActivitiesIDRatesRateID deletes one rate for an activity
|
||||
*/
|
||||
func (a *Client) DeleteAPIActivitiesIDRatesRateID(params *DeleteAPIActivitiesIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPIActivitiesIDRatesRateIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPIActivitiesIDRatesRateIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPIActivitiesIDRatesRateID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/activities/{id}/rates/{rateId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPIActivitiesIDRatesRateIDReader{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.(*DeleteAPIActivitiesIDRatesRateIDNoContent)
|
||||
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 DeleteAPIActivitiesIDRatesRateID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivities returns a collection of activities
|
||||
*/
|
||||
func (a *Client) GetAPIActivities(params *GetAPIActivitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIActivitiesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIActivities",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/activities",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIActivitiesReader{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.(*GetAPIActivitiesOK)
|
||||
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 GetAPIActivities: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesID returns one activity
|
||||
*/
|
||||
func (a *Client) GetAPIActivitiesID(params *GetAPIActivitiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIActivitiesIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIActivitiesID",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/activities/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIActivitiesIDReader{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.(*GetAPIActivitiesIDOK)
|
||||
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 GetAPIActivitiesID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesIDRates returns a collection of all rates for one activity
|
||||
*/
|
||||
func (a *Client) GetAPIActivitiesIDRates(params *GetAPIActivitiesIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIActivitiesIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIActivitiesIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIActivitiesIDRates",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/activities/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIActivitiesIDRatesReader{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.(*GetAPIActivitiesIDRatesOK)
|
||||
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 GetAPIActivitiesIDRates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesID updates an existing activity
|
||||
|
||||
Update an existing activity, you can pass all or just a subset of all attributes
|
||||
*/
|
||||
func (a *Client) PatchAPIActivitiesID(params *PatchAPIActivitiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIActivitiesIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPIActivitiesIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPIActivitiesID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/activities/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPIActivitiesIDReader{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.(*PatchAPIActivitiesIDOK)
|
||||
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 PatchAPIActivitiesID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDMeta sets the value of a meta field for an existing activity
|
||||
*/
|
||||
func (a *Client) PatchAPIActivitiesIDMeta(params *PatchAPIActivitiesIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIActivitiesIDMetaOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPIActivitiesIDMetaParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPIActivitiesIDMeta",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/activities/{id}/meta",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPIActivitiesIDMetaReader{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.(*PatchAPIActivitiesIDMetaOK)
|
||||
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 PatchAPIActivitiesIDMeta: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivities creates a new activity
|
||||
|
||||
Creates a new activity and returns it afterwards
|
||||
*/
|
||||
func (a *Client) PostAPIActivities(params *PostAPIActivitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIActivitiesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPIActivitiesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPIActivities",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/activities",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPIActivitiesReader{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.(*PostAPIActivitiesOK)
|
||||
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 PostAPIActivities: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivitiesIDRates adds a new rate to an activity
|
||||
*/
|
||||
func (a *Client) PostAPIActivitiesIDRates(params *PostAPIActivitiesIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIActivitiesIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPIActivitiesIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPIActivitiesIDRates",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/activities/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPIActivitiesIDRatesReader{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.(*PostAPIActivitiesIDRatesOK)
|
||||
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 PostAPIActivitiesIDRates: 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
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewDeleteAPIActivitiesIDRatesRateIDParams creates a new DeleteAPIActivitiesIDRatesRateIDParams 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 NewDeleteAPIActivitiesIDRatesRateIDParams() *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
return &DeleteAPIActivitiesIDRatesRateIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIActivitiesIDRatesRateIDParamsWithTimeout creates a new DeleteAPIActivitiesIDRatesRateIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPIActivitiesIDRatesRateIDParamsWithTimeout(timeout time.Duration) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
return &DeleteAPIActivitiesIDRatesRateIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIActivitiesIDRatesRateIDParamsWithContext creates a new DeleteAPIActivitiesIDRatesRateIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPIActivitiesIDRatesRateIDParamsWithContext(ctx context.Context) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
return &DeleteAPIActivitiesIDRatesRateIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIActivitiesIDRatesRateIDParamsWithHTTPClient creates a new DeleteAPIActivitiesIDRatesRateIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPIActivitiesIDRatesRateIDParamsWithHTTPClient(client *http.Client) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
return &DeleteAPIActivitiesIDRatesRateIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIActivitiesIDRatesRateIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API activities ID rates rate ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPIActivitiesIDRatesRateIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The activity whose rate will be removed
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* RateID.
|
||||
|
||||
The rate to remove
|
||||
*/
|
||||
RateID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API activities ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithDefaults() *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API activities ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithTimeout(timeout time.Duration) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithContext(ctx context.Context) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithHTTPClient(client *http.Client) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithID(id int64) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithRateID adds the rateID to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WithRateID(rateID int64) *DeleteAPIActivitiesIDRatesRateIDParams {
|
||||
o.SetRateID(rateID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRateID adds the rateId to the delete API activities ID rates rate ID params
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) SetRateID(rateID int64) {
|
||||
o.RateID = rateID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param rateId
|
||||
if err := r.SetPathParam("rateId", swag.FormatInt64(o.RateID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPIActivitiesIDRatesRateIDReader is a Reader for the DeleteAPIActivitiesIDRatesRateID structure.
|
||||
type DeleteAPIActivitiesIDRatesRateIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPIActivitiesIDRatesRateIDNoContent()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIActivitiesIDRatesRateIDNoContent creates a DeleteAPIActivitiesIDRatesRateIDNoContent with default headers values
|
||||
func NewDeleteAPIActivitiesIDRatesRateIDNoContent() *DeleteAPIActivitiesIDRatesRateIDNoContent {
|
||||
return &DeleteAPIActivitiesIDRatesRateIDNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIActivitiesIDRatesRateIDNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
Returns no content: 204 on successful delete
|
||||
*/
|
||||
type DeleteAPIActivitiesIDRatesRateIDNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api activities Id rates rate Id no content response has a 2xx status code
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api activities Id rates rate Id no content response has a 3xx status code
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api activities Id rates rate Id no content response has a 4xx status code
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api activities Id rates rate Id no content response has a 5xx status code
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api activities Id rates rate Id no content response a status code equal to that given
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/activities/{id}/rates/{rateId}][%d] deleteApiActivitiesIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/activities/{id}/rates/{rateId}][%d] deleteApiActivitiesIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIActivitiesIDRatesRateIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
152
client/activity/get_api_activities_id_parameters.go
Normal file
152
client/activity/get_api_activities_id_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAPIActivitiesIDParams creates a new GetAPIActivitiesIDParams 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 NewGetAPIActivitiesIDParams() *GetAPIActivitiesIDParams {
|
||||
return &GetAPIActivitiesIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDParamsWithTimeout creates a new GetAPIActivitiesIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIActivitiesIDParamsWithTimeout(timeout time.Duration) *GetAPIActivitiesIDParams {
|
||||
return &GetAPIActivitiesIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDParamsWithContext creates a new GetAPIActivitiesIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIActivitiesIDParamsWithContext(ctx context.Context) *GetAPIActivitiesIDParams {
|
||||
return &GetAPIActivitiesIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDParamsWithHTTPClient creates a new GetAPIActivitiesIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIActivitiesIDParamsWithHTTPClient(client *http.Client) *GetAPIActivitiesIDParams {
|
||||
return &GetAPIActivitiesIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API activities ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIActivitiesIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Activity ID to fetch
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API activities ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesIDParams) WithDefaults() *GetAPIActivitiesIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API activities ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) WithTimeout(timeout time.Duration) *GetAPIActivitiesIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) WithContext(ctx context.Context) *GetAPIActivitiesIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) WithHTTPClient(client *http.Client) *GetAPIActivitiesIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) WithID(id int64) *GetAPIActivitiesIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API activities ID params
|
||||
func (o *GetAPIActivitiesIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIActivitiesIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
152
client/activity/get_api_activities_id_rates_parameters.go
Normal file
152
client/activity/get_api_activities_id_rates_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAPIActivitiesIDRatesParams creates a new GetAPIActivitiesIDRatesParams 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 NewGetAPIActivitiesIDRatesParams() *GetAPIActivitiesIDRatesParams {
|
||||
return &GetAPIActivitiesIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDRatesParamsWithTimeout creates a new GetAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIActivitiesIDRatesParamsWithTimeout(timeout time.Duration) *GetAPIActivitiesIDRatesParams {
|
||||
return &GetAPIActivitiesIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDRatesParamsWithContext creates a new GetAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIActivitiesIDRatesParamsWithContext(ctx context.Context) *GetAPIActivitiesIDRatesParams {
|
||||
return &GetAPIActivitiesIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDRatesParamsWithHTTPClient creates a new GetAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIActivitiesIDRatesParamsWithHTTPClient(client *http.Client) *GetAPIActivitiesIDRatesParams {
|
||||
return &GetAPIActivitiesIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API activities ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIActivitiesIDRatesParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The activity whose rates will be returned
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API activities ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesIDRatesParams) WithDefaults() *GetAPIActivitiesIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API activities ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) WithTimeout(timeout time.Duration) *GetAPIActivitiesIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) WithContext(ctx context.Context) *GetAPIActivitiesIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) WithHTTPClient(client *http.Client) *GetAPIActivitiesIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) WithID(id int64) *GetAPIActivitiesIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API activities ID rates params
|
||||
func (o *GetAPIActivitiesIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIActivitiesIDRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/activity/get_api_activities_id_rates_responses.go
Normal file
96
client/activity/get_api_activities_id_rates_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIActivitiesIDRatesReader is a Reader for the GetAPIActivitiesIDRates structure.
|
||||
type GetAPIActivitiesIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIActivitiesIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIActivitiesIDRatesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDRatesOK creates a GetAPIActivitiesIDRatesOK with default headers values
|
||||
func NewGetAPIActivitiesIDRatesOK() *GetAPIActivitiesIDRatesOK {
|
||||
return &GetAPIActivitiesIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of activity rate entities
|
||||
*/
|
||||
type GetAPIActivitiesIDRatesOK struct {
|
||||
Payload []*models.ActivityRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api activities Id rates o k response has a 2xx status code
|
||||
func (o *GetAPIActivitiesIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api activities Id rates o k response has a 3xx status code
|
||||
func (o *GetAPIActivitiesIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api activities Id rates o k response has a 4xx status code
|
||||
func (o *GetAPIActivitiesIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api activities Id rates o k response has a 5xx status code
|
||||
func (o *GetAPIActivitiesIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api activities Id rates o k response a status code equal to that given
|
||||
func (o *GetAPIActivitiesIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/activities/{id}/rates][%d] getApiActivitiesIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/activities/{id}/rates][%d] getApiActivitiesIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDRatesOK) GetPayload() []*models.ActivityRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDRatesOK) 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
|
||||
}
|
98
client/activity/get_api_activities_id_responses.go
Normal file
98
client/activity/get_api_activities_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIActivitiesIDReader is a Reader for the GetAPIActivitiesID structure.
|
||||
type GetAPIActivitiesIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIActivitiesIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIActivitiesIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesIDOK creates a GetAPIActivitiesIDOK with default headers values
|
||||
func NewGetAPIActivitiesIDOK() *GetAPIActivitiesIDOK {
|
||||
return &GetAPIActivitiesIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns one activity entity
|
||||
*/
|
||||
type GetAPIActivitiesIDOK struct {
|
||||
Payload *models.ActivityEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api activities Id o k response has a 2xx status code
|
||||
func (o *GetAPIActivitiesIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api activities Id o k response has a 3xx status code
|
||||
func (o *GetAPIActivitiesIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api activities Id o k response has a 4xx status code
|
||||
func (o *GetAPIActivitiesIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api activities Id o k response has a 5xx status code
|
||||
func (o *GetAPIActivitiesIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api activities Id o k response a status code equal to that given
|
||||
func (o *GetAPIActivitiesIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/activities/{id}][%d] getApiActivitiesIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/activities/{id}][%d] getApiActivitiesIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDOK) GetPayload() *models.ActivityEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActivityEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
338
client/activity/get_api_activities_parameters.go
Normal file
338
client/activity/get_api_activities_parameters.go
Normal file
@ -0,0 +1,338 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIActivitiesParams creates a new GetAPIActivitiesParams 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 NewGetAPIActivitiesParams() *GetAPIActivitiesParams {
|
||||
return &GetAPIActivitiesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesParamsWithTimeout creates a new GetAPIActivitiesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIActivitiesParamsWithTimeout(timeout time.Duration) *GetAPIActivitiesParams {
|
||||
return &GetAPIActivitiesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesParamsWithContext creates a new GetAPIActivitiesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIActivitiesParamsWithContext(ctx context.Context) *GetAPIActivitiesParams {
|
||||
return &GetAPIActivitiesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesParamsWithHTTPClient creates a new GetAPIActivitiesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIActivitiesParamsWithHTTPClient(client *http.Client) *GetAPIActivitiesParams {
|
||||
return &GetAPIActivitiesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API activities operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIActivitiesParams struct {
|
||||
|
||||
/* Globals.
|
||||
|
||||
Use if you want to fetch only global activities. Allowed values: true (default: false)
|
||||
*/
|
||||
Globals string
|
||||
|
||||
/* GlobalsFirst.
|
||||
|
||||
Deprecated parameter, value is not used any more
|
||||
*/
|
||||
GlobalsFirst string
|
||||
|
||||
/* Order.
|
||||
|
||||
The result order. Allowed values: ASC, DESC (default: ASC)
|
||||
*/
|
||||
Order string
|
||||
|
||||
/* OrderBy.
|
||||
|
||||
The field by which results will be ordered. Allowed values: id, name, project (default: name)
|
||||
*/
|
||||
OrderBy string
|
||||
|
||||
/* Project.
|
||||
|
||||
Project ID to filter activities
|
||||
*/
|
||||
Project string
|
||||
|
||||
/* Projects.
|
||||
|
||||
Comma separated list of project IDs to filter activities
|
||||
*/
|
||||
Projects string
|
||||
|
||||
/* Term.
|
||||
|
||||
Free search term
|
||||
*/
|
||||
Term *string
|
||||
|
||||
/* Visible.
|
||||
|
||||
Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1)
|
||||
*/
|
||||
Visible string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API activities params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesParams) WithDefaults() *GetAPIActivitiesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API activities params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIActivitiesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithTimeout(timeout time.Duration) *GetAPIActivitiesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithContext(ctx context.Context) *GetAPIActivitiesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithHTTPClient(client *http.Client) *GetAPIActivitiesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithGlobals adds the globals to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithGlobals(globals string) *GetAPIActivitiesParams {
|
||||
o.SetGlobals(globals)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetGlobals adds the globals to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetGlobals(globals string) {
|
||||
o.Globals = globals
|
||||
}
|
||||
|
||||
// WithGlobalsFirst adds the globalsFirst to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithGlobalsFirst(globalsFirst string) *GetAPIActivitiesParams {
|
||||
o.SetGlobalsFirst(globalsFirst)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetGlobalsFirst adds the globalsFirst to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetGlobalsFirst(globalsFirst string) {
|
||||
o.GlobalsFirst = globalsFirst
|
||||
}
|
||||
|
||||
// WithOrder adds the order to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithOrder(order string) *GetAPIActivitiesParams {
|
||||
o.SetOrder(order)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrder adds the order to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetOrder(order string) {
|
||||
o.Order = order
|
||||
}
|
||||
|
||||
// WithOrderBy adds the orderBy to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithOrderBy(orderBy string) *GetAPIActivitiesParams {
|
||||
o.SetOrderBy(orderBy)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrderBy adds the orderBy to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetOrderBy(orderBy string) {
|
||||
o.OrderBy = orderBy
|
||||
}
|
||||
|
||||
// WithProject adds the project to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithProject(project string) *GetAPIActivitiesParams {
|
||||
o.SetProject(project)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetProject adds the project to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetProject(project string) {
|
||||
o.Project = project
|
||||
}
|
||||
|
||||
// WithProjects adds the projects to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithProjects(projects string) *GetAPIActivitiesParams {
|
||||
o.SetProjects(projects)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetProjects adds the projects to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetProjects(projects string) {
|
||||
o.Projects = projects
|
||||
}
|
||||
|
||||
// WithTerm adds the term to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithTerm(term *string) *GetAPIActivitiesParams {
|
||||
o.SetTerm(term)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTerm adds the term to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetTerm(term *string) {
|
||||
o.Term = term
|
||||
}
|
||||
|
||||
// WithVisible adds the visible to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) WithVisible(visible string) *GetAPIActivitiesParams {
|
||||
o.SetVisible(visible)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetVisible adds the visible to the get API activities params
|
||||
func (o *GetAPIActivitiesParams) SetVisible(visible string) {
|
||||
o.Visible = visible
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIActivitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// query param globals
|
||||
qrGlobals := o.Globals
|
||||
qGlobals := qrGlobals
|
||||
|
||||
if err := r.SetQueryParam("globals", qGlobals); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param globalsFirst
|
||||
qrGlobalsFirst := o.GlobalsFirst
|
||||
qGlobalsFirst := qrGlobalsFirst
|
||||
|
||||
if err := r.SetQueryParam("globalsFirst", qGlobalsFirst); 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 project
|
||||
qrProject := o.Project
|
||||
qProject := qrProject
|
||||
|
||||
if err := r.SetQueryParam("project", qProject); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param projects
|
||||
qrProjects := o.Projects
|
||||
qProjects := qrProjects
|
||||
|
||||
if err := r.SetQueryParam("projects", qProjects); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.Term != nil {
|
||||
|
||||
// query param term
|
||||
var qrTerm string
|
||||
|
||||
if o.Term != nil {
|
||||
qrTerm = *o.Term
|
||||
}
|
||||
qTerm := qrTerm
|
||||
if qTerm != "" {
|
||||
|
||||
if err := r.SetQueryParam("term", qTerm); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// query param visible
|
||||
qrVisible := o.Visible
|
||||
qVisible := qrVisible
|
||||
|
||||
if err := r.SetQueryParam("visible", qVisible); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/activity/get_api_activities_responses.go
Normal file
96
client/activity/get_api_activities_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIActivitiesReader is a Reader for the GetAPIActivities structure.
|
||||
type GetAPIActivitiesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIActivitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIActivitiesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIActivitiesOK creates a GetAPIActivitiesOK with default headers values
|
||||
func NewGetAPIActivitiesOK() *GetAPIActivitiesOK {
|
||||
return &GetAPIActivitiesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIActivitiesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of activity entities
|
||||
*/
|
||||
type GetAPIActivitiesOK struct {
|
||||
Payload []*models.ActivityCollection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api activities o k response has a 2xx status code
|
||||
func (o *GetAPIActivitiesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api activities o k response has a 3xx status code
|
||||
func (o *GetAPIActivitiesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api activities o k response has a 4xx status code
|
||||
func (o *GetAPIActivitiesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api activities o k response has a 5xx status code
|
||||
func (o *GetAPIActivitiesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api activities o k response a status code equal to that given
|
||||
func (o *GetAPIActivitiesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/activities][%d] getApiActivitiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/activities][%d] getApiActivitiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesOK) GetPayload() []*models.ActivityCollection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIActivitiesOK) 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
|
||||
}
|
169
client/activity/patch_api_activities_id_meta_parameters.go
Normal file
169
client/activity/patch_api_activities_id_meta_parameters.go
Normal file
@ -0,0 +1,169 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewPatchAPIActivitiesIDMetaParams creates a new PatchAPIActivitiesIDMetaParams 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 NewPatchAPIActivitiesIDMetaParams() *PatchAPIActivitiesIDMetaParams {
|
||||
return &PatchAPIActivitiesIDMetaParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDMetaParamsWithTimeout creates a new PatchAPIActivitiesIDMetaParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPIActivitiesIDMetaParamsWithTimeout(timeout time.Duration) *PatchAPIActivitiesIDMetaParams {
|
||||
return &PatchAPIActivitiesIDMetaParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDMetaParamsWithContext creates a new PatchAPIActivitiesIDMetaParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPIActivitiesIDMetaParamsWithContext(ctx context.Context) *PatchAPIActivitiesIDMetaParams {
|
||||
return &PatchAPIActivitiesIDMetaParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDMetaParamsWithHTTPClient creates a new PatchAPIActivitiesIDMetaParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPIActivitiesIDMetaParamsWithHTTPClient(client *http.Client) *PatchAPIActivitiesIDMetaParams {
|
||||
return &PatchAPIActivitiesIDMetaParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDMetaParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API activities ID meta operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPIActivitiesIDMetaParams struct {
|
||||
|
||||
// Body.
|
||||
Body PatchAPIActivitiesIDMetaBody
|
||||
|
||||
/* ID.
|
||||
|
||||
Activity record ID to set the meta-field value for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API activities ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithDefaults() *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API activities ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithTimeout(timeout time.Duration) *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithContext(ctx context.Context) *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithHTTPClient(client *http.Client) *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithBody(body PatchAPIActivitiesIDMetaBody) *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetBody(body PatchAPIActivitiesIDMetaBody) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WithID(id int64) *PatchAPIActivitiesIDMetaParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API activities ID meta params
|
||||
func (o *PatchAPIActivitiesIDMetaParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPIActivitiesIDMetaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
176
client/activity/patch_api_activities_id_meta_responses.go
Normal file
176
client/activity/patch_api_activities_id_meta_responses.go
Normal file
@ -0,0 +1,176 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PatchAPIActivitiesIDMetaReader is a Reader for the PatchAPIActivitiesIDMeta structure.
|
||||
type PatchAPIActivitiesIDMetaReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPIActivitiesIDMetaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPIActivitiesIDMetaOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDMetaOK creates a PatchAPIActivitiesIDMetaOK with default headers values
|
||||
func NewPatchAPIActivitiesIDMetaOK() *PatchAPIActivitiesIDMetaOK {
|
||||
return &PatchAPIActivitiesIDMetaOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDMetaOK describes a response with status code 200, with default header values.
|
||||
|
||||
Sets the value of an existing/configured meta-field. You cannot create unknown meta-fields, if the given name is not a configured meta-field, this will return an exception.
|
||||
*/
|
||||
type PatchAPIActivitiesIDMetaOK struct {
|
||||
Payload *models.ActivityEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api activities Id meta o k response has a 2xx status code
|
||||
func (o *PatchAPIActivitiesIDMetaOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api activities Id meta o k response has a 3xx status code
|
||||
func (o *PatchAPIActivitiesIDMetaOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api activities Id meta o k response has a 4xx status code
|
||||
func (o *PatchAPIActivitiesIDMetaOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api activities Id meta o k response has a 5xx status code
|
||||
func (o *PatchAPIActivitiesIDMetaOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api activities Id meta o k response a status code equal to that given
|
||||
func (o *PatchAPIActivitiesIDMetaOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/activities/{id}/meta][%d] patchApiActivitiesIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/activities/{id}/meta][%d] patchApiActivitiesIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaOK) GetPayload() *models.ActivityEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActivityEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDMetaBody patch API activities ID meta body
|
||||
swagger:model PatchAPIActivitiesIDMetaBody
|
||||
*/
|
||||
type PatchAPIActivitiesIDMetaBody struct {
|
||||
|
||||
// The meta-field name
|
||||
// Required: true
|
||||
Name *string `json:"name"`
|
||||
|
||||
// The meta-field value
|
||||
// Required: true
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
// Validate validates this patch API activities ID meta body
|
||||
func (o *PatchAPIActivitiesIDMetaBody) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := o.validateName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := o.validateValue(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaBody) validateName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"name", "body", o.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDMetaBody) validateValue(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"value", "body", o.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this patch API activities ID meta body based on context it is used
|
||||
func (o *PatchAPIActivitiesIDMetaBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (o *PatchAPIActivitiesIDMetaBody) MarshalBinary() ([]byte, error) {
|
||||
if o == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(o)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (o *PatchAPIActivitiesIDMetaBody) UnmarshalBinary(b []byte) error {
|
||||
var res PatchAPIActivitiesIDMetaBody
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = res
|
||||
return nil
|
||||
}
|
173
client/activity/patch_api_activities_id_parameters.go
Normal file
173
client/activity/patch_api_activities_id_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPatchAPIActivitiesIDParams creates a new PatchAPIActivitiesIDParams 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 NewPatchAPIActivitiesIDParams() *PatchAPIActivitiesIDParams {
|
||||
return &PatchAPIActivitiesIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDParamsWithTimeout creates a new PatchAPIActivitiesIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPIActivitiesIDParamsWithTimeout(timeout time.Duration) *PatchAPIActivitiesIDParams {
|
||||
return &PatchAPIActivitiesIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDParamsWithContext creates a new PatchAPIActivitiesIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPIActivitiesIDParamsWithContext(ctx context.Context) *PatchAPIActivitiesIDParams {
|
||||
return &PatchAPIActivitiesIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDParamsWithHTTPClient creates a new PatchAPIActivitiesIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPIActivitiesIDParamsWithHTTPClient(client *http.Client) *PatchAPIActivitiesIDParams {
|
||||
return &PatchAPIActivitiesIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API activities ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPIActivitiesIDParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ActivityEditForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Activity ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API activities ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIActivitiesIDParams) WithDefaults() *PatchAPIActivitiesIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API activities ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIActivitiesIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) WithTimeout(timeout time.Duration) *PatchAPIActivitiesIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) WithContext(ctx context.Context) *PatchAPIActivitiesIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) WithHTTPClient(client *http.Client) *PatchAPIActivitiesIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) WithBody(body *models.ActivityEditForm) *PatchAPIActivitiesIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) SetBody(body *models.ActivityEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) WithID(id int64) *PatchAPIActivitiesIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API activities ID params
|
||||
func (o *PatchAPIActivitiesIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPIActivitiesIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/activity/patch_api_activities_id_responses.go
Normal file
98
client/activity/patch_api_activities_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPIActivitiesIDReader is a Reader for the PatchAPIActivitiesID structure.
|
||||
type PatchAPIActivitiesIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPIActivitiesIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPIActivitiesIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIActivitiesIDOK creates a PatchAPIActivitiesIDOK with default headers values
|
||||
func NewPatchAPIActivitiesIDOK() *PatchAPIActivitiesIDOK {
|
||||
return &PatchAPIActivitiesIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIActivitiesIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated activity
|
||||
*/
|
||||
type PatchAPIActivitiesIDOK struct {
|
||||
Payload *models.ActivityEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api activities Id o k response has a 2xx status code
|
||||
func (o *PatchAPIActivitiesIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api activities Id o k response has a 3xx status code
|
||||
func (o *PatchAPIActivitiesIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api activities Id o k response has a 4xx status code
|
||||
func (o *PatchAPIActivitiesIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api activities Id o k response has a 5xx status code
|
||||
func (o *PatchAPIActivitiesIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api activities Id o k response a status code equal to that given
|
||||
func (o *PatchAPIActivitiesIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/activities/{id}][%d] patchApiActivitiesIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/activities/{id}][%d] patchApiActivitiesIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDOK) GetPayload() *models.ActivityEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPIActivitiesIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActivityEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
173
client/activity/post_api_activities_id_rates_parameters.go
Normal file
173
client/activity/post_api_activities_id_rates_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPostAPIActivitiesIDRatesParams creates a new PostAPIActivitiesIDRatesParams 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 NewPostAPIActivitiesIDRatesParams() *PostAPIActivitiesIDRatesParams {
|
||||
return &PostAPIActivitiesIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesIDRatesParamsWithTimeout creates a new PostAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPIActivitiesIDRatesParamsWithTimeout(timeout time.Duration) *PostAPIActivitiesIDRatesParams {
|
||||
return &PostAPIActivitiesIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesIDRatesParamsWithContext creates a new PostAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPIActivitiesIDRatesParamsWithContext(ctx context.Context) *PostAPIActivitiesIDRatesParams {
|
||||
return &PostAPIActivitiesIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesIDRatesParamsWithHTTPClient creates a new PostAPIActivitiesIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPIActivitiesIDRatesParamsWithHTTPClient(client *http.Client) *PostAPIActivitiesIDRatesParams {
|
||||
return &PostAPIActivitiesIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivitiesIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API activities ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPIActivitiesIDRatesParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ActivityRateForm
|
||||
|
||||
/* ID.
|
||||
|
||||
The activity to add the rate for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API activities ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithDefaults() *PostAPIActivitiesIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API activities ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithTimeout(timeout time.Duration) *PostAPIActivitiesIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithContext(ctx context.Context) *PostAPIActivitiesIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithHTTPClient(client *http.Client) *PostAPIActivitiesIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithBody(body *models.ActivityRateForm) *PostAPIActivitiesIDRatesParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetBody(body *models.ActivityRateForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) WithID(id int64) *PostAPIActivitiesIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API activities ID rates params
|
||||
func (o *PostAPIActivitiesIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPIActivitiesIDRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/activity/post_api_activities_id_rates_responses.go
Normal file
98
client/activity/post_api_activities_id_rates_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPIActivitiesIDRatesReader is a Reader for the PostAPIActivitiesIDRates structure.
|
||||
type PostAPIActivitiesIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPIActivitiesIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPIActivitiesIDRatesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesIDRatesOK creates a PostAPIActivitiesIDRatesOK with default headers values
|
||||
func NewPostAPIActivitiesIDRatesOK() *PostAPIActivitiesIDRatesOK {
|
||||
return &PostAPIActivitiesIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivitiesIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created rate
|
||||
*/
|
||||
type PostAPIActivitiesIDRatesOK struct {
|
||||
Payload *models.ActivityRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api activities Id rates o k response has a 2xx status code
|
||||
func (o *PostAPIActivitiesIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api activities Id rates o k response has a 3xx status code
|
||||
func (o *PostAPIActivitiesIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api activities Id rates o k response has a 4xx status code
|
||||
func (o *PostAPIActivitiesIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api activities Id rates o k response has a 5xx status code
|
||||
func (o *PostAPIActivitiesIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api activities Id rates o k response a status code equal to that given
|
||||
func (o *PostAPIActivitiesIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/activities/{id}/rates][%d] postApiActivitiesIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/activities/{id}/rates][%d] postApiActivitiesIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesIDRatesOK) GetPayload() *models.ActivityRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesIDRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActivityRate)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
150
client/activity/post_api_activities_parameters.go
Normal file
150
client/activity/post_api_activities_parameters.go
Normal file
@ -0,0 +1,150 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPostAPIActivitiesParams creates a new PostAPIActivitiesParams 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 NewPostAPIActivitiesParams() *PostAPIActivitiesParams {
|
||||
return &PostAPIActivitiesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesParamsWithTimeout creates a new PostAPIActivitiesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPIActivitiesParamsWithTimeout(timeout time.Duration) *PostAPIActivitiesParams {
|
||||
return &PostAPIActivitiesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesParamsWithContext creates a new PostAPIActivitiesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPIActivitiesParamsWithContext(ctx context.Context) *PostAPIActivitiesParams {
|
||||
return &PostAPIActivitiesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesParamsWithHTTPClient creates a new PostAPIActivitiesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPIActivitiesParamsWithHTTPClient(client *http.Client) *PostAPIActivitiesParams {
|
||||
return &PostAPIActivitiesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivitiesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API activities operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPIActivitiesParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ActivityEditForm
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API activities params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIActivitiesParams) WithDefaults() *PostAPIActivitiesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API activities params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIActivitiesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) WithTimeout(timeout time.Duration) *PostAPIActivitiesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) WithContext(ctx context.Context) *PostAPIActivitiesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) WithHTTPClient(client *http.Client) *PostAPIActivitiesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) WithBody(body *models.ActivityEditForm) *PostAPIActivitiesParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API activities params
|
||||
func (o *PostAPIActivitiesParams) SetBody(body *models.ActivityEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPIActivitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/activity/post_api_activities_responses.go
Normal file
98
client/activity/post_api_activities_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package activity
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPIActivitiesReader is a Reader for the PostAPIActivities structure.
|
||||
type PostAPIActivitiesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPIActivitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPIActivitiesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIActivitiesOK creates a PostAPIActivitiesOK with default headers values
|
||||
func NewPostAPIActivitiesOK() *PostAPIActivitiesOK {
|
||||
return &PostAPIActivitiesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIActivitiesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created activity
|
||||
*/
|
||||
type PostAPIActivitiesOK struct {
|
||||
Payload *models.ActivityEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api activities o k response has a 2xx status code
|
||||
func (o *PostAPIActivitiesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api activities o k response has a 3xx status code
|
||||
func (o *PostAPIActivitiesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api activities o k response has a 4xx status code
|
||||
func (o *PostAPIActivitiesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api activities o k response has a 5xx status code
|
||||
func (o *PostAPIActivitiesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api activities o k response a status code equal to that given
|
||||
func (o *PostAPIActivitiesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/activities][%d] postApiActivitiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/activities][%d] postApiActivitiesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesOK) GetPayload() *models.ActivityEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPIActivitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActivityEntity)
|
||||
|
||||
// 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