go-kimai/client/team/team_client.go
2023-01-14 22:44:16 +01:00

577 lines
22 KiB
Go

// 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
}