func (c DirectScriptsAPI) CreateScript(options CreateScriptOptions) (script testkube.Script, err error) {
	uri := c.getURI("/scripts")
	request := testkube.ScriptCreateRequest(options)
	body, err := json.Marshal(request)
	if err != nil {
		return script, err
	}
	resp, err := c.client.Post(uri, "application/json", bytes.NewReader(body))
	if err != nil {
		return script, err
	}
	if err := c.responseError(resp); err != nil {
		return script, fmt.Errorf("api/create-script returned error: %w", err)
	}
	return c.getScriptFromResponse(resp)
}
CreateScript creates new Script Custom Resource
package client
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"time"
	"github.com/kelseyhightower/envconfig"
	"github.com/kubeshop/testkube/pkg/api/v1/testkube"
	"github.com/kubeshop/testkube/pkg/problem"
)
const (
	ClientHTTPTimeout = time.Minute
)
type Config struct {
	URI string `default:"http://localhost:8088"`
}
var config Config
func init() {
	envconfig.Process("TESTKUBE_API", &config)
}
func NewDirectScriptsAPI(uri string) DirectScriptsAPI {
	return DirectScriptsAPI{
		URI: uri,
		client: &http.Client{
			Timeout: ClientHTTPTimeout,
		},
	}
}
func NewDefaultDirectScriptsAPI() DirectScriptsAPI {
	return NewDirectScriptsAPI(config.URI)
}
type DirectScriptsAPI struct {
	URI    string
	client HTTPClient
}
func (c DirectScriptsAPI) GetScript(id string) (script testkube.Script, err error) {
	uri := c.getURI("/scripts/%s", id)
	resp, err := c.client.Get(uri)
	if err != nil {
		return script, err
	}
	if err := c.responseError(resp); err != nil {
		return script, fmt.Errorf("api/get-script returned error: %w", err)
	}
	return c.getScriptFromResponse(resp)
}
func (c DirectScriptsAPI) GetExecution(scriptID, executionID string) (execution testkube.Execution, err error) {
	uri := c.getURI("/scripts/%s/executions/%s", scriptID, executionID)
	resp, err := c.client.Get(uri)
	if err != nil {
		return execution, err
	}
	if err := c.responseError(resp); err != nil {
		return execution, fmt.Errorf("api/get-execution returned error: %w", err)
	}
	return c.getExecutionFromResponse(resp)
}
func (c DirectScriptsAPI) ListExecutions(scriptID string) (executions testkube.ExecutionsResult, err error) {
	uri := c.getURI("/scripts/%s/executions", scriptID)
	resp, err := c.client.Get(uri)
	if err != nil {
		return executions, err
	}
	if err := c.responseError(resp); err != nil {
		return executions, fmt.Errorf("api/get-executions returned error: %w", err)
	}
	return c.getExecutionsFromResponse(resp)
}