feat: init
This commit is contained in:
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITeamsIDActivitiesActivityIDParams creates a new DeleteAPITeamsIDActivitiesActivityIDParams 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 NewDeleteAPITeamsIDActivitiesActivityIDParams() *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
return &DeleteAPITeamsIDActivitiesActivityIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDActivitiesActivityIDParamsWithTimeout creates a new DeleteAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITeamsIDActivitiesActivityIDParamsWithTimeout(timeout time.Duration) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
return &DeleteAPITeamsIDActivitiesActivityIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDActivitiesActivityIDParamsWithContext creates a new DeleteAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITeamsIDActivitiesActivityIDParamsWithContext(ctx context.Context) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
return &DeleteAPITeamsIDActivitiesActivityIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDActivitiesActivityIDParamsWithHTTPClient creates a new DeleteAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITeamsIDActivitiesActivityIDParamsWithHTTPClient(client *http.Client) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
return &DeleteAPITeamsIDActivitiesActivityIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDActivitiesActivityIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API teams ID activities activity ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITeamsIDActivitiesActivityIDParams struct {
|
||||
|
||||
/* ActivityID.
|
||||
|
||||
The activity to remove (Activity ID)
|
||||
*/
|
||||
ActivityID int64
|
||||
|
||||
/* ID.
|
||||
|
||||
The team whose permission will be revoked
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API teams ID activities activity ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithDefaults() *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API teams ID activities activity ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithTimeout(timeout time.Duration) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithContext(ctx context.Context) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithHTTPClient(client *http.Client) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActivityID adds the activityID to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithActivityID(activityID int64) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetActivityID(activityID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActivityID adds the activityId to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetActivityID(activityID int64) {
|
||||
o.ActivityID = activityID
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WithID(id int64) *DeleteAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API teams ID activities activity ID params
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param activityId
|
||||
if err := r.SetPathParam("activityId", swag.FormatInt64(o.ActivityID)); 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
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITeamsIDActivitiesActivityIDReader is a Reader for the DeleteAPITeamsIDActivitiesActivityID structure.
|
||||
type DeleteAPITeamsIDActivitiesActivityIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAPITeamsIDActivitiesActivityIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDActivitiesActivityIDOK creates a DeleteAPITeamsIDActivitiesActivityIDOK with default headers values
|
||||
func NewDeleteAPITeamsIDActivitiesActivityIDOK() *DeleteAPITeamsIDActivitiesActivityIDOK {
|
||||
return &DeleteAPITeamsIDActivitiesActivityIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDActivitiesActivityIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Removes a activity from the team.
|
||||
*/
|
||||
type DeleteAPITeamsIDActivitiesActivityIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api teams Id activities activity Id o k response has a 2xx status code
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api teams Id activities activity Id o k response has a 3xx status code
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api teams Id activities activity Id o k response has a 4xx status code
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api teams Id activities activity Id o k response has a 5xx status code
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api teams Id activities activity Id o k response a status code equal to that given
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/activities/{activityId}][%d] deleteApiTeamsIdActivitiesActivityIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/activities/{activityId}][%d] deleteApiTeamsIdActivitiesActivityIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDActivitiesActivityIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITeamsIDCustomersCustomerIDParams creates a new DeleteAPITeamsIDCustomersCustomerIDParams 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 NewDeleteAPITeamsIDCustomersCustomerIDParams() *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
return &DeleteAPITeamsIDCustomersCustomerIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDCustomersCustomerIDParamsWithTimeout creates a new DeleteAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITeamsIDCustomersCustomerIDParamsWithTimeout(timeout time.Duration) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
return &DeleteAPITeamsIDCustomersCustomerIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDCustomersCustomerIDParamsWithContext creates a new DeleteAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITeamsIDCustomersCustomerIDParamsWithContext(ctx context.Context) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
return &DeleteAPITeamsIDCustomersCustomerIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDCustomersCustomerIDParamsWithHTTPClient creates a new DeleteAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITeamsIDCustomersCustomerIDParamsWithHTTPClient(client *http.Client) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
return &DeleteAPITeamsIDCustomersCustomerIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDCustomersCustomerIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API teams ID customers customer ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITeamsIDCustomersCustomerIDParams struct {
|
||||
|
||||
/* CustomerID.
|
||||
|
||||
The customer to remove (Customer ID)
|
||||
*/
|
||||
CustomerID int64
|
||||
|
||||
/* ID.
|
||||
|
||||
The team whose permission will be revoked
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API teams ID customers customer ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithDefaults() *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API teams ID customers customer ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithTimeout(timeout time.Duration) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithContext(ctx context.Context) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithHTTPClient(client *http.Client) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCustomerID adds the customerID to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithCustomerID(customerID int64) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetCustomerID(customerID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCustomerID adds the customerId to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetCustomerID(customerID int64) {
|
||||
o.CustomerID = customerID
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WithID(id int64) *DeleteAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API teams ID customers customer ID params
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param customerId
|
||||
if err := r.SetPathParam("customerId", swag.FormatInt64(o.CustomerID)); 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
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITeamsIDCustomersCustomerIDReader is a Reader for the DeleteAPITeamsIDCustomersCustomerID structure.
|
||||
type DeleteAPITeamsIDCustomersCustomerIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAPITeamsIDCustomersCustomerIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDCustomersCustomerIDOK creates a DeleteAPITeamsIDCustomersCustomerIDOK with default headers values
|
||||
func NewDeleteAPITeamsIDCustomersCustomerIDOK() *DeleteAPITeamsIDCustomersCustomerIDOK {
|
||||
return &DeleteAPITeamsIDCustomersCustomerIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDCustomersCustomerIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Removes a customer from the team.
|
||||
*/
|
||||
type DeleteAPITeamsIDCustomersCustomerIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api teams Id customers customer Id o k response has a 2xx status code
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api teams Id customers customer Id o k response has a 3xx status code
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api teams Id customers customer Id o k response has a 4xx status code
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api teams Id customers customer Id o k response has a 5xx status code
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api teams Id customers customer Id o k response a status code equal to that given
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/customers/{customerId}][%d] deleteApiTeamsIdCustomersCustomerIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/customers/{customerId}][%d] deleteApiTeamsIdCustomersCustomerIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDCustomersCustomerIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
174
client/team/delete_api_teams_id_members_user_id_parameters.go
Normal file
174
client/team/delete_api_teams_id_members_user_id_parameters.go
Normal file
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITeamsIDMembersUserIDParams creates a new DeleteAPITeamsIDMembersUserIDParams 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 NewDeleteAPITeamsIDMembersUserIDParams() *DeleteAPITeamsIDMembersUserIDParams {
|
||||
return &DeleteAPITeamsIDMembersUserIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDMembersUserIDParamsWithTimeout creates a new DeleteAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITeamsIDMembersUserIDParamsWithTimeout(timeout time.Duration) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
return &DeleteAPITeamsIDMembersUserIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDMembersUserIDParamsWithContext creates a new DeleteAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITeamsIDMembersUserIDParamsWithContext(ctx context.Context) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
return &DeleteAPITeamsIDMembersUserIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDMembersUserIDParamsWithHTTPClient creates a new DeleteAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITeamsIDMembersUserIDParamsWithHTTPClient(client *http.Client) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
return &DeleteAPITeamsIDMembersUserIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDMembersUserIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API teams ID members user ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITeamsIDMembersUserIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The team from which the member will be removed
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* UserID.
|
||||
|
||||
The team member to remove (User ID)
|
||||
*/
|
||||
UserID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API teams ID members user ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithDefaults() *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API teams ID members user ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithTimeout(timeout time.Duration) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithContext(ctx context.Context) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithHTTPClient(client *http.Client) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithID(id int64) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithUserID adds the userID to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) WithUserID(userID int64) *DeleteAPITeamsIDMembersUserIDParams {
|
||||
o.SetUserID(userID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserID adds the userId to the delete API teams ID members user ID params
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) SetUserID(userID int64) {
|
||||
o.UserID = userID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITeamsIDMembersUserIDParams) 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 userId
|
||||
if err := r.SetPathParam("userId", swag.FormatInt64(o.UserID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/team/delete_api_teams_id_members_user_id_responses.go
Normal file
98
client/team/delete_api_teams_id_members_user_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITeamsIDMembersUserIDReader is a Reader for the DeleteAPITeamsIDMembersUserID structure.
|
||||
type DeleteAPITeamsIDMembersUserIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITeamsIDMembersUserIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAPITeamsIDMembersUserIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDMembersUserIDOK creates a DeleteAPITeamsIDMembersUserIDOK with default headers values
|
||||
func NewDeleteAPITeamsIDMembersUserIDOK() *DeleteAPITeamsIDMembersUserIDOK {
|
||||
return &DeleteAPITeamsIDMembersUserIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDMembersUserIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Removes a user from the team. The teamlead cannot be removed.
|
||||
*/
|
||||
type DeleteAPITeamsIDMembersUserIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api teams Id members user Id o k response has a 2xx status code
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api teams Id members user Id o k response has a 3xx status code
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api teams Id members user Id o k response has a 4xx status code
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api teams Id members user Id o k response has a 5xx status code
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api teams Id members user Id o k response a status code equal to that given
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/members/{userId}][%d] deleteApiTeamsIdMembersUserIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/members/{userId}][%d] deleteApiTeamsIdMembersUserIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDMembersUserIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
152
client/team/delete_api_teams_id_parameters.go
Normal file
152
client/team/delete_api_teams_id_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITeamsIDParams creates a new DeleteAPITeamsIDParams 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 NewDeleteAPITeamsIDParams() *DeleteAPITeamsIDParams {
|
||||
return &DeleteAPITeamsIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDParamsWithTimeout creates a new DeleteAPITeamsIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITeamsIDParamsWithTimeout(timeout time.Duration) *DeleteAPITeamsIDParams {
|
||||
return &DeleteAPITeamsIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDParamsWithContext creates a new DeleteAPITeamsIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITeamsIDParamsWithContext(ctx context.Context) *DeleteAPITeamsIDParams {
|
||||
return &DeleteAPITeamsIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDParamsWithHTTPClient creates a new DeleteAPITeamsIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITeamsIDParamsWithHTTPClient(client *http.Client) *DeleteAPITeamsIDParams {
|
||||
return &DeleteAPITeamsIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API teams ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITeamsIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Team ID to delete
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDParams) WithDefaults() *DeleteAPITeamsIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) WithTimeout(timeout time.Duration) *DeleteAPITeamsIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) WithContext(ctx context.Context) *DeleteAPITeamsIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) WithHTTPClient(client *http.Client) *DeleteAPITeamsIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) WithID(id int64) *DeleteAPITeamsIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API teams ID params
|
||||
func (o *DeleteAPITeamsIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITeamsIDParams) 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
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewDeleteAPITeamsIDProjectsProjectIDParams creates a new DeleteAPITeamsIDProjectsProjectIDParams 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 NewDeleteAPITeamsIDProjectsProjectIDParams() *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
return &DeleteAPITeamsIDProjectsProjectIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDProjectsProjectIDParamsWithTimeout creates a new DeleteAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPITeamsIDProjectsProjectIDParamsWithTimeout(timeout time.Duration) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
return &DeleteAPITeamsIDProjectsProjectIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDProjectsProjectIDParamsWithContext creates a new DeleteAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPITeamsIDProjectsProjectIDParamsWithContext(ctx context.Context) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
return &DeleteAPITeamsIDProjectsProjectIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDProjectsProjectIDParamsWithHTTPClient creates a new DeleteAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPITeamsIDProjectsProjectIDParamsWithHTTPClient(client *http.Client) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
return &DeleteAPITeamsIDProjectsProjectIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDProjectsProjectIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API teams ID projects project ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPITeamsIDProjectsProjectIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The team whose permission will be revoked
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* ProjectID.
|
||||
|
||||
The project to remove (Project ID)
|
||||
*/
|
||||
ProjectID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API teams ID projects project ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithDefaults() *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API teams ID projects project ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithTimeout(timeout time.Duration) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithContext(ctx context.Context) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithHTTPClient(client *http.Client) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithID(id int64) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithProjectID adds the projectID to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) WithProjectID(projectID int64) *DeleteAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetProjectID(projectID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetProjectID adds the projectId to the delete API teams ID projects project ID params
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) SetProjectID(projectID int64) {
|
||||
o.ProjectID = projectID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDParams) 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 projectId
|
||||
if err := r.SetPathParam("projectId", swag.FormatInt64(o.ProjectID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITeamsIDProjectsProjectIDReader is a Reader for the DeleteAPITeamsIDProjectsProjectID structure.
|
||||
type DeleteAPITeamsIDProjectsProjectIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAPITeamsIDProjectsProjectIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDProjectsProjectIDOK creates a DeleteAPITeamsIDProjectsProjectIDOK with default headers values
|
||||
func NewDeleteAPITeamsIDProjectsProjectIDOK() *DeleteAPITeamsIDProjectsProjectIDOK {
|
||||
return &DeleteAPITeamsIDProjectsProjectIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDProjectsProjectIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Removes a project from the team.
|
||||
*/
|
||||
type DeleteAPITeamsIDProjectsProjectIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api teams Id projects project Id o k response has a 2xx status code
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api teams Id projects project Id o k response has a 3xx status code
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api teams Id projects project Id o k response has a 4xx status code
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api teams Id projects project Id o k response has a 5xx status code
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api teams Id projects project Id o k response a status code equal to that given
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/projects/{projectId}][%d] deleteApiTeamsIdProjectsProjectIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}/projects/{projectId}][%d] deleteApiTeamsIdProjectsProjectIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDProjectsProjectIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
83
client/team/delete_api_teams_id_responses.go
Normal file
83
client/team/delete_api_teams_id_responses.go
Normal file
@ -0,0 +1,83 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeleteAPITeamsIDReader is a Reader for the DeleteAPITeamsID structure.
|
||||
type DeleteAPITeamsIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPITeamsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPITeamsIDNoContent()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPITeamsIDNoContent creates a DeleteAPITeamsIDNoContent with default headers values
|
||||
func NewDeleteAPITeamsIDNoContent() *DeleteAPITeamsIDNoContent {
|
||||
return &DeleteAPITeamsIDNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
Delete one team
|
||||
*/
|
||||
type DeleteAPITeamsIDNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api teams Id no content response has a 2xx status code
|
||||
func (o *DeleteAPITeamsIDNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api teams Id no content response has a 3xx status code
|
||||
func (o *DeleteAPITeamsIDNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api teams Id no content response has a 4xx status code
|
||||
func (o *DeleteAPITeamsIDNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api teams Id no content response has a 5xx status code
|
||||
func (o *DeleteAPITeamsIDNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api teams Id no content response a status code equal to that given
|
||||
func (o *DeleteAPITeamsIDNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}][%d] deleteApiTeamsIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/teams/{id}][%d] deleteApiTeamsIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPITeamsIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
148
client/team/get_api_teams_id_parameters.go
Normal file
148
client/team/get_api_teams_id_parameters.go
Normal file
@ -0,0 +1,148 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPITeamsIDParams creates a new GetAPITeamsIDParams 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 NewGetAPITeamsIDParams() *GetAPITeamsIDParams {
|
||||
return &GetAPITeamsIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsIDParamsWithTimeout creates a new GetAPITeamsIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPITeamsIDParamsWithTimeout(timeout time.Duration) *GetAPITeamsIDParams {
|
||||
return &GetAPITeamsIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsIDParamsWithContext creates a new GetAPITeamsIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPITeamsIDParamsWithContext(ctx context.Context) *GetAPITeamsIDParams {
|
||||
return &GetAPITeamsIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsIDParamsWithHTTPClient creates a new GetAPITeamsIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPITeamsIDParamsWithHTTPClient(client *http.Client) *GetAPITeamsIDParams {
|
||||
return &GetAPITeamsIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeamsIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API teams ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPITeamsIDParams struct {
|
||||
|
||||
// ID.
|
||||
ID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITeamsIDParams) WithDefaults() *GetAPITeamsIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITeamsIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) WithTimeout(timeout time.Duration) *GetAPITeamsIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) WithContext(ctx context.Context) *GetAPITeamsIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) WithHTTPClient(client *http.Client) *GetAPITeamsIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) WithID(id string) *GetAPITeamsIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API teams ID params
|
||||
func (o *GetAPITeamsIDParams) SetID(id string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPITeamsIDParams) 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
|
||||
}
|
98
client/team/get_api_teams_id_responses.go
Normal file
98
client/team/get_api_teams_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPITeamsIDReader is a Reader for the GetAPITeamsID structure.
|
||||
type GetAPITeamsIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPITeamsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPITeamsIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsIDOK creates a GetAPITeamsIDOK with default headers values
|
||||
func NewGetAPITeamsIDOK() *GetAPITeamsIDOK {
|
||||
return &GetAPITeamsIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeamsIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns one team entity
|
||||
*/
|
||||
type GetAPITeamsIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api teams Id o k response has a 2xx status code
|
||||
func (o *GetAPITeamsIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api teams Id o k response has a 3xx status code
|
||||
func (o *GetAPITeamsIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api teams Id o k response has a 4xx status code
|
||||
func (o *GetAPITeamsIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api teams Id o k response has a 5xx status code
|
||||
func (o *GetAPITeamsIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api teams Id o k response a status code equal to that given
|
||||
func (o *GetAPITeamsIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/teams/{id}][%d] getApiTeamsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsIDOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/teams/{id}][%d] getApiTeamsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
128
client/team/get_api_teams_parameters.go
Normal file
128
client/team/get_api_teams_parameters.go
Normal file
@ -0,0 +1,128 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAPITeamsParams creates a new GetAPITeamsParams 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 NewGetAPITeamsParams() *GetAPITeamsParams {
|
||||
return &GetAPITeamsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsParamsWithTimeout creates a new GetAPITeamsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPITeamsParamsWithTimeout(timeout time.Duration) *GetAPITeamsParams {
|
||||
return &GetAPITeamsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsParamsWithContext creates a new GetAPITeamsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPITeamsParamsWithContext(ctx context.Context) *GetAPITeamsParams {
|
||||
return &GetAPITeamsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsParamsWithHTTPClient creates a new GetAPITeamsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPITeamsParamsWithHTTPClient(client *http.Client) *GetAPITeamsParams {
|
||||
return &GetAPITeamsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeamsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API teams operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPITeamsParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API teams params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITeamsParams) WithDefaults() *GetAPITeamsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API teams params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPITeamsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API teams params
|
||||
func (o *GetAPITeamsParams) WithTimeout(timeout time.Duration) *GetAPITeamsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API teams params
|
||||
func (o *GetAPITeamsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API teams params
|
||||
func (o *GetAPITeamsParams) WithContext(ctx context.Context) *GetAPITeamsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API teams params
|
||||
func (o *GetAPITeamsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API teams params
|
||||
func (o *GetAPITeamsParams) WithHTTPClient(client *http.Client) *GetAPITeamsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API teams params
|
||||
func (o *GetAPITeamsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPITeamsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/team/get_api_teams_responses.go
Normal file
96
client/team/get_api_teams_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// GetAPITeamsReader is a Reader for the GetAPITeams structure.
|
||||
type GetAPITeamsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPITeamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPITeamsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPITeamsOK creates a GetAPITeamsOK with default headers values
|
||||
func NewGetAPITeamsOK() *GetAPITeamsOK {
|
||||
return &GetAPITeamsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeamsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the collection of all existing teams
|
||||
*/
|
||||
type GetAPITeamsOK struct {
|
||||
Payload []*models.TeamCollection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api teams o k response has a 2xx status code
|
||||
func (o *GetAPITeamsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api teams o k response has a 3xx status code
|
||||
func (o *GetAPITeamsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api teams o k response has a 4xx status code
|
||||
func (o *GetAPITeamsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api teams o k response has a 5xx status code
|
||||
func (o *GetAPITeamsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api teams o k response a status code equal to that given
|
||||
func (o *GetAPITeamsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/teams][%d] getApiTeamsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/teams][%d] getApiTeamsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsOK) GetPayload() []*models.TeamCollection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPITeamsOK) 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
|
||||
}
|
173
client/team/patch_api_teams_id_parameters.go
Normal file
173
client/team/patch_api_teams_id_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPatchAPITeamsIDParams creates a new PatchAPITeamsIDParams 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 NewPatchAPITeamsIDParams() *PatchAPITeamsIDParams {
|
||||
return &PatchAPITeamsIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITeamsIDParamsWithTimeout creates a new PatchAPITeamsIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPITeamsIDParamsWithTimeout(timeout time.Duration) *PatchAPITeamsIDParams {
|
||||
return &PatchAPITeamsIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITeamsIDParamsWithContext creates a new PatchAPITeamsIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPITeamsIDParamsWithContext(ctx context.Context) *PatchAPITeamsIDParams {
|
||||
return &PatchAPITeamsIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITeamsIDParamsWithHTTPClient creates a new PatchAPITeamsIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPITeamsIDParamsWithHTTPClient(client *http.Client) *PatchAPITeamsIDParams {
|
||||
return &PatchAPITeamsIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITeamsIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API teams ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPITeamsIDParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.TeamEditForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Team ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITeamsIDParams) WithDefaults() *PatchAPITeamsIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API teams ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPITeamsIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) WithTimeout(timeout time.Duration) *PatchAPITeamsIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) WithContext(ctx context.Context) *PatchAPITeamsIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) WithHTTPClient(client *http.Client) *PatchAPITeamsIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) WithBody(body *models.TeamEditForm) *PatchAPITeamsIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) SetBody(body *models.TeamEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) WithID(id int64) *PatchAPITeamsIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API teams ID params
|
||||
func (o *PatchAPITeamsIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPITeamsIDParams) 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/team/patch_api_teams_id_responses.go
Normal file
98
client/team/patch_api_teams_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PatchAPITeamsIDReader is a Reader for the PatchAPITeamsID structure.
|
||||
type PatchAPITeamsIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPITeamsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPITeamsIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPITeamsIDOK creates a PatchAPITeamsIDOK with default headers values
|
||||
func NewPatchAPITeamsIDOK() *PatchAPITeamsIDOK {
|
||||
return &PatchAPITeamsIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITeamsIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated team
|
||||
*/
|
||||
type PatchAPITeamsIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api teams Id o k response has a 2xx status code
|
||||
func (o *PatchAPITeamsIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api teams Id o k response has a 3xx status code
|
||||
func (o *PatchAPITeamsIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api teams Id o k response has a 4xx status code
|
||||
func (o *PatchAPITeamsIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api teams Id o k response has a 5xx status code
|
||||
func (o *PatchAPITeamsIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api teams Id o k response a status code equal to that given
|
||||
func (o *PatchAPITeamsIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPITeamsIDOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/teams/{id}][%d] patchApiTeamsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITeamsIDOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/teams/{id}][%d] patchApiTeamsIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPITeamsIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPITeamsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITeamsIDActivitiesActivityIDParams creates a new PostAPITeamsIDActivitiesActivityIDParams 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 NewPostAPITeamsIDActivitiesActivityIDParams() *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
return &PostAPITeamsIDActivitiesActivityIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDActivitiesActivityIDParamsWithTimeout creates a new PostAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITeamsIDActivitiesActivityIDParamsWithTimeout(timeout time.Duration) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
return &PostAPITeamsIDActivitiesActivityIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDActivitiesActivityIDParamsWithContext creates a new PostAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITeamsIDActivitiesActivityIDParamsWithContext(ctx context.Context) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
return &PostAPITeamsIDActivitiesActivityIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDActivitiesActivityIDParamsWithHTTPClient creates a new PostAPITeamsIDActivitiesActivityIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITeamsIDActivitiesActivityIDParamsWithHTTPClient(client *http.Client) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
return &PostAPITeamsIDActivitiesActivityIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDActivitiesActivityIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API teams ID activities activity ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITeamsIDActivitiesActivityIDParams struct {
|
||||
|
||||
/* ActivityID.
|
||||
|
||||
The activity to grant acecess to (Activity ID)
|
||||
*/
|
||||
ActivityID int64
|
||||
|
||||
/* ID.
|
||||
|
||||
The team that is granted access
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API teams ID activities activity ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithDefaults() *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API teams ID activities activity ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithTimeout(timeout time.Duration) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithContext(ctx context.Context) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithHTTPClient(client *http.Client) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActivityID adds the activityID to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithActivityID(activityID int64) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetActivityID(activityID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActivityID adds the activityId to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetActivityID(activityID int64) {
|
||||
o.ActivityID = activityID
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WithID(id int64) *PostAPITeamsIDActivitiesActivityIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API teams ID activities activity ID params
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param activityId
|
||||
if err := r.SetPathParam("activityId", swag.FormatInt64(o.ActivityID)); 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
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITeamsIDActivitiesActivityIDReader is a Reader for the PostAPITeamsIDActivitiesActivityID structure.
|
||||
type PostAPITeamsIDActivitiesActivityIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITeamsIDActivitiesActivityIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDActivitiesActivityIDOK creates a PostAPITeamsIDActivitiesActivityIDOK with default headers values
|
||||
func NewPostAPITeamsIDActivitiesActivityIDOK() *PostAPITeamsIDActivitiesActivityIDOK {
|
||||
return &PostAPITeamsIDActivitiesActivityIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDActivitiesActivityIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Adds a new activity to a team.
|
||||
*/
|
||||
type PostAPITeamsIDActivitiesActivityIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api teams Id activities activity Id o k response has a 2xx status code
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api teams Id activities activity Id o k response has a 3xx status code
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api teams Id activities activity Id o k response has a 4xx status code
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api teams Id activities activity Id o k response has a 5xx status code
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api teams Id activities activity Id o k response a status code equal to that given
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/activities/{activityId}][%d] postApiTeamsIdActivitiesActivityIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/activities/{activityId}][%d] postApiTeamsIdActivitiesActivityIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDActivitiesActivityIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITeamsIDCustomersCustomerIDParams creates a new PostAPITeamsIDCustomersCustomerIDParams 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 NewPostAPITeamsIDCustomersCustomerIDParams() *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
return &PostAPITeamsIDCustomersCustomerIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDCustomersCustomerIDParamsWithTimeout creates a new PostAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITeamsIDCustomersCustomerIDParamsWithTimeout(timeout time.Duration) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
return &PostAPITeamsIDCustomersCustomerIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDCustomersCustomerIDParamsWithContext creates a new PostAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITeamsIDCustomersCustomerIDParamsWithContext(ctx context.Context) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
return &PostAPITeamsIDCustomersCustomerIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDCustomersCustomerIDParamsWithHTTPClient creates a new PostAPITeamsIDCustomersCustomerIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITeamsIDCustomersCustomerIDParamsWithHTTPClient(client *http.Client) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
return &PostAPITeamsIDCustomersCustomerIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDCustomersCustomerIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API teams ID customers customer ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITeamsIDCustomersCustomerIDParams struct {
|
||||
|
||||
/* CustomerID.
|
||||
|
||||
The customer to grant acecess to (Customer ID)
|
||||
*/
|
||||
CustomerID int64
|
||||
|
||||
/* ID.
|
||||
|
||||
The team that is granted access
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API teams ID customers customer ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithDefaults() *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API teams ID customers customer ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithTimeout(timeout time.Duration) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithContext(ctx context.Context) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithHTTPClient(client *http.Client) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCustomerID adds the customerID to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithCustomerID(customerID int64) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetCustomerID(customerID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCustomerID adds the customerId to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetCustomerID(customerID int64) {
|
||||
o.CustomerID = customerID
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WithID(id int64) *PostAPITeamsIDCustomersCustomerIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API teams ID customers customer ID params
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param customerId
|
||||
if err := r.SetPathParam("customerId", swag.FormatInt64(o.CustomerID)); 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
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITeamsIDCustomersCustomerIDReader is a Reader for the PostAPITeamsIDCustomersCustomerID structure.
|
||||
type PostAPITeamsIDCustomersCustomerIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITeamsIDCustomersCustomerIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDCustomersCustomerIDOK creates a PostAPITeamsIDCustomersCustomerIDOK with default headers values
|
||||
func NewPostAPITeamsIDCustomersCustomerIDOK() *PostAPITeamsIDCustomersCustomerIDOK {
|
||||
return &PostAPITeamsIDCustomersCustomerIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDCustomersCustomerIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Adds a new customer to a team.
|
||||
*/
|
||||
type PostAPITeamsIDCustomersCustomerIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api teams Id customers customer Id o k response has a 2xx status code
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api teams Id customers customer Id o k response has a 3xx status code
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api teams Id customers customer Id o k response has a 4xx status code
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api teams Id customers customer Id o k response has a 5xx status code
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api teams Id customers customer Id o k response a status code equal to that given
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/customers/{customerId}][%d] postApiTeamsIdCustomersCustomerIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/customers/{customerId}][%d] postApiTeamsIdCustomersCustomerIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDCustomersCustomerIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
174
client/team/post_api_teams_id_members_user_id_parameters.go
Normal file
174
client/team/post_api_teams_id_members_user_id_parameters.go
Normal file
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITeamsIDMembersUserIDParams creates a new PostAPITeamsIDMembersUserIDParams 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 NewPostAPITeamsIDMembersUserIDParams() *PostAPITeamsIDMembersUserIDParams {
|
||||
return &PostAPITeamsIDMembersUserIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDMembersUserIDParamsWithTimeout creates a new PostAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITeamsIDMembersUserIDParamsWithTimeout(timeout time.Duration) *PostAPITeamsIDMembersUserIDParams {
|
||||
return &PostAPITeamsIDMembersUserIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDMembersUserIDParamsWithContext creates a new PostAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITeamsIDMembersUserIDParamsWithContext(ctx context.Context) *PostAPITeamsIDMembersUserIDParams {
|
||||
return &PostAPITeamsIDMembersUserIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDMembersUserIDParamsWithHTTPClient creates a new PostAPITeamsIDMembersUserIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITeamsIDMembersUserIDParamsWithHTTPClient(client *http.Client) *PostAPITeamsIDMembersUserIDParams {
|
||||
return &PostAPITeamsIDMembersUserIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDMembersUserIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API teams ID members user ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITeamsIDMembersUserIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The team which will receive the new member
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* UserID.
|
||||
|
||||
The team member to add (User ID)
|
||||
*/
|
||||
UserID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API teams ID members user ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithDefaults() *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API teams ID members user ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithTimeout(timeout time.Duration) *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithContext(ctx context.Context) *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithHTTPClient(client *http.Client) *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithID(id int64) *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithUserID adds the userID to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) WithUserID(userID int64) *PostAPITeamsIDMembersUserIDParams {
|
||||
o.SetUserID(userID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetUserID adds the userId to the post API teams ID members user ID params
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) SetUserID(userID int64) {
|
||||
o.UserID = userID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITeamsIDMembersUserIDParams) 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 userId
|
||||
if err := r.SetPathParam("userId", swag.FormatInt64(o.UserID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/team/post_api_teams_id_members_user_id_responses.go
Normal file
98
client/team/post_api_teams_id_members_user_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITeamsIDMembersUserIDReader is a Reader for the PostAPITeamsIDMembersUserID structure.
|
||||
type PostAPITeamsIDMembersUserIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITeamsIDMembersUserIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITeamsIDMembersUserIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDMembersUserIDOK creates a PostAPITeamsIDMembersUserIDOK with default headers values
|
||||
func NewPostAPITeamsIDMembersUserIDOK() *PostAPITeamsIDMembersUserIDOK {
|
||||
return &PostAPITeamsIDMembersUserIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDMembersUserIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Adds a new user to a team.
|
||||
*/
|
||||
type PostAPITeamsIDMembersUserIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api teams Id members user Id o k response has a 2xx status code
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api teams Id members user Id o k response has a 3xx status code
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api teams Id members user Id o k response has a 4xx status code
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api teams Id members user Id o k response has a 5xx status code
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api teams Id members user Id o k response a status code equal to that given
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/members/{userId}][%d] postApiTeamsIdMembersUserIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/members/{userId}][%d] postApiTeamsIdMembersUserIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDMembersUserIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
174
client/team/post_api_teams_id_projects_project_id_parameters.go
Normal file
174
client/team/post_api_teams_id_projects_project_id_parameters.go
Normal file
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITeamsIDProjectsProjectIDParams creates a new PostAPITeamsIDProjectsProjectIDParams 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 NewPostAPITeamsIDProjectsProjectIDParams() *PostAPITeamsIDProjectsProjectIDParams {
|
||||
return &PostAPITeamsIDProjectsProjectIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDProjectsProjectIDParamsWithTimeout creates a new PostAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITeamsIDProjectsProjectIDParamsWithTimeout(timeout time.Duration) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
return &PostAPITeamsIDProjectsProjectIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDProjectsProjectIDParamsWithContext creates a new PostAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITeamsIDProjectsProjectIDParamsWithContext(ctx context.Context) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
return &PostAPITeamsIDProjectsProjectIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDProjectsProjectIDParamsWithHTTPClient creates a new PostAPITeamsIDProjectsProjectIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITeamsIDProjectsProjectIDParamsWithHTTPClient(client *http.Client) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
return &PostAPITeamsIDProjectsProjectIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDProjectsProjectIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API teams ID projects project ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITeamsIDProjectsProjectIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The team that is granted access
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* ProjectID.
|
||||
|
||||
The project to grant acecess to (Project ID)
|
||||
*/
|
||||
ProjectID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API teams ID projects project ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithDefaults() *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API teams ID projects project ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithTimeout(timeout time.Duration) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithContext(ctx context.Context) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithHTTPClient(client *http.Client) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithID(id int64) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithProjectID adds the projectID to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) WithProjectID(projectID int64) *PostAPITeamsIDProjectsProjectIDParams {
|
||||
o.SetProjectID(projectID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetProjectID adds the projectId to the post API teams ID projects project ID params
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) SetProjectID(projectID int64) {
|
||||
o.ProjectID = projectID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITeamsIDProjectsProjectIDParams) 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 projectId
|
||||
if err := r.SetPathParam("projectId", swag.FormatInt64(o.ProjectID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITeamsIDProjectsProjectIDReader is a Reader for the PostAPITeamsIDProjectsProjectID structure.
|
||||
type PostAPITeamsIDProjectsProjectIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITeamsIDProjectsProjectIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITeamsIDProjectsProjectIDOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsIDProjectsProjectIDOK creates a PostAPITeamsIDProjectsProjectIDOK with default headers values
|
||||
func NewPostAPITeamsIDProjectsProjectIDOK() *PostAPITeamsIDProjectsProjectIDOK {
|
||||
return &PostAPITeamsIDProjectsProjectIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDProjectsProjectIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Adds a new project to a team.
|
||||
*/
|
||||
type PostAPITeamsIDProjectsProjectIDOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api teams Id projects project Id o k response has a 2xx status code
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api teams Id projects project Id o k response has a 3xx status code
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api teams Id projects project Id o k response has a 4xx status code
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api teams Id projects project Id o k response has a 5xx status code
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api teams Id projects project Id o k response a status code equal to that given
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/projects/{projectId}][%d] postApiTeamsIdProjectsProjectIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/teams/{id}/projects/{projectId}][%d] postApiTeamsIdProjectsProjectIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsIDProjectsProjectIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
150
client/team/post_api_teams_parameters.go
Normal file
150
client/team/post_api_teams_parameters.go
Normal file
@ -0,0 +1,150 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPostAPITeamsParams creates a new PostAPITeamsParams 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 NewPostAPITeamsParams() *PostAPITeamsParams {
|
||||
return &PostAPITeamsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsParamsWithTimeout creates a new PostAPITeamsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPITeamsParamsWithTimeout(timeout time.Duration) *PostAPITeamsParams {
|
||||
return &PostAPITeamsParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsParamsWithContext creates a new PostAPITeamsParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPITeamsParamsWithContext(ctx context.Context) *PostAPITeamsParams {
|
||||
return &PostAPITeamsParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsParamsWithHTTPClient creates a new PostAPITeamsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPITeamsParamsWithHTTPClient(client *http.Client) *PostAPITeamsParams {
|
||||
return &PostAPITeamsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API teams operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPITeamsParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.TeamEditForm
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API teams params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsParams) WithDefaults() *PostAPITeamsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API teams params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPITeamsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API teams params
|
||||
func (o *PostAPITeamsParams) WithTimeout(timeout time.Duration) *PostAPITeamsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API teams params
|
||||
func (o *PostAPITeamsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API teams params
|
||||
func (o *PostAPITeamsParams) WithContext(ctx context.Context) *PostAPITeamsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API teams params
|
||||
func (o *PostAPITeamsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API teams params
|
||||
func (o *PostAPITeamsParams) WithHTTPClient(client *http.Client) *PostAPITeamsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API teams params
|
||||
func (o *PostAPITeamsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API teams params
|
||||
func (o *PostAPITeamsParams) WithBody(body *models.TeamEditForm) *PostAPITeamsParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API teams params
|
||||
func (o *PostAPITeamsParams) SetBody(body *models.TeamEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPITeamsParams) 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/team/post_api_teams_responses.go
Normal file
98
client/team/post_api_teams_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PostAPITeamsReader is a Reader for the PostAPITeams structure.
|
||||
type PostAPITeamsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPITeamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPITeamsOK()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPITeamsOK creates a PostAPITeamsOK with default headers values
|
||||
func NewPostAPITeamsOK() *PostAPITeamsOK {
|
||||
return &PostAPITeamsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created team
|
||||
*/
|
||||
type PostAPITeamsOK struct {
|
||||
Payload *models.Team
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api teams o k response has a 2xx status code
|
||||
func (o *PostAPITeamsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api teams o k response has a 3xx status code
|
||||
func (o *PostAPITeamsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api teams o k response has a 4xx status code
|
||||
func (o *PostAPITeamsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api teams o k response has a 5xx status code
|
||||
func (o *PostAPITeamsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api teams o k response a status code equal to that given
|
||||
func (o *PostAPITeamsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/teams][%d] postApiTeamsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/teams][%d] postApiTeamsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsOK) GetPayload() *models.Team {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPITeamsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Team)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
576
client/team/team_client.go
Normal file
576
client/team/team_client.go
Normal file
@ -0,0 +1,576 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package team
|
||||
|
||||
// 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 team API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for team 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 {
|
||||
DeleteAPITeamsID(params *DeleteAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDNoContent, error)
|
||||
|
||||
DeleteAPITeamsIDActivitiesActivityID(params *DeleteAPITeamsIDActivitiesActivityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDActivitiesActivityIDOK, error)
|
||||
|
||||
DeleteAPITeamsIDCustomersCustomerID(params *DeleteAPITeamsIDCustomersCustomerIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDCustomersCustomerIDOK, error)
|
||||
|
||||
DeleteAPITeamsIDMembersUserID(params *DeleteAPITeamsIDMembersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDMembersUserIDOK, error)
|
||||
|
||||
DeleteAPITeamsIDProjectsProjectID(params *DeleteAPITeamsIDProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDProjectsProjectIDOK, error)
|
||||
|
||||
GetAPITeams(params *GetAPITeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITeamsOK, error)
|
||||
|
||||
GetAPITeamsID(params *GetAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITeamsIDOK, error)
|
||||
|
||||
PatchAPITeamsID(params *PatchAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITeamsIDOK, error)
|
||||
|
||||
PostAPITeams(params *PostAPITeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsOK, error)
|
||||
|
||||
PostAPITeamsIDActivitiesActivityID(params *PostAPITeamsIDActivitiesActivityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDActivitiesActivityIDOK, error)
|
||||
|
||||
PostAPITeamsIDCustomersCustomerID(params *PostAPITeamsIDCustomersCustomerIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDCustomersCustomerIDOK, error)
|
||||
|
||||
PostAPITeamsIDMembersUserID(params *PostAPITeamsIDMembersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDMembersUserIDOK, error)
|
||||
|
||||
PostAPITeamsIDProjectsProjectID(params *PostAPITeamsIDProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDProjectsProjectIDOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsID deletes a team
|
||||
*/
|
||||
func (a *Client) DeleteAPITeamsID(params *DeleteAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITeamsIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITeamsID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/teams/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITeamsIDReader{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.(*DeleteAPITeamsIDNoContent)
|
||||
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 DeleteAPITeamsID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDActivitiesActivityID revokes access for an activity from a team
|
||||
*/
|
||||
func (a *Client) DeleteAPITeamsIDActivitiesActivityID(params *DeleteAPITeamsIDActivitiesActivityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDActivitiesActivityIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITeamsIDActivitiesActivityIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITeamsIDActivitiesActivityID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/teams/{id}/activities/{activityId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITeamsIDActivitiesActivityIDReader{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.(*DeleteAPITeamsIDActivitiesActivityIDOK)
|
||||
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 DeleteAPITeamsIDActivitiesActivityID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDCustomersCustomerID revokes access for a customer from a team
|
||||
*/
|
||||
func (a *Client) DeleteAPITeamsIDCustomersCustomerID(params *DeleteAPITeamsIDCustomersCustomerIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDCustomersCustomerIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITeamsIDCustomersCustomerIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITeamsIDCustomersCustomerID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/teams/{id}/customers/{customerId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITeamsIDCustomersCustomerIDReader{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.(*DeleteAPITeamsIDCustomersCustomerIDOK)
|
||||
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 DeleteAPITeamsIDCustomersCustomerID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDMembersUserID removes a member from the team
|
||||
*/
|
||||
func (a *Client) DeleteAPITeamsIDMembersUserID(params *DeleteAPITeamsIDMembersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDMembersUserIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITeamsIDMembersUserIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITeamsIDMembersUserID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/teams/{id}/members/{userId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITeamsIDMembersUserIDReader{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.(*DeleteAPITeamsIDMembersUserIDOK)
|
||||
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 DeleteAPITeamsIDMembersUserID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPITeamsIDProjectsProjectID revokes access for a project from a team
|
||||
*/
|
||||
func (a *Client) DeleteAPITeamsIDProjectsProjectID(params *DeleteAPITeamsIDProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPITeamsIDProjectsProjectIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPITeamsIDProjectsProjectIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPITeamsIDProjectsProjectID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/teams/{id}/projects/{projectId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPITeamsIDProjectsProjectIDReader{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.(*DeleteAPITeamsIDProjectsProjectIDOK)
|
||||
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 DeleteAPITeamsIDProjectsProjectID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeams fetches all existing teams
|
||||
*/
|
||||
func (a *Client) GetAPITeams(params *GetAPITeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITeamsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPITeamsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPITeams",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/teams",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPITeamsReader{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.(*GetAPITeamsOK)
|
||||
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 GetAPITeams: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPITeamsID returns one team
|
||||
*/
|
||||
func (a *Client) GetAPITeamsID(params *GetAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPITeamsIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPITeamsIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPITeamsID",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/teams/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPITeamsIDReader{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.(*GetAPITeamsIDOK)
|
||||
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 GetAPITeamsID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPITeamsID updates an existing team
|
||||
|
||||
Update an existing team, you can pass all or just a subset of all attributes (passing members will replace all existing ones)
|
||||
*/
|
||||
func (a *Client) PatchAPITeamsID(params *PatchAPITeamsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPITeamsIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPITeamsIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPITeamsID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/teams/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPITeamsIDReader{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.(*PatchAPITeamsIDOK)
|
||||
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 PatchAPITeamsID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeams creates a new team
|
||||
|
||||
Creates a new team and returns it afterwards
|
||||
*/
|
||||
func (a *Client) PostAPITeams(params *PostAPITeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITeamsParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITeams",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/teams",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITeamsReader{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.(*PostAPITeamsOK)
|
||||
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 PostAPITeams: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDActivitiesActivityID grants the team access to an activity
|
||||
*/
|
||||
func (a *Client) PostAPITeamsIDActivitiesActivityID(params *PostAPITeamsIDActivitiesActivityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDActivitiesActivityIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITeamsIDActivitiesActivityIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITeamsIDActivitiesActivityID",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/teams/{id}/activities/{activityId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITeamsIDActivitiesActivityIDReader{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.(*PostAPITeamsIDActivitiesActivityIDOK)
|
||||
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 PostAPITeamsIDActivitiesActivityID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDCustomersCustomerID grants the team access to a customer
|
||||
*/
|
||||
func (a *Client) PostAPITeamsIDCustomersCustomerID(params *PostAPITeamsIDCustomersCustomerIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDCustomersCustomerIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITeamsIDCustomersCustomerIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITeamsIDCustomersCustomerID",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/teams/{id}/customers/{customerId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITeamsIDCustomersCustomerIDReader{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.(*PostAPITeamsIDCustomersCustomerIDOK)
|
||||
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 PostAPITeamsIDCustomersCustomerID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDMembersUserID adds a new member to a team
|
||||
*/
|
||||
func (a *Client) PostAPITeamsIDMembersUserID(params *PostAPITeamsIDMembersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDMembersUserIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITeamsIDMembersUserIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITeamsIDMembersUserID",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/teams/{id}/members/{userId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITeamsIDMembersUserIDReader{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.(*PostAPITeamsIDMembersUserIDOK)
|
||||
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 PostAPITeamsIDMembersUserID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPITeamsIDProjectsProjectID grants the team access to a project
|
||||
*/
|
||||
func (a *Client) PostAPITeamsIDProjectsProjectID(params *PostAPITeamsIDProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPITeamsIDProjectsProjectIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPITeamsIDProjectsProjectIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPITeamsIDProjectsProjectID",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/teams/{id}/projects/{projectId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPITeamsIDProjectsProjectIDReader{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.(*PostAPITeamsIDProjectsProjectIDOK)
|
||||
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 PostAPITeamsIDProjectsProjectID: 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