feat: init
This commit is contained in:
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPIProjectsIDRatesRateIDParams creates a new DeleteAPIProjectsIDRatesRateIDParams 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 NewDeleteAPIProjectsIDRatesRateIDParams() *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
return &DeleteAPIProjectsIDRatesRateIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIProjectsIDRatesRateIDParamsWithTimeout creates a new DeleteAPIProjectsIDRatesRateIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPIProjectsIDRatesRateIDParamsWithTimeout(timeout time.Duration) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
return &DeleteAPIProjectsIDRatesRateIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIProjectsIDRatesRateIDParamsWithContext creates a new DeleteAPIProjectsIDRatesRateIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPIProjectsIDRatesRateIDParamsWithContext(ctx context.Context) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
return &DeleteAPIProjectsIDRatesRateIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIProjectsIDRatesRateIDParamsWithHTTPClient creates a new DeleteAPIProjectsIDRatesRateIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPIProjectsIDRatesRateIDParamsWithHTTPClient(client *http.Client) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
return &DeleteAPIProjectsIDRatesRateIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIProjectsIDRatesRateIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API projects ID rates rate ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPIProjectsIDRatesRateIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The project whose rate will be removed
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* RateID.
|
||||
|
||||
The rate to remove
|
||||
*/
|
||||
RateID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API projects ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithDefaults() *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API projects ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithTimeout(timeout time.Duration) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithContext(ctx context.Context) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithHTTPClient(client *http.Client) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithID(id int64) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithRateID adds the rateID to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WithRateID(rateID int64) *DeleteAPIProjectsIDRatesRateIDParams {
|
||||
o.SetRateID(rateID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRateID adds the rateId to the delete API projects ID rates rate ID params
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) SetRateID(rateID int64) {
|
||||
o.RateID = rateID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param rateId
|
||||
if err := r.SetPathParam("rateId", swag.FormatInt64(o.RateID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPIProjectsIDRatesRateIDReader is a Reader for the DeleteAPIProjectsIDRatesRateID structure.
|
||||
type DeleteAPIProjectsIDRatesRateIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPIProjectsIDRatesRateIDNoContent()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPIProjectsIDRatesRateIDNoContent creates a DeleteAPIProjectsIDRatesRateIDNoContent with default headers values
|
||||
func NewDeleteAPIProjectsIDRatesRateIDNoContent() *DeleteAPIProjectsIDRatesRateIDNoContent {
|
||||
return &DeleteAPIProjectsIDRatesRateIDNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIProjectsIDRatesRateIDNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
Returns no content: 204 on successful delete
|
||||
*/
|
||||
type DeleteAPIProjectsIDRatesRateIDNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api projects Id rates rate Id no content response has a 2xx status code
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api projects Id rates rate Id no content response has a 3xx status code
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api projects Id rates rate Id no content response has a 4xx status code
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api projects Id rates rate Id no content response has a 5xx status code
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api projects Id rates rate Id no content response a status code equal to that given
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/projects/{id}/rates/{rateId}][%d] deleteApiProjectsIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/projects/{id}/rates/{rateId}][%d] deleteApiProjectsIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPIProjectsIDRatesRateIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
148
client/project/get_api_projects_id_parameters.go
Normal file
148
client/project/get_api_projects_id_parameters.go
Normal file
@ -0,0 +1,148 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIProjectsIDParams creates a new GetAPIProjectsIDParams 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 NewGetAPIProjectsIDParams() *GetAPIProjectsIDParams {
|
||||
return &GetAPIProjectsIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDParamsWithTimeout creates a new GetAPIProjectsIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIProjectsIDParamsWithTimeout(timeout time.Duration) *GetAPIProjectsIDParams {
|
||||
return &GetAPIProjectsIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDParamsWithContext creates a new GetAPIProjectsIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIProjectsIDParamsWithContext(ctx context.Context) *GetAPIProjectsIDParams {
|
||||
return &GetAPIProjectsIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDParamsWithHTTPClient creates a new GetAPIProjectsIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIProjectsIDParamsWithHTTPClient(client *http.Client) *GetAPIProjectsIDParams {
|
||||
return &GetAPIProjectsIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API projects ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIProjectsIDParams struct {
|
||||
|
||||
// ID.
|
||||
ID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API projects ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsIDParams) WithDefaults() *GetAPIProjectsIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API projects ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) WithTimeout(timeout time.Duration) *GetAPIProjectsIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) WithContext(ctx context.Context) *GetAPIProjectsIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) WithHTTPClient(client *http.Client) *GetAPIProjectsIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) WithID(id string) *GetAPIProjectsIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API projects ID params
|
||||
func (o *GetAPIProjectsIDParams) SetID(id string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIProjectsIDParams) 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", o.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
152
client/project/get_api_projects_id_rates_parameters.go
Normal file
152
client/project/get_api_projects_id_rates_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIProjectsIDRatesParams creates a new GetAPIProjectsIDRatesParams 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 NewGetAPIProjectsIDRatesParams() *GetAPIProjectsIDRatesParams {
|
||||
return &GetAPIProjectsIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDRatesParamsWithTimeout creates a new GetAPIProjectsIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIProjectsIDRatesParamsWithTimeout(timeout time.Duration) *GetAPIProjectsIDRatesParams {
|
||||
return &GetAPIProjectsIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDRatesParamsWithContext creates a new GetAPIProjectsIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIProjectsIDRatesParamsWithContext(ctx context.Context) *GetAPIProjectsIDRatesParams {
|
||||
return &GetAPIProjectsIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDRatesParamsWithHTTPClient creates a new GetAPIProjectsIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIProjectsIDRatesParamsWithHTTPClient(client *http.Client) *GetAPIProjectsIDRatesParams {
|
||||
return &GetAPIProjectsIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API projects ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIProjectsIDRatesParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The project whose rates will be returned
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API projects ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsIDRatesParams) WithDefaults() *GetAPIProjectsIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API projects ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) WithTimeout(timeout time.Duration) *GetAPIProjectsIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) WithContext(ctx context.Context) *GetAPIProjectsIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) WithHTTPClient(client *http.Client) *GetAPIProjectsIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) WithID(id int64) *GetAPIProjectsIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API projects ID rates params
|
||||
func (o *GetAPIProjectsIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIProjectsIDRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/project/get_api_projects_id_rates_responses.go
Normal file
96
client/project/get_api_projects_id_rates_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIProjectsIDRatesReader is a Reader for the GetAPIProjectsIDRates structure.
|
||||
type GetAPIProjectsIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIProjectsIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIProjectsIDRatesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDRatesOK creates a GetAPIProjectsIDRatesOK with default headers values
|
||||
func NewGetAPIProjectsIDRatesOK() *GetAPIProjectsIDRatesOK {
|
||||
return &GetAPIProjectsIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of project rate entities
|
||||
*/
|
||||
type GetAPIProjectsIDRatesOK struct {
|
||||
Payload []*models.ProjectRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api projects Id rates o k response has a 2xx status code
|
||||
func (o *GetAPIProjectsIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api projects Id rates o k response has a 3xx status code
|
||||
func (o *GetAPIProjectsIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api projects Id rates o k response has a 4xx status code
|
||||
func (o *GetAPIProjectsIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api projects Id rates o k response has a 5xx status code
|
||||
func (o *GetAPIProjectsIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api projects Id rates o k response a status code equal to that given
|
||||
func (o *GetAPIProjectsIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/projects/{id}/rates][%d] getApiProjectsIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/projects/{id}/rates][%d] getApiProjectsIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDRatesOK) GetPayload() []*models.ProjectRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
98
client/project/get_api_projects_id_responses.go
Normal file
98
client/project/get_api_projects_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIProjectsIDReader is a Reader for the GetAPIProjectsID structure.
|
||||
type GetAPIProjectsIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIProjectsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIProjectsIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsIDOK creates a GetAPIProjectsIDOK with default headers values
|
||||
func NewGetAPIProjectsIDOK() *GetAPIProjectsIDOK {
|
||||
return &GetAPIProjectsIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns one project entity
|
||||
*/
|
||||
type GetAPIProjectsIDOK struct {
|
||||
Payload *models.ProjectEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api projects Id o k response has a 2xx status code
|
||||
func (o *GetAPIProjectsIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api projects Id o k response has a 3xx status code
|
||||
func (o *GetAPIProjectsIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api projects Id o k response has a 4xx status code
|
||||
func (o *GetAPIProjectsIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api projects Id o k response has a 5xx status code
|
||||
func (o *GetAPIProjectsIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api projects Id o k response a status code equal to that given
|
||||
func (o *GetAPIProjectsIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/projects/{id}][%d] getApiProjectsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/projects/{id}][%d] getApiProjectsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDOK) GetPayload() *models.ProjectEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ProjectEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
392
client/project/get_api_projects_parameters.go
Normal file
392
client/project/get_api_projects_parameters.go
Normal file
@ -0,0 +1,392 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPIProjectsParams creates a new GetAPIProjectsParams 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 NewGetAPIProjectsParams() *GetAPIProjectsParams {
|
||||
return &GetAPIProjectsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsParamsWithTimeout creates a new GetAPIProjectsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPIProjectsParamsWithTimeout(timeout time.Duration) *GetAPIProjectsParams {
|
||||
return &GetAPIProjectsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsParamsWithContext creates a new GetAPIProjectsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPIProjectsParamsWithContext(ctx context.Context) *GetAPIProjectsParams {
|
||||
return &GetAPIProjectsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsParamsWithHTTPClient creates a new GetAPIProjectsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPIProjectsParamsWithHTTPClient(client *http.Client) *GetAPIProjectsParams {
|
||||
return &GetAPIProjectsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API projects operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPIProjectsParams struct {
|
||||
|
||||
/* Customer.
|
||||
|
||||
Customer ID to filter projects
|
||||
*/
|
||||
Customer string
|
||||
|
||||
/* Customers.
|
||||
|
||||
Comma separated list of customer IDs to filter projects
|
||||
*/
|
||||
Customers string
|
||||
|
||||
/* End.
|
||||
|
||||
Only projects that ended after this date will be included. Allowed format: HTML5 (default: now, if start is also empty)
|
||||
|
||||
Format: DateTime
|
||||
*/
|
||||
End string
|
||||
|
||||
/* GlobalActivities.
|
||||
|
||||
If given, filters projects by their 'global activity' support. Allowed values: 1 (supports global activities) and 0 (without global activities) (default: all)
|
||||
*/
|
||||
GlobalActivities string
|
||||
|
||||
/* IgnoreDates.
|
||||
|
||||
If set, start and end are completely ignored. Allowed values: 1 (default: off)
|
||||
*/
|
||||
IgnoreDates string
|
||||
|
||||
/* Order.
|
||||
|
||||
The result order. Allowed values: ASC, DESC (default: ASC)
|
||||
*/
|
||||
Order string
|
||||
|
||||
/* OrderBy.
|
||||
|
||||
The field by which results will be ordered. Allowed values: id, name, customer (default: name)
|
||||
*/
|
||||
OrderBy string
|
||||
|
||||
/* Start.
|
||||
|
||||
Only projects that started before this date will be included. Allowed format: HTML5 (default: now, if end is also empty)
|
||||
|
||||
Format: DateTime
|
||||
*/
|
||||
Start string
|
||||
|
||||
/* Term.
|
||||
|
||||
Free search term
|
||||
*/
|
||||
Term *string
|
||||
|
||||
/* Visible.
|
||||
|
||||
Visibility status to filter projects. Allowed values: 1=visible, 2=hidden, 3=both (default: 1)
|
||||
*/
|
||||
Visible string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API projects params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsParams) WithDefaults() *GetAPIProjectsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API projects params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPIProjectsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithTimeout(timeout time.Duration) *GetAPIProjectsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithContext(ctx context.Context) *GetAPIProjectsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithHTTPClient(client *http.Client) *GetAPIProjectsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCustomer adds the customer to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithCustomer(customer string) *GetAPIProjectsParams {
|
||||
o.SetCustomer(customer)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCustomer adds the customer to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetCustomer(customer string) {
|
||||
o.Customer = customer
|
||||
}
|
||||
|
||||
// WithCustomers adds the customers to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithCustomers(customers string) *GetAPIProjectsParams {
|
||||
o.SetCustomers(customers)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCustomers adds the customers to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetCustomers(customers string) {
|
||||
o.Customers = customers
|
||||
}
|
||||
|
||||
// WithEnd adds the end to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithEnd(end string) *GetAPIProjectsParams {
|
||||
o.SetEnd(end)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEnd adds the end to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetEnd(end string) {
|
||||
o.End = end
|
||||
}
|
||||
|
||||
// WithGlobalActivities adds the globalActivities to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithGlobalActivities(globalActivities string) *GetAPIProjectsParams {
|
||||
o.SetGlobalActivities(globalActivities)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetGlobalActivities adds the globalActivities to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetGlobalActivities(globalActivities string) {
|
||||
o.GlobalActivities = globalActivities
|
||||
}
|
||||
|
||||
// WithIgnoreDates adds the ignoreDates to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithIgnoreDates(ignoreDates string) *GetAPIProjectsParams {
|
||||
o.SetIgnoreDates(ignoreDates)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetIgnoreDates adds the ignoreDates to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetIgnoreDates(ignoreDates string) {
|
||||
o.IgnoreDates = ignoreDates
|
||||
}
|
||||
|
||||
// WithOrder adds the order to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithOrder(order string) *GetAPIProjectsParams {
|
||||
o.SetOrder(order)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrder adds the order to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetOrder(order string) {
|
||||
o.Order = order
|
||||
}
|
||||
|
||||
// WithOrderBy adds the orderBy to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithOrderBy(orderBy string) *GetAPIProjectsParams {
|
||||
o.SetOrderBy(orderBy)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrderBy adds the orderBy to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetOrderBy(orderBy string) {
|
||||
o.OrderBy = orderBy
|
||||
}
|
||||
|
||||
// WithStart adds the start to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithStart(start string) *GetAPIProjectsParams {
|
||||
o.SetStart(start)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStart adds the start to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetStart(start string) {
|
||||
o.Start = start
|
||||
}
|
||||
|
||||
// WithTerm adds the term to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithTerm(term *string) *GetAPIProjectsParams {
|
||||
o.SetTerm(term)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTerm adds the term to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetTerm(term *string) {
|
||||
o.Term = term
|
||||
}
|
||||
|
||||
// WithVisible adds the visible to the get API projects params
|
||||
func (o *GetAPIProjectsParams) WithVisible(visible string) *GetAPIProjectsParams {
|
||||
o.SetVisible(visible)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetVisible adds the visible to the get API projects params
|
||||
func (o *GetAPIProjectsParams) SetVisible(visible string) {
|
||||
o.Visible = visible
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPIProjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// query param customer
|
||||
qrCustomer := o.Customer
|
||||
qCustomer := qrCustomer
|
||||
|
||||
if err := r.SetQueryParam("customer", qCustomer); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param customers
|
||||
qrCustomers := o.Customers
|
||||
qCustomers := qrCustomers
|
||||
|
||||
if err := r.SetQueryParam("customers", qCustomers); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param end
|
||||
qrEnd := o.End
|
||||
qEnd := qrEnd
|
||||
|
||||
if err := r.SetQueryParam("end", qEnd); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param globalActivities
|
||||
qrGlobalActivities := o.GlobalActivities
|
||||
qGlobalActivities := qrGlobalActivities
|
||||
|
||||
if err := r.SetQueryParam("globalActivities", qGlobalActivities); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param ignoreDates
|
||||
qrIgnoreDates := o.IgnoreDates
|
||||
qIgnoreDates := qrIgnoreDates
|
||||
|
||||
if err := r.SetQueryParam("ignoreDates", qIgnoreDates); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param order
|
||||
qrOrder := o.Order
|
||||
qOrder := qrOrder
|
||||
|
||||
if err := r.SetQueryParam("order", qOrder); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param orderBy
|
||||
qrOrderBy := o.OrderBy
|
||||
qOrderBy := qrOrderBy
|
||||
|
||||
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param start
|
||||
qrStart := o.Start
|
||||
qStart := qrStart
|
||||
|
||||
if err := r.SetQueryParam("start", qStart); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.Term != nil {
|
||||
|
||||
// query param term
|
||||
var qrTerm string
|
||||
|
||||
if o.Term != nil {
|
||||
qrTerm = *o.Term
|
||||
}
|
||||
qTerm := qrTerm
|
||||
if qTerm != "" {
|
||||
|
||||
if err := r.SetQueryParam("term", qTerm); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// query param visible
|
||||
qrVisible := o.Visible
|
||||
qVisible := qrVisible
|
||||
|
||||
if err := r.SetQueryParam("visible", qVisible); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/project/get_api_projects_responses.go
Normal file
96
client/project/get_api_projects_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPIProjectsReader is a Reader for the GetAPIProjects structure.
|
||||
type GetAPIProjectsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPIProjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPIProjectsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPIProjectsOK creates a GetAPIProjectsOK with default headers values
|
||||
func NewGetAPIProjectsOK() *GetAPIProjectsOK {
|
||||
return &GetAPIProjectsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of project entities
|
||||
*/
|
||||
type GetAPIProjectsOK struct {
|
||||
Payload []*models.ProjectCollection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api projects o k response has a 2xx status code
|
||||
func (o *GetAPIProjectsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api projects o k response has a 3xx status code
|
||||
func (o *GetAPIProjectsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api projects o k response has a 4xx status code
|
||||
func (o *GetAPIProjectsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api projects o k response has a 5xx status code
|
||||
func (o *GetAPIProjectsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api projects o k response a status code equal to that given
|
||||
func (o *GetAPIProjectsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/projects][%d] getApiProjectsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/projects][%d] getApiProjectsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsOK) GetPayload() []*models.ProjectCollection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPIProjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
169
client/project/patch_api_projects_id_meta_parameters.go
Normal file
169
client/project/patch_api_projects_id_meta_parameters.go
Normal file
@ -0,0 +1,169 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPIProjectsIDMetaParams creates a new PatchAPIProjectsIDMetaParams 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 NewPatchAPIProjectsIDMetaParams() *PatchAPIProjectsIDMetaParams {
|
||||
return &PatchAPIProjectsIDMetaParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDMetaParamsWithTimeout creates a new PatchAPIProjectsIDMetaParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPIProjectsIDMetaParamsWithTimeout(timeout time.Duration) *PatchAPIProjectsIDMetaParams {
|
||||
return &PatchAPIProjectsIDMetaParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDMetaParamsWithContext creates a new PatchAPIProjectsIDMetaParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPIProjectsIDMetaParamsWithContext(ctx context.Context) *PatchAPIProjectsIDMetaParams {
|
||||
return &PatchAPIProjectsIDMetaParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDMetaParamsWithHTTPClient creates a new PatchAPIProjectsIDMetaParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPIProjectsIDMetaParamsWithHTTPClient(client *http.Client) *PatchAPIProjectsIDMetaParams {
|
||||
return &PatchAPIProjectsIDMetaParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDMetaParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API projects ID meta operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPIProjectsIDMetaParams struct {
|
||||
|
||||
// Body.
|
||||
Body PatchAPIProjectsIDMetaBody
|
||||
|
||||
/* ID.
|
||||
|
||||
Project record ID to set the meta-field value for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API projects ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithDefaults() *PatchAPIProjectsIDMetaParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API projects ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithTimeout(timeout time.Duration) *PatchAPIProjectsIDMetaParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithContext(ctx context.Context) *PatchAPIProjectsIDMetaParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithHTTPClient(client *http.Client) *PatchAPIProjectsIDMetaParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithBody(body PatchAPIProjectsIDMetaBody) *PatchAPIProjectsIDMetaParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetBody(body PatchAPIProjectsIDMetaBody) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) WithID(id int64) *PatchAPIProjectsIDMetaParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API projects ID meta params
|
||||
func (o *PatchAPIProjectsIDMetaParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPIProjectsIDMetaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
176
client/project/patch_api_projects_id_meta_responses.go
Normal file
176
client/project/patch_api_projects_id_meta_responses.go
Normal file
@ -0,0 +1,176 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PatchAPIProjectsIDMetaReader is a Reader for the PatchAPIProjectsIDMeta structure.
|
||||
type PatchAPIProjectsIDMetaReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPIProjectsIDMetaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPIProjectsIDMetaOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDMetaOK creates a PatchAPIProjectsIDMetaOK with default headers values
|
||||
func NewPatchAPIProjectsIDMetaOK() *PatchAPIProjectsIDMetaOK {
|
||||
return &PatchAPIProjectsIDMetaOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDMetaOK describes a response with status code 200, with default header values.
|
||||
|
||||
Sets the value of an existing/configured meta-field. You cannot create unknown meta-fields, if the given name is not a configured meta-field, this will return an exception.
|
||||
*/
|
||||
type PatchAPIProjectsIDMetaOK struct {
|
||||
Payload *models.ProjectEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api projects Id meta o k response has a 2xx status code
|
||||
func (o *PatchAPIProjectsIDMetaOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api projects Id meta o k response has a 3xx status code
|
||||
func (o *PatchAPIProjectsIDMetaOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api projects Id meta o k response has a 4xx status code
|
||||
func (o *PatchAPIProjectsIDMetaOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api projects Id meta o k response has a 5xx status code
|
||||
func (o *PatchAPIProjectsIDMetaOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api projects Id meta o k response a status code equal to that given
|
||||
func (o *PatchAPIProjectsIDMetaOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/projects/{id}/meta][%d] patchApiProjectsIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/projects/{id}/meta][%d] patchApiProjectsIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaOK) GetPayload() *models.ProjectEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ProjectEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDMetaBody patch API projects ID meta body
|
||||
swagger:model PatchAPIProjectsIDMetaBody
|
||||
*/
|
||||
type PatchAPIProjectsIDMetaBody struct {
|
||||
|
||||
// The meta-field name
|
||||
// Required: true
|
||||
Name *string `json:"name"`
|
||||
|
||||
// The meta-field value
|
||||
// Required: true
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
// Validate validates this patch API projects ID meta body
|
||||
func (o *PatchAPIProjectsIDMetaBody) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := o.validateName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := o.validateValue(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaBody) validateName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"name", "body", o.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDMetaBody) validateValue(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"value", "body", o.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this patch API projects ID meta body based on context it is used
|
||||
func (o *PatchAPIProjectsIDMetaBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (o *PatchAPIProjectsIDMetaBody) MarshalBinary() ([]byte, error) {
|
||||
if o == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(o)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (o *PatchAPIProjectsIDMetaBody) UnmarshalBinary(b []byte) error {
|
||||
var res PatchAPIProjectsIDMetaBody
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = res
|
||||
return nil
|
||||
}
|
173
client/project/patch_api_projects_id_parameters.go
Normal file
173
client/project/patch_api_projects_id_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPIProjectsIDParams creates a new PatchAPIProjectsIDParams 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 NewPatchAPIProjectsIDParams() *PatchAPIProjectsIDParams {
|
||||
return &PatchAPIProjectsIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDParamsWithTimeout creates a new PatchAPIProjectsIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPIProjectsIDParamsWithTimeout(timeout time.Duration) *PatchAPIProjectsIDParams {
|
||||
return &PatchAPIProjectsIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDParamsWithContext creates a new PatchAPIProjectsIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPIProjectsIDParamsWithContext(ctx context.Context) *PatchAPIProjectsIDParams {
|
||||
return &PatchAPIProjectsIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDParamsWithHTTPClient creates a new PatchAPIProjectsIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPIProjectsIDParamsWithHTTPClient(client *http.Client) *PatchAPIProjectsIDParams {
|
||||
return &PatchAPIProjectsIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API projects ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPIProjectsIDParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ProjectEditForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Project ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API projects ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIProjectsIDParams) WithDefaults() *PatchAPIProjectsIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API projects ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPIProjectsIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) WithTimeout(timeout time.Duration) *PatchAPIProjectsIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) WithContext(ctx context.Context) *PatchAPIProjectsIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) WithHTTPClient(client *http.Client) *PatchAPIProjectsIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) WithBody(body *models.ProjectEditForm) *PatchAPIProjectsIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) SetBody(body *models.ProjectEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) WithID(id int64) *PatchAPIProjectsIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API projects ID params
|
||||
func (o *PatchAPIProjectsIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPIProjectsIDParams) 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/project/patch_api_projects_id_responses.go
Normal file
98
client/project/patch_api_projects_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPIProjectsIDReader is a Reader for the PatchAPIProjectsID structure.
|
||||
type PatchAPIProjectsIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPIProjectsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPIProjectsIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPIProjectsIDOK creates a PatchAPIProjectsIDOK with default headers values
|
||||
func NewPatchAPIProjectsIDOK() *PatchAPIProjectsIDOK {
|
||||
return &PatchAPIProjectsIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated project
|
||||
*/
|
||||
type PatchAPIProjectsIDOK struct {
|
||||
Payload *models.ProjectEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api projects Id o k response has a 2xx status code
|
||||
func (o *PatchAPIProjectsIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api projects Id o k response has a 3xx status code
|
||||
func (o *PatchAPIProjectsIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api projects Id o k response has a 4xx status code
|
||||
func (o *PatchAPIProjectsIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api projects Id o k response has a 5xx status code
|
||||
func (o *PatchAPIProjectsIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api projects Id o k response a status code equal to that given
|
||||
func (o *PatchAPIProjectsIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/projects/{id}][%d] patchApiProjectsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/projects/{id}][%d] patchApiProjectsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDOK) GetPayload() *models.ProjectEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPIProjectsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ProjectEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
173
client/project/post_api_projects_id_rates_parameters.go
Normal file
173
client/project/post_api_projects_id_rates_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPIProjectsIDRatesParams creates a new PostAPIProjectsIDRatesParams 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 NewPostAPIProjectsIDRatesParams() *PostAPIProjectsIDRatesParams {
|
||||
return &PostAPIProjectsIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsIDRatesParamsWithTimeout creates a new PostAPIProjectsIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPIProjectsIDRatesParamsWithTimeout(timeout time.Duration) *PostAPIProjectsIDRatesParams {
|
||||
return &PostAPIProjectsIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsIDRatesParamsWithContext creates a new PostAPIProjectsIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPIProjectsIDRatesParamsWithContext(ctx context.Context) *PostAPIProjectsIDRatesParams {
|
||||
return &PostAPIProjectsIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsIDRatesParamsWithHTTPClient creates a new PostAPIProjectsIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPIProjectsIDRatesParamsWithHTTPClient(client *http.Client) *PostAPIProjectsIDRatesParams {
|
||||
return &PostAPIProjectsIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjectsIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API projects ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPIProjectsIDRatesParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ProjectRateForm
|
||||
|
||||
/* ID.
|
||||
|
||||
The project to add the rate for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API projects ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIProjectsIDRatesParams) WithDefaults() *PostAPIProjectsIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API projects ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIProjectsIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) WithTimeout(timeout time.Duration) *PostAPIProjectsIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) WithContext(ctx context.Context) *PostAPIProjectsIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) WithHTTPClient(client *http.Client) *PostAPIProjectsIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) WithBody(body *models.ProjectRateForm) *PostAPIProjectsIDRatesParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) SetBody(body *models.ProjectRateForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) WithID(id int64) *PostAPIProjectsIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API projects ID rates params
|
||||
func (o *PostAPIProjectsIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPIProjectsIDRatesParams) 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/project/post_api_projects_id_rates_responses.go
Normal file
98
client/project/post_api_projects_id_rates_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPIProjectsIDRatesReader is a Reader for the PostAPIProjectsIDRates structure.
|
||||
type PostAPIProjectsIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPIProjectsIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPIProjectsIDRatesOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsIDRatesOK creates a PostAPIProjectsIDRatesOK with default headers values
|
||||
func NewPostAPIProjectsIDRatesOK() *PostAPIProjectsIDRatesOK {
|
||||
return &PostAPIProjectsIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjectsIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created rate
|
||||
*/
|
||||
type PostAPIProjectsIDRatesOK struct {
|
||||
Payload *models.ProjectRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api projects Id rates o k response has a 2xx status code
|
||||
func (o *PostAPIProjectsIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api projects Id rates o k response has a 3xx status code
|
||||
func (o *PostAPIProjectsIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api projects Id rates o k response has a 4xx status code
|
||||
func (o *PostAPIProjectsIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api projects Id rates o k response has a 5xx status code
|
||||
func (o *PostAPIProjectsIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api projects Id rates o k response a status code equal to that given
|
||||
func (o *PostAPIProjectsIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/projects/{id}/rates][%d] postApiProjectsIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/projects/{id}/rates][%d] postApiProjectsIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsIDRatesOK) GetPayload() *models.ProjectRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsIDRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ProjectRate)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
150
client/project/post_api_projects_parameters.go
Normal file
150
client/project/post_api_projects_parameters.go
Normal file
@ -0,0 +1,150 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPIProjectsParams creates a new PostAPIProjectsParams 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 NewPostAPIProjectsParams() *PostAPIProjectsParams {
|
||||
return &PostAPIProjectsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsParamsWithTimeout creates a new PostAPIProjectsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPIProjectsParamsWithTimeout(timeout time.Duration) *PostAPIProjectsParams {
|
||||
return &PostAPIProjectsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsParamsWithContext creates a new PostAPIProjectsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPIProjectsParamsWithContext(ctx context.Context) *PostAPIProjectsParams {
|
||||
return &PostAPIProjectsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsParamsWithHTTPClient creates a new PostAPIProjectsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPIProjectsParamsWithHTTPClient(client *http.Client) *PostAPIProjectsParams {
|
||||
return &PostAPIProjectsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjectsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API projects operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPIProjectsParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.ProjectEditForm
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API projects params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIProjectsParams) WithDefaults() *PostAPIProjectsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API projects params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPIProjectsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API projects params
|
||||
func (o *PostAPIProjectsParams) WithTimeout(timeout time.Duration) *PostAPIProjectsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API projects params
|
||||
func (o *PostAPIProjectsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API projects params
|
||||
func (o *PostAPIProjectsParams) WithContext(ctx context.Context) *PostAPIProjectsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API projects params
|
||||
func (o *PostAPIProjectsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API projects params
|
||||
func (o *PostAPIProjectsParams) WithHTTPClient(client *http.Client) *PostAPIProjectsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API projects params
|
||||
func (o *PostAPIProjectsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API projects params
|
||||
func (o *PostAPIProjectsParams) WithBody(body *models.ProjectEditForm) *PostAPIProjectsParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API projects params
|
||||
func (o *PostAPIProjectsParams) SetBody(body *models.ProjectEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPIProjectsParams) 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/project/post_api_projects_responses.go
Normal file
98
client/project/post_api_projects_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPIProjectsReader is a Reader for the PostAPIProjects structure.
|
||||
type PostAPIProjectsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPIProjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPIProjectsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPIProjectsOK creates a PostAPIProjectsOK with default headers values
|
||||
func NewPostAPIProjectsOK() *PostAPIProjectsOK {
|
||||
return &PostAPIProjectsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjectsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created project
|
||||
*/
|
||||
type PostAPIProjectsOK struct {
|
||||
Payload *models.ProjectEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api projects o k response has a 2xx status code
|
||||
func (o *PostAPIProjectsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api projects o k response has a 3xx status code
|
||||
func (o *PostAPIProjectsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api projects o k response has a 4xx status code
|
||||
func (o *PostAPIProjectsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api projects o k response has a 5xx status code
|
||||
func (o *PostAPIProjectsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api projects o k response a status code equal to that given
|
||||
func (o *PostAPIProjectsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/projects][%d] postApiProjectsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/projects][%d] postApiProjectsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsOK) GetPayload() *models.ProjectEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPIProjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ProjectEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
371
client/project/project_client.go
Normal file
371
client/project/project_client.go
Normal file
@ -0,0 +1,371 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package project
|
||||
|
||||
// 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 project API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for project 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 {
|
||||
DeleteAPIProjectsIDRatesRateID(params *DeleteAPIProjectsIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPIProjectsIDRatesRateIDNoContent, error)
|
||||
|
||||
GetAPIProjects(params *GetAPIProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsOK, error)
|
||||
|
||||
GetAPIProjectsID(params *GetAPIProjectsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsIDOK, error)
|
||||
|
||||
GetAPIProjectsIDRates(params *GetAPIProjectsIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsIDRatesOK, error)
|
||||
|
||||
PatchAPIProjectsID(params *PatchAPIProjectsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIProjectsIDOK, error)
|
||||
|
||||
PatchAPIProjectsIDMeta(params *PatchAPIProjectsIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIProjectsIDMetaOK, error)
|
||||
|
||||
PostAPIProjects(params *PostAPIProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIProjectsOK, error)
|
||||
|
||||
PostAPIProjectsIDRates(params *PostAPIProjectsIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIProjectsIDRatesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPIProjectsIDRatesRateID deletes one rate for an project
|
||||
*/
|
||||
func (a *Client) DeleteAPIProjectsIDRatesRateID(params *DeleteAPIProjectsIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPIProjectsIDRatesRateIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPIProjectsIDRatesRateIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPIProjectsIDRatesRateID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/projects/{id}/rates/{rateId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPIProjectsIDRatesRateIDReader{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.(*DeleteAPIProjectsIDRatesRateIDNoContent)
|
||||
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 DeleteAPIProjectsIDRatesRateID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjects returns a collection of projects
|
||||
*/
|
||||
func (a *Client) GetAPIProjects(params *GetAPIProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIProjectsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIProjects",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/projects",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIProjectsReader{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.(*GetAPIProjectsOK)
|
||||
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 GetAPIProjects: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsID returns one project
|
||||
*/
|
||||
func (a *Client) GetAPIProjectsID(params *GetAPIProjectsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIProjectsIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIProjectsID",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/projects/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIProjectsIDReader{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.(*GetAPIProjectsIDOK)
|
||||
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 GetAPIProjectsID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPIProjectsIDRates returns a collection of all rates for one project
|
||||
*/
|
||||
func (a *Client) GetAPIProjectsIDRates(params *GetAPIProjectsIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPIProjectsIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPIProjectsIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPIProjectsIDRates",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/projects/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPIProjectsIDRatesReader{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.(*GetAPIProjectsIDRatesOK)
|
||||
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 GetAPIProjectsIDRates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsID updates an existing project
|
||||
|
||||
Update an existing project, you can pass all or just a subset of all attributes
|
||||
*/
|
||||
func (a *Client) PatchAPIProjectsID(params *PatchAPIProjectsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIProjectsIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPIProjectsIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPIProjectsID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/projects/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPIProjectsIDReader{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.(*PatchAPIProjectsIDOK)
|
||||
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 PatchAPIProjectsID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPIProjectsIDMeta sets the value of a meta field for an existing project
|
||||
*/
|
||||
func (a *Client) PatchAPIProjectsIDMeta(params *PatchAPIProjectsIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPIProjectsIDMetaOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPIProjectsIDMetaParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPIProjectsIDMeta",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/projects/{id}/meta",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPIProjectsIDMetaReader{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.(*PatchAPIProjectsIDMetaOK)
|
||||
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 PatchAPIProjectsIDMeta: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjects creates a new project
|
||||
|
||||
Creates a new project and returns it afterwards
|
||||
*/
|
||||
func (a *Client) PostAPIProjects(params *PostAPIProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIProjectsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPIProjectsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPIProjects",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/projects",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPIProjectsReader{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.(*PostAPIProjectsOK)
|
||||
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 PostAPIProjects: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPIProjectsIDRates adds a new rate to an project
|
||||
*/
|
||||
func (a *Client) PostAPIProjectsIDRates(params *PostAPIProjectsIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPIProjectsIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPIProjectsIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPIProjectsIDRates",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/projects/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPIProjectsIDRatesReader{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.(*PostAPIProjectsIDRatesOK)
|
||||
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 PostAPIProjectsIDRates: 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