You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
150 lines
4.3 KiB
150 lines
4.3 KiB
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package event_management
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
//go:generate mockery -name API -inpkg
|
|
|
|
// API is the interface of the event management client
|
|
type API interface {
|
|
/*
|
|
AddEvent takes into the system the provided event*/
|
|
AddEvent(ctx context.Context, params *AddEventParams) (*AddEventCreated, error)
|
|
/*
|
|
GetHistory provides the events for the id provided*/
|
|
GetHistory(ctx context.Context, params *GetHistoryParams) (*GetHistoryOK, error)
|
|
/*
|
|
GetState provides the events for the id provided*/
|
|
GetState(ctx context.Context, params *GetStateParams) (*GetStateOK, error)
|
|
/*
|
|
ListStates provides the list of states in not terminated state*/
|
|
ListStates(ctx context.Context, params *ListStatesParams) (*ListStatesOK, error)
|
|
}
|
|
|
|
// New creates a new event management API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client {
|
|
return &Client{
|
|
transport: transport,
|
|
formats: formats,
|
|
authInfo: authInfo,
|
|
}
|
|
}
|
|
|
|
/*
|
|
Client for event management API
|
|
*/
|
|
type Client struct {
|
|
transport runtime.ClientTransport
|
|
formats strfmt.Registry
|
|
authInfo runtime.ClientAuthInfoWriter
|
|
}
|
|
|
|
/*
|
|
AddEvent takes into the system the provided event
|
|
*/
|
|
func (a *Client) AddEvent(ctx context.Context, params *AddEventParams) (*AddEventCreated, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "addEvent",
|
|
Method: "POST",
|
|
PathPattern: "/event",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &AddEventReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*AddEventCreated), nil
|
|
|
|
}
|
|
|
|
/*
|
|
GetHistory provides the events for the id provided
|
|
*/
|
|
func (a *Client) GetHistory(ctx context.Context, params *GetHistoryParams) (*GetHistoryOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "getHistory",
|
|
Method: "GET",
|
|
PathPattern: "/event/history/{account}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &GetHistoryReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*GetHistoryOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
GetState provides the events for the id provided
|
|
*/
|
|
func (a *Client) GetState(ctx context.Context, params *GetStateParams) (*GetStateOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "getState",
|
|
Method: "GET",
|
|
PathPattern: "/event/status/{account}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &GetStateReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*GetStateOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
ListStates provides the list of states in not terminated state
|
|
*/
|
|
func (a *Client) ListStates(ctx context.Context, params *ListStatesParams) (*ListStatesOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "listStates",
|
|
Method: "GET",
|
|
PathPattern: "/event/status",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &ListStatesReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*ListStatesOK), nil
|
|
|
|
}
|
|
|