feat: init
This commit is contained in:
152
client/task/delete_api_tasks_id_parameters.go
Normal file
152
client/task/delete_api_tasks_id_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITasksIDParams creates a new DeleteAPITasksIDParams 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 NewDeleteAPITasksIDParams() *DeleteAPITasksIDParams {
|
||||
return &DeleteAPITasksIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITasksIDParamsWithTimeout creates a new DeleteAPITasksIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITasksIDParamsWithTimeout(timeout time.Duration) *DeleteAPITasksIDParams {
|
||||
return &DeleteAPITasksIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITasksIDParamsWithContext creates a new DeleteAPITasksIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITasksIDParamsWithContext(ctx context.Context) *DeleteAPITasksIDParams {
|
||||
return &DeleteAPITasksIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITasksIDParamsWithHTTPClient creates a new DeleteAPITasksIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITasksIDParamsWithHTTPClient(client *http.Client) *DeleteAPITasksIDParams {
|
||||
return &DeleteAPITasksIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITasksIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API tasks ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITasksIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task record ID to delete
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITasksIDParams) WithDefaults() *DeleteAPITasksIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITasksIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) WithTimeout(timeout time.Duration) *DeleteAPITasksIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) WithContext(ctx context.Context) *DeleteAPITasksIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) WithHTTPClient(client *http.Client) *DeleteAPITasksIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) WithID(id int64) *DeleteAPITasksIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API tasks ID params
|
||||
func (o *DeleteAPITasksIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITasksIDParams) 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
|
||||
}
|
83
client/task/delete_api_tasks_id_responses.go
Normal file
83
client/task/delete_api_tasks_id_responses.go
Normal file
@ -0,0 +1,83 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITasksIDReader is a Reader for the DeleteAPITasksID structure.
|
||||
type DeleteAPITasksIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITasksIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPITasksIDNoContent()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITasksIDNoContent creates a DeleteAPITasksIDNoContent with default headers values
|
||||
func NewDeleteAPITasksIDNoContent() *DeleteAPITasksIDNoContent {
|
||||
return &DeleteAPITasksIDNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITasksIDNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
Delete one task record
|
||||
*/
|
||||
type DeleteAPITasksIDNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api tasks Id no content response has a 2xx status code
|
||||
func (o *DeleteAPITasksIDNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api tasks Id no content response has a 3xx status code
|
||||
func (o *DeleteAPITasksIDNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api tasks Id no content response has a 4xx status code
|
||||
func (o *DeleteAPITasksIDNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api tasks Id no content response has a 5xx status code
|
||||
func (o *DeleteAPITasksIDNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api tasks Id no content response a status code equal to that given
|
||||
func (o *DeleteAPITasksIDNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
func (o *DeleteAPITasksIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/tasks/{id}][%d] deleteApiTasksIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITasksIDNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/tasks/{id}][%d] deleteApiTasksIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITasksIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
152
client/task/get_api_tasks_id_parameters.go
Normal file
152
client/task/get_api_tasks_id_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPITasksIDParams creates a new GetAPITasksIDParams 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 NewGetAPITasksIDParams() *GetAPITasksIDParams {
|
||||
return &GetAPITasksIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksIDParamsWithTimeout creates a new GetAPITasksIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPITasksIDParamsWithTimeout(timeout time.Duration) *GetAPITasksIDParams {
|
||||
return &GetAPITasksIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksIDParamsWithContext creates a new GetAPITasksIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPITasksIDParamsWithContext(ctx context.Context) *GetAPITasksIDParams {
|
||||
return &GetAPITasksIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksIDParamsWithHTTPClient creates a new GetAPITasksIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPITasksIDParamsWithHTTPClient(client *http.Client) *GetAPITasksIDParams {
|
||||
return &GetAPITasksIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasksIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API tasks ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPITasksIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to fetch
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITasksIDParams) WithDefaults() *GetAPITasksIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITasksIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) WithTimeout(timeout time.Duration) *GetAPITasksIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) WithContext(ctx context.Context) *GetAPITasksIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) WithHTTPClient(client *http.Client) *GetAPITasksIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) WithID(id int64) *GetAPITasksIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API tasks ID params
|
||||
func (o *GetAPITasksIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPITasksIDParams) 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
|
||||
}
|
98
client/task/get_api_tasks_id_responses.go
Normal file
98
client/task/get_api_tasks_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPITasksIDReader is a Reader for the GetAPITasksID structure.
|
||||
type GetAPITasksIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPITasksIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPITasksIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksIDOK creates a GetAPITasksIDOK with default headers values
|
||||
func NewGetAPITasksIDOK() *GetAPITasksIDOK {
|
||||
return &GetAPITasksIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasksIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns one task entity
|
||||
*/
|
||||
type GetAPITasksIDOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api tasks Id o k response has a 2xx status code
|
||||
func (o *GetAPITasksIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api tasks Id o k response has a 3xx status code
|
||||
func (o *GetAPITasksIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api tasks Id o k response has a 4xx status code
|
||||
func (o *GetAPITasksIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api tasks Id o k response has a 5xx status code
|
||||
func (o *GetAPITasksIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api tasks Id o k response a status code equal to that given
|
||||
func (o *GetAPITasksIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPITasksIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/tasks/{id}][%d] getApiTasksIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITasksIDOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/tasks/{id}][%d] getApiTasksIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITasksIDOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPITasksIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
153
client/task/get_api_tasks_parameters.go
Normal file
153
client/task/get_api_tasks_parameters.go
Normal file
@ -0,0 +1,153 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPITasksParams creates a new GetAPITasksParams 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 NewGetAPITasksParams() *GetAPITasksParams {
|
||||
return &GetAPITasksParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksParamsWithTimeout creates a new GetAPITasksParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPITasksParamsWithTimeout(timeout time.Duration) *GetAPITasksParams {
|
||||
return &GetAPITasksParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksParamsWithContext creates a new GetAPITasksParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPITasksParamsWithContext(ctx context.Context) *GetAPITasksParams {
|
||||
return &GetAPITasksParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksParamsWithHTTPClient creates a new GetAPITasksParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPITasksParamsWithHTTPClient(client *http.Client) *GetAPITasksParams {
|
||||
return &GetAPITasksParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasksParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API tasks operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPITasksParams struct {
|
||||
|
||||
/* Query.
|
||||
|
||||
Attention: This is a GET request and you can pass in every field of the form as query parameter.
|
||||
*/
|
||||
Query *models.TaskQuery
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITasksParams) WithDefaults() *GetAPITasksParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITasksParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API tasks params
|
||||
func (o *GetAPITasksParams) WithTimeout(timeout time.Duration) *GetAPITasksParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API tasks params
|
||||
func (o *GetAPITasksParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API tasks params
|
||||
func (o *GetAPITasksParams) WithContext(ctx context.Context) *GetAPITasksParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API tasks params
|
||||
func (o *GetAPITasksParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API tasks params
|
||||
func (o *GetAPITasksParams) WithHTTPClient(client *http.Client) *GetAPITasksParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API tasks params
|
||||
func (o *GetAPITasksParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithQuery adds the query to the get API tasks params
|
||||
func (o *GetAPITasksParams) WithQuery(query *models.TaskQuery) *GetAPITasksParams {
|
||||
o.SetQuery(query)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetQuery adds the query to the get API tasks params
|
||||
func (o *GetAPITasksParams) SetQuery(query *models.TaskQuery) {
|
||||
o.Query = query
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPITasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Query != nil {
|
||||
if err := r.SetBodyParam(o.Query); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/task/get_api_tasks_responses.go
Normal file
96
client/task/get_api_tasks_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPITasksReader is a Reader for the GetAPITasks structure.
|
||||
type GetAPITasksReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPITasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPITasksOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITasksOK creates a GetAPITasksOK with default headers values
|
||||
func NewGetAPITasksOK() *GetAPITasksOK {
|
||||
return &GetAPITasksOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasksOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of task entities
|
||||
*/
|
||||
type GetAPITasksOK struct {
|
||||
Payload []*models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api tasks o k response has a 2xx status code
|
||||
func (o *GetAPITasksOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api tasks o k response has a 3xx status code
|
||||
func (o *GetAPITasksOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api tasks o k response has a 4xx status code
|
||||
func (o *GetAPITasksOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api tasks o k response has a 5xx status code
|
||||
func (o *GetAPITasksOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api tasks o k response a status code equal to that given
|
||||
func (o *GetAPITasksOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPITasksOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/tasks][%d] getApiTasksOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITasksOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/tasks][%d] getApiTasksOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITasksOK) GetPayload() []*models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPITasksOK) 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
|
||||
}
|
152
client/task/patch_api_tasks_id_assign_parameters.go
Normal file
152
client/task/patch_api_tasks_id_assign_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDAssignParams creates a new PatchAPITasksIDAssignParams 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 NewPatchAPITasksIDAssignParams() *PatchAPITasksIDAssignParams {
|
||||
return &PatchAPITasksIDAssignParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDAssignParamsWithTimeout creates a new PatchAPITasksIDAssignParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDAssignParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDAssignParams {
|
||||
return &PatchAPITasksIDAssignParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDAssignParamsWithContext creates a new PatchAPITasksIDAssignParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDAssignParamsWithContext(ctx context.Context) *PatchAPITasksIDAssignParams {
|
||||
return &PatchAPITasksIDAssignParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDAssignParamsWithHTTPClient creates a new PatchAPITasksIDAssignParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDAssignParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDAssignParams {
|
||||
return &PatchAPITasksIDAssignParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDAssignParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID assign operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDAssignParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID assign params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDAssignParams) WithDefaults() *PatchAPITasksIDAssignParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID assign params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDAssignParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDAssignParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) WithContext(ctx context.Context) *PatchAPITasksIDAssignParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDAssignParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) WithID(id int64) *PatchAPITasksIDAssignParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID assign params
|
||||
func (o *PatchAPITasksIDAssignParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDAssignParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_assign_responses.go
Normal file
98
client/task/patch_api_tasks_id_assign_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDAssignReader is a Reader for the PatchAPITasksIDAssign structure.
|
||||
type PatchAPITasksIDAssignReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDAssignReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDAssignOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDAssignOK creates a PatchAPITasksIDAssignOK with default headers values
|
||||
func NewPatchAPITasksIDAssignOK() *PatchAPITasksIDAssignOK {
|
||||
return &PatchAPITasksIDAssignOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDAssignOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated task
|
||||
*/
|
||||
type PatchAPITasksIDAssignOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id assign o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDAssignOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id assign o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDAssignOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id assign o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDAssignOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id assign o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDAssignOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id assign o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDAssignOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDAssignOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/assign][%d] patchApiTasksIdAssignOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDAssignOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/assign][%d] patchApiTasksIdAssignOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDAssignOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDAssignOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
152
client/task/patch_api_tasks_id_close_parameters.go
Normal file
152
client/task/patch_api_tasks_id_close_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDCloseParams creates a new PatchAPITasksIDCloseParams 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 NewPatchAPITasksIDCloseParams() *PatchAPITasksIDCloseParams {
|
||||
return &PatchAPITasksIDCloseParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDCloseParamsWithTimeout creates a new PatchAPITasksIDCloseParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDCloseParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDCloseParams {
|
||||
return &PatchAPITasksIDCloseParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDCloseParamsWithContext creates a new PatchAPITasksIDCloseParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDCloseParamsWithContext(ctx context.Context) *PatchAPITasksIDCloseParams {
|
||||
return &PatchAPITasksIDCloseParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDCloseParamsWithHTTPClient creates a new PatchAPITasksIDCloseParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDCloseParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDCloseParams {
|
||||
return &PatchAPITasksIDCloseParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDCloseParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID close operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDCloseParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to close
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID close params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDCloseParams) WithDefaults() *PatchAPITasksIDCloseParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID close params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDCloseParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDCloseParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) WithContext(ctx context.Context) *PatchAPITasksIDCloseParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDCloseParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) WithID(id int64) *PatchAPITasksIDCloseParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID close params
|
||||
func (o *PatchAPITasksIDCloseParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDCloseParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_close_responses.go
Normal file
98
client/task/patch_api_tasks_id_close_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDCloseReader is a Reader for the PatchAPITasksIDClose structure.
|
||||
type PatchAPITasksIDCloseReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDCloseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDCloseOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDCloseOK creates a PatchAPITasksIDCloseOK with default headers values
|
||||
func NewPatchAPITasksIDCloseOK() *PatchAPITasksIDCloseOK {
|
||||
return &PatchAPITasksIDCloseOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDCloseOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the closed task
|
||||
*/
|
||||
type PatchAPITasksIDCloseOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id close o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDCloseOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id close o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDCloseOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id close o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDCloseOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id close o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDCloseOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id close o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDCloseOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDCloseOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/close][%d] patchApiTasksIdCloseOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDCloseOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/close][%d] patchApiTasksIdCloseOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDCloseOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDCloseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
173
client/task/patch_api_tasks_id_log_parameters.go
Normal file
173
client/task/patch_api_tasks_id_log_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDLogParams creates a new PatchAPITasksIDLogParams 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 NewPatchAPITasksIDLogParams() *PatchAPITasksIDLogParams {
|
||||
return &PatchAPITasksIDLogParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDLogParamsWithTimeout creates a new PatchAPITasksIDLogParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDLogParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDLogParams {
|
||||
return &PatchAPITasksIDLogParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDLogParamsWithContext creates a new PatchAPITasksIDLogParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDLogParamsWithContext(ctx context.Context) *PatchAPITasksIDLogParams {
|
||||
return &PatchAPITasksIDLogParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDLogParamsWithHTTPClient creates a new PatchAPITasksIDLogParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDLogParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDLogParams {
|
||||
return &PatchAPITasksIDLogParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDLogParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID log operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDLogParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.TaskLogWorkForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to log times for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID log params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDLogParams) WithDefaults() *PatchAPITasksIDLogParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID log params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDLogParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDLogParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) WithContext(ctx context.Context) *PatchAPITasksIDLogParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDLogParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) WithBody(body *models.TaskLogWorkForm) *PatchAPITasksIDLogParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) SetBody(body *models.TaskLogWorkForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) WithID(id int64) *PatchAPITasksIDLogParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID log params
|
||||
func (o *PatchAPITasksIDLogParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDLogParams) 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/task/patch_api_tasks_id_log_responses.go
Normal file
98
client/task/patch_api_tasks_id_log_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDLogReader is a Reader for the PatchAPITasksIDLog structure.
|
||||
type PatchAPITasksIDLogReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDLogOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDLogOK creates a PatchAPITasksIDLogOK with default headers values
|
||||
func NewPatchAPITasksIDLogOK() *PatchAPITasksIDLogOK {
|
||||
return &PatchAPITasksIDLogOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDLogOK describes a response with status code 200, with default header values.
|
||||
|
||||
Logs already performed work on a task
|
||||
*/
|
||||
type PatchAPITasksIDLogOK struct {
|
||||
Payload *models.TimesheetEntityExpanded
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id log o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDLogOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id log o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDLogOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id log o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDLogOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id log o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDLogOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id log o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDLogOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDLogOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/log][%d] patchApiTasksIdLogOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDLogOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/log][%d] patchApiTasksIdLogOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDLogOK) GetPayload() *models.TimesheetEntityExpanded {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.TimesheetEntityExpanded)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
173
client/task/patch_api_tasks_id_parameters.go
Normal file
173
client/task/patch_api_tasks_id_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDParams creates a new PatchAPITasksIDParams 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 NewPatchAPITasksIDParams() *PatchAPITasksIDParams {
|
||||
return &PatchAPITasksIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDParamsWithTimeout creates a new PatchAPITasksIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDParams {
|
||||
return &PatchAPITasksIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDParamsWithContext creates a new PatchAPITasksIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDParamsWithContext(ctx context.Context) *PatchAPITasksIDParams {
|
||||
return &PatchAPITasksIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDParamsWithHTTPClient creates a new PatchAPITasksIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDParams {
|
||||
return &PatchAPITasksIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.TaskEditForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDParams) WithDefaults() *PatchAPITasksIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) WithContext(ctx context.Context) *PatchAPITasksIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) WithBody(body *models.TaskEditForm) *PatchAPITasksIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) SetBody(body *models.TaskEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) WithID(id int64) *PatchAPITasksIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID params
|
||||
func (o *PatchAPITasksIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDParams) 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
|
||||
}
|
152
client/task/patch_api_tasks_id_reopen_parameters.go
Normal file
152
client/task/patch_api_tasks_id_reopen_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDReopenParams creates a new PatchAPITasksIDReopenParams 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 NewPatchAPITasksIDReopenParams() *PatchAPITasksIDReopenParams {
|
||||
return &PatchAPITasksIDReopenParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDReopenParamsWithTimeout creates a new PatchAPITasksIDReopenParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDReopenParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDReopenParams {
|
||||
return &PatchAPITasksIDReopenParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDReopenParamsWithContext creates a new PatchAPITasksIDReopenParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDReopenParamsWithContext(ctx context.Context) *PatchAPITasksIDReopenParams {
|
||||
return &PatchAPITasksIDReopenParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDReopenParamsWithHTTPClient creates a new PatchAPITasksIDReopenParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDReopenParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDReopenParams {
|
||||
return &PatchAPITasksIDReopenParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDReopenParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID reopen operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDReopenParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to reopen
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID reopen params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDReopenParams) WithDefaults() *PatchAPITasksIDReopenParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID reopen params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDReopenParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDReopenParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) WithContext(ctx context.Context) *PatchAPITasksIDReopenParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDReopenParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) WithID(id int64) *PatchAPITasksIDReopenParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID reopen params
|
||||
func (o *PatchAPITasksIDReopenParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDReopenParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_reopen_responses.go
Normal file
98
client/task/patch_api_tasks_id_reopen_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDReopenReader is a Reader for the PatchAPITasksIDReopen structure.
|
||||
type PatchAPITasksIDReopenReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDReopenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDReopenOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDReopenOK creates a PatchAPITasksIDReopenOK with default headers values
|
||||
func NewPatchAPITasksIDReopenOK() *PatchAPITasksIDReopenOK {
|
||||
return &PatchAPITasksIDReopenOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDReopenOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the reopened task
|
||||
*/
|
||||
type PatchAPITasksIDReopenOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id reopen o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDReopenOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id reopen o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDReopenOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id reopen o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDReopenOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id reopen o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDReopenOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id reopen o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDReopenOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDReopenOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/reopen][%d] patchApiTasksIdReopenOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDReopenOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/reopen][%d] patchApiTasksIdReopenOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDReopenOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDReopenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
98
client/task/patch_api_tasks_id_responses.go
Normal file
98
client/task/patch_api_tasks_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDReader is a Reader for the PatchAPITasksID structure.
|
||||
type PatchAPITasksIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDOK creates a PatchAPITasksIDOK with default headers values
|
||||
func NewPatchAPITasksIDOK() *PatchAPITasksIDOK {
|
||||
return &PatchAPITasksIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated task
|
||||
*/
|
||||
type PatchAPITasksIDOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}][%d] patchApiTasksIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}][%d] patchApiTasksIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
152
client/task/patch_api_tasks_id_start_parameters.go
Normal file
152
client/task/patch_api_tasks_id_start_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDStartParams creates a new PatchAPITasksIDStartParams 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 NewPatchAPITasksIDStartParams() *PatchAPITasksIDStartParams {
|
||||
return &PatchAPITasksIDStartParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStartParamsWithTimeout creates a new PatchAPITasksIDStartParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDStartParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDStartParams {
|
||||
return &PatchAPITasksIDStartParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStartParamsWithContext creates a new PatchAPITasksIDStartParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDStartParamsWithContext(ctx context.Context) *PatchAPITasksIDStartParams {
|
||||
return &PatchAPITasksIDStartParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStartParamsWithHTTPClient creates a new PatchAPITasksIDStartParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDStartParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDStartParams {
|
||||
return &PatchAPITasksIDStartParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStartParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID start operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDStartParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to start
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID start params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDStartParams) WithDefaults() *PatchAPITasksIDStartParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID start params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDStartParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDStartParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) WithContext(ctx context.Context) *PatchAPITasksIDStartParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDStartParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) WithID(id int64) *PatchAPITasksIDStartParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID start params
|
||||
func (o *PatchAPITasksIDStartParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDStartParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_start_responses.go
Normal file
98
client/task/patch_api_tasks_id_start_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDStartReader is a Reader for the PatchAPITasksIDStart structure.
|
||||
type PatchAPITasksIDStartReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDStartReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDStartOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStartOK creates a PatchAPITasksIDStartOK with default headers values
|
||||
func NewPatchAPITasksIDStartOK() *PatchAPITasksIDStartOK {
|
||||
return &PatchAPITasksIDStartOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStartOK describes a response with status code 200, with default header values.
|
||||
|
||||
Start working on a task
|
||||
*/
|
||||
type PatchAPITasksIDStartOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id start o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDStartOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id start o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDStartOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id start o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDStartOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id start o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDStartOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id start o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDStartOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStartOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/start][%d] patchApiTasksIdStartOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStartOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/start][%d] patchApiTasksIdStartOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStartOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStartOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
152
client/task/patch_api_tasks_id_stop_parameters.go
Normal file
152
client/task/patch_api_tasks_id_stop_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDStopParams creates a new PatchAPITasksIDStopParams 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 NewPatchAPITasksIDStopParams() *PatchAPITasksIDStopParams {
|
||||
return &PatchAPITasksIDStopParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStopParamsWithTimeout creates a new PatchAPITasksIDStopParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDStopParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDStopParams {
|
||||
return &PatchAPITasksIDStopParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStopParamsWithContext creates a new PatchAPITasksIDStopParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDStopParamsWithContext(ctx context.Context) *PatchAPITasksIDStopParams {
|
||||
return &PatchAPITasksIDStopParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStopParamsWithHTTPClient creates a new PatchAPITasksIDStopParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDStopParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDStopParams {
|
||||
return &PatchAPITasksIDStopParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStopParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID stop operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDStopParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to stop
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID stop params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDStopParams) WithDefaults() *PatchAPITasksIDStopParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID stop params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDStopParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDStopParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) WithContext(ctx context.Context) *PatchAPITasksIDStopParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDStopParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) WithID(id int64) *PatchAPITasksIDStopParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID stop params
|
||||
func (o *PatchAPITasksIDStopParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDStopParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_stop_responses.go
Normal file
98
client/task/patch_api_tasks_id_stop_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDStopReader is a Reader for the PatchAPITasksIDStop structure.
|
||||
type PatchAPITasksIDStopReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDStopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDStopOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDStopOK creates a PatchAPITasksIDStopOK with default headers values
|
||||
func NewPatchAPITasksIDStopOK() *PatchAPITasksIDStopOK {
|
||||
return &PatchAPITasksIDStopOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStopOK describes a response with status code 200, with default header values.
|
||||
|
||||
Stop working on a task
|
||||
*/
|
||||
type PatchAPITasksIDStopOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id stop o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDStopOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id stop o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDStopOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id stop o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDStopOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id stop o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDStopOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id stop o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDStopOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStopOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/stop][%d] patchApiTasksIdStopOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStopOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/stop][%d] patchApiTasksIdStopOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStopOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDStopOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
152
client/task/patch_api_tasks_id_unassign_parameters.go
Normal file
152
client/task/patch_api_tasks_id_unassign_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITasksIDUnassignParams creates a new PatchAPITasksIDUnassignParams 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 NewPatchAPITasksIDUnassignParams() *PatchAPITasksIDUnassignParams {
|
||||
return &PatchAPITasksIDUnassignParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDUnassignParamsWithTimeout creates a new PatchAPITasksIDUnassignParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITasksIDUnassignParamsWithTimeout(timeout time.Duration) *PatchAPITasksIDUnassignParams {
|
||||
return &PatchAPITasksIDUnassignParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDUnassignParamsWithContext creates a new PatchAPITasksIDUnassignParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITasksIDUnassignParamsWithContext(ctx context.Context) *PatchAPITasksIDUnassignParams {
|
||||
return &PatchAPITasksIDUnassignParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDUnassignParamsWithHTTPClient creates a new PatchAPITasksIDUnassignParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITasksIDUnassignParamsWithHTTPClient(client *http.Client) *PatchAPITasksIDUnassignParams {
|
||||
return &PatchAPITasksIDUnassignParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDUnassignParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API tasks ID unassign operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITasksIDUnassignParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Task ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API tasks ID unassign params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDUnassignParams) WithDefaults() *PatchAPITasksIDUnassignParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API tasks ID unassign params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITasksIDUnassignParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) WithTimeout(timeout time.Duration) *PatchAPITasksIDUnassignParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) WithContext(ctx context.Context) *PatchAPITasksIDUnassignParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) WithHTTPClient(client *http.Client) *PatchAPITasksIDUnassignParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) WithID(id int64) *PatchAPITasksIDUnassignParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API tasks ID unassign params
|
||||
func (o *PatchAPITasksIDUnassignParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITasksIDUnassignParams) 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
|
||||
}
|
98
client/task/patch_api_tasks_id_unassign_responses.go
Normal file
98
client/task/patch_api_tasks_id_unassign_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITasksIDUnassignReader is a Reader for the PatchAPITasksIDUnassign structure.
|
||||
type PatchAPITasksIDUnassignReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITasksIDUnassignReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITasksIDUnassignOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITasksIDUnassignOK creates a PatchAPITasksIDUnassignOK with default headers values
|
||||
func NewPatchAPITasksIDUnassignOK() *PatchAPITasksIDUnassignOK {
|
||||
return &PatchAPITasksIDUnassignOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDUnassignOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated task
|
||||
*/
|
||||
type PatchAPITasksIDUnassignOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api tasks Id unassign o k response has a 2xx status code
|
||||
func (o *PatchAPITasksIDUnassignOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api tasks Id unassign o k response has a 3xx status code
|
||||
func (o *PatchAPITasksIDUnassignOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api tasks Id unassign o k response has a 4xx status code
|
||||
func (o *PatchAPITasksIDUnassignOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api tasks Id unassign o k response has a 5xx status code
|
||||
func (o *PatchAPITasksIDUnassignOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api tasks Id unassign o k response a status code equal to that given
|
||||
func (o *PatchAPITasksIDUnassignOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDUnassignOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/unassign][%d] patchApiTasksIdUnassignOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDUnassignOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/tasks/{id}/unassign][%d] patchApiTasksIdUnassignOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDUnassignOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITasksIDUnassignOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
150
client/task/post_api_tasks_parameters.go
Normal file
150
client/task/post_api_tasks_parameters.go
Normal file
@ -0,0 +1,150 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITasksParams creates a new PostAPITasksParams 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 NewPostAPITasksParams() *PostAPITasksParams {
|
||||
return &PostAPITasksParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITasksParamsWithTimeout creates a new PostAPITasksParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITasksParamsWithTimeout(timeout time.Duration) *PostAPITasksParams {
|
||||
return &PostAPITasksParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITasksParamsWithContext creates a new PostAPITasksParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITasksParamsWithContext(ctx context.Context) *PostAPITasksParams {
|
||||
return &PostAPITasksParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITasksParamsWithHTTPClient creates a new PostAPITasksParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITasksParamsWithHTTPClient(client *http.Client) *PostAPITasksParams {
|
||||
return &PostAPITasksParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITasksParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API tasks operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITasksParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.TaskEditForm
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITasksParams) WithDefaults() *PostAPITasksParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITasksParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API tasks params
|
||||
func (o *PostAPITasksParams) WithTimeout(timeout time.Duration) *PostAPITasksParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API tasks params
|
||||
func (o *PostAPITasksParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API tasks params
|
||||
func (o *PostAPITasksParams) WithContext(ctx context.Context) *PostAPITasksParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API tasks params
|
||||
func (o *PostAPITasksParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API tasks params
|
||||
func (o *PostAPITasksParams) WithHTTPClient(client *http.Client) *PostAPITasksParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API tasks params
|
||||
func (o *PostAPITasksParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API tasks params
|
||||
func (o *PostAPITasksParams) WithBody(body *models.TaskEditForm) *PostAPITasksParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API tasks params
|
||||
func (o *PostAPITasksParams) SetBody(body *models.TaskEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITasksParams) 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/task/post_api_tasks_responses.go
Normal file
98
client/task/post_api_tasks_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITasksReader is a Reader for the PostAPITasks structure.
|
||||
type PostAPITasksReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITasksOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITasksOK creates a PostAPITasksOK with default headers values
|
||||
func NewPostAPITasksOK() *PostAPITasksOK {
|
||||
return &PostAPITasksOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITasksOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created task
|
||||
*/
|
||||
type PostAPITasksOK struct {
|
||||
Payload *models.Task
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api tasks o k response has a 2xx status code
|
||||
func (o *PostAPITasksOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api tasks o k response has a 3xx status code
|
||||
func (o *PostAPITasksOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api tasks o k response has a 4xx status code
|
||||
func (o *PostAPITasksOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api tasks o k response has a 5xx status code
|
||||
func (o *PostAPITasksOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api tasks o k response a status code equal to that given
|
||||
func (o *PostAPITasksOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITasksOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/tasks][%d] postApiTasksOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITasksOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/tasks][%d] postApiTasksOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITasksOK) GetPayload() *models.Task {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Task)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
547
client/task/task_client.go
Normal file
547
client/task/task_client.go
Normal file
@ -0,0 +1,547 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package task
|
||||
|
||||
// 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 task API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for task 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 {
|
||||
DeleteAPITasksID(params *DeleteAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITasksIDNoContent, error)
|
||||
|
||||
GetAPITasks(params *GetAPITasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITasksOK, error)
|
||||
|
||||
GetAPITasksID(params *GetAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITasksIDOK, error)
|
||||
|
||||
PatchAPITasksID(params *PatchAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDOK, error)
|
||||
|
||||
PatchAPITasksIDAssign(params *PatchAPITasksIDAssignParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDAssignOK, error)
|
||||
|
||||
PatchAPITasksIDClose(params *PatchAPITasksIDCloseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDCloseOK, error)
|
||||
|
||||
PatchAPITasksIDLog(params *PatchAPITasksIDLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDLogOK, error)
|
||||
|
||||
PatchAPITasksIDReopen(params *PatchAPITasksIDReopenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDReopenOK, error)
|
||||
|
||||
PatchAPITasksIDStart(params *PatchAPITasksIDStartParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDStartOK, error)
|
||||
|
||||
PatchAPITasksIDStop(params *PatchAPITasksIDStopParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDStopOK, error)
|
||||
|
||||
PatchAPITasksIDUnassign(params *PatchAPITasksIDUnassignParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDUnassignOK, error)
|
||||
|
||||
PostAPITasks(params *PostAPITasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITasksOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITasksID deletes an existing task record
|
||||
*/
|
||||
func (a *Client) DeleteAPITasksID(params *DeleteAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITasksIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITasksIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITasksID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/tasks/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITasksIDReader{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.(*DeleteAPITasksIDNoContent)
|
||||
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 DeleteAPITasksID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasks returns a collection of tasks
|
||||
|
||||
Attention: This is a GET request and you can pass in every field of the form as query parameter.
|
||||
|
||||
Array values need to be written like this: /api/tasks?projects[]=1&projects[]=2
|
||||
*/
|
||||
func (a *Client) GetAPITasks(params *GetAPITasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITasksOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPITasksParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPITasks",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/tasks",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPITasksReader{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.(*GetAPITasksOK)
|
||||
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 GetAPITasks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITasksID returns one task
|
||||
*/
|
||||
func (a *Client) GetAPITasksID(params *GetAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITasksIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPITasksIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPITasksID",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/tasks/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPITasksIDReader{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.(*GetAPITasksIDOK)
|
||||
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 GetAPITasksID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksID updates an existing task
|
||||
|
||||
Update an existing task, you can pass all or just a subset of all attributes
|
||||
*/
|
||||
func (a *Client) PatchAPITasksID(params *PatchAPITasksIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDReader{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.(*PatchAPITasksIDOK)
|
||||
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 PatchAPITasksID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDAssign assigns a task to the current user
|
||||
|
||||
Assign a currently unassigned task to the current user
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDAssign(params *PatchAPITasksIDAssignParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDAssignOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDAssignParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDAssign",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/assign",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDAssignReader{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.(*PatchAPITasksIDAssignOK)
|
||||
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 PatchAPITasksIDAssign: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDClose closes a task for the current user
|
||||
|
||||
Closes an assigned task for the current user
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDClose(params *PatchAPITasksIDCloseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDCloseOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDCloseParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDClose",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/close",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDCloseReader{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.(*PatchAPITasksIDCloseOK)
|
||||
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 PatchAPITasksIDClose: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDLog logs work for a task record
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDLog(params *PatchAPITasksIDLogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDLogOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDLogParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDLog",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/log",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDLogReader{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.(*PatchAPITasksIDLogOK)
|
||||
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 PatchAPITasksIDLog: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDReopen reopens a task for the current user
|
||||
|
||||
Reopens an assigned task for the current user
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDReopen(params *PatchAPITasksIDReopenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDReopenOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDReopenParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDReopen",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/reopen",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDReopenReader{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.(*PatchAPITasksIDReopenOK)
|
||||
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 PatchAPITasksIDReopen: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStart starts a task record
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDStart(params *PatchAPITasksIDStartParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDStartOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDStartParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDStart",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/start",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDStartReader{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.(*PatchAPITasksIDStartOK)
|
||||
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 PatchAPITasksIDStart: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDStop stops a task record for the current user
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDStop(params *PatchAPITasksIDStopParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDStopOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDStopParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDStop",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/stop",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDStopReader{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.(*PatchAPITasksIDStopOK)
|
||||
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 PatchAPITasksIDStop: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITasksIDUnassign unassigns a task from the current user
|
||||
|
||||
Unassign a currently assigned task from the current user
|
||||
*/
|
||||
func (a *Client) PatchAPITasksIDUnassign(params *PatchAPITasksIDUnassignParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITasksIDUnassignOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITasksIDUnassignParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITasksIDUnassign",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/tasks/{id}/unassign",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITasksIDUnassignReader{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.(*PatchAPITasksIDUnassignOK)
|
||||
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 PatchAPITasksIDUnassign: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITasks creates a new task
|
||||
|
||||
Creates a new task and returns it afterwards
|
||||
*/
|
||||
func (a *Client) PostAPITasks(params *PostAPITasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITasksOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITasksParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITasks",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/tasks",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITasksReader{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.(*PostAPITasksOK)
|
||||
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 PostAPITasks: 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
|
||||
}
|
Reference in New Issue
Block a user