mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
Release catalyst
This commit is contained in:
28
service/automation.go
Normal file
28
service/automation.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst/generated/restapi/api"
|
||||
"github.com/SecurityBrewery/catalyst/generated/restapi/operations/automations"
|
||||
)
|
||||
|
||||
func (s *Service) CreateAutomation(ctx context.Context, params *automations.CreateAutomationParams) *api.Response {
|
||||
return response(s.database.AutomationCreate(ctx, params.Automation))
|
||||
}
|
||||
|
||||
func (s *Service) GetAutomation(ctx context.Context, params *automations.GetAutomationParams) *api.Response {
|
||||
return response(s.database.AutomationGet(ctx, params.ID))
|
||||
}
|
||||
|
||||
func (s *Service) UpdateAutomation(ctx context.Context, params *automations.UpdateAutomationParams) *api.Response {
|
||||
return response(s.database.AutomationUpdate(ctx, params.ID, params.Automation))
|
||||
}
|
||||
|
||||
func (s *Service) DeleteAutomation(ctx context.Context, params *automations.DeleteAutomationParams) *api.Response {
|
||||
return response(nil, s.database.AutomationDelete(ctx, params.ID))
|
||||
}
|
||||
|
||||
func (s *Service) ListAutomations(ctx context.Context) *api.Response {
|
||||
return response(s.database.AutomationList(ctx))
|
||||
}
|
||||
Reference in New Issue
Block a user