feat: resource rows batch operations, drop removed domains, regenerated models
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
package rudder
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ModulesService struct {
|
||||
transport *transport
|
||||
}
|
||||
|
||||
type CallParameters struct {
|
||||
Module string
|
||||
Fn string
|
||||
Args any
|
||||
DryRun bool
|
||||
}
|
||||
|
||||
type CallResult struct {
|
||||
Result any `json:"result"`
|
||||
Error string `json:"error"`
|
||||
Log []any `json:"log"`
|
||||
Console []string `json:"console"`
|
||||
}
|
||||
|
||||
func (s *ModulesService) Call(ctx context.Context, parameters CallParameters) (*CallResult, error) {
|
||||
var result CallResult
|
||||
path := fmt.Sprintf("/modules/%s/%s", parameters.Module, parameters.Fn)
|
||||
body := map[string]any{"args": parameters.Args, "dryRun": parameters.DryRun}
|
||||
if err := s.transport.do(ctx, http.MethodPost, path, nil, body, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user