Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package worker provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCheckWorkersLivenessRequest

func NewCheckWorkersLivenessRequest(server string) (*http.Request, error)

NewCheckWorkersLivenessRequest constructs an http.Request for the CheckWorkersLiveness method

func NewCheckWorkersReadinessRequest

func NewCheckWorkersReadinessRequest(server string) (*http.Request, error)

NewCheckWorkersReadinessRequest constructs an http.Request for the CheckWorkersReadiness method

func NewCreateWorkerRequest

func NewCreateWorkerRequest(server string, params *CreateWorkerParams, body CreateWorkerJSONRequestBody) (*http.Request, error)

NewCreateWorkerRequest calls the generic CreateWorker builder with application/json body

func NewCreateWorkerRequestWithBody

func NewCreateWorkerRequestWithBody(server string, params *CreateWorkerParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateWorkerRequestWithBody constructs an http.Request for the CreateWorker method, with any body, and a specified content type

func NewDeleteWorkerRequest

func NewDeleteWorkerRequest(server string, workerKey string) (*http.Request, error)

NewDeleteWorkerRequest constructs an http.Request for the DeleteWorker method

func NewExecuteHttpTriggeredWorkerRequest

func NewExecuteHttpTriggeredWorkerRequest(server string, workerKey string, body ExecuteHttpTriggeredWorkerJSONRequestBody) (*http.Request, error)

NewExecuteHttpTriggeredWorkerRequest calls the generic ExecuteHttpTriggeredWorker builder with application/json body

func NewExecuteHttpTriggeredWorkerRequestWithBody

func NewExecuteHttpTriggeredWorkerRequestWithBody(server string, workerKey string, contentType string, body io.Reader) (*http.Request, error)

NewExecuteHttpTriggeredWorkerRequestWithBody constructs an http.Request for the ExecuteHttpTriggeredWorker method, with any body, and a specified content type

func NewExecuteWorkerTestGenericRequest

func NewExecuteWorkerTestGenericRequest(server string, params *ExecuteWorkerTestGenericParams, body ExecuteWorkerTestGenericJSONRequestBody) (*http.Request, error)

NewExecuteWorkerTestGenericRequest calls the generic ExecuteWorkerTestGeneric builder with application/json body

func NewExecuteWorkerTestGenericRequestWithBody

func NewExecuteWorkerTestGenericRequestWithBody(server string, params *ExecuteWorkerTestGenericParams, contentType string, body io.Reader) (*http.Request, error)

NewExecuteWorkerTestGenericRequestWithBody constructs an http.Request for the ExecuteWorkerTestGeneric method, with any body, and a specified content type

func NewExecuteWorkerTestRequest

func NewExecuteWorkerTestRequest(server string, workerKey string, params *ExecuteWorkerTestParams, body ExecuteWorkerTestJSONRequestBody) (*http.Request, error)

NewExecuteWorkerTestRequest calls the generic ExecuteWorkerTest builder with application/json body

func NewExecuteWorkerTestRequestWithBody

func NewExecuteWorkerTestRequestWithBody(server string, workerKey string, params *ExecuteWorkerTestParams, contentType string, body io.Reader) (*http.Request, error)

NewExecuteWorkerTestRequestWithBody constructs an http.Request for the ExecuteWorkerTest method, with any body, and a specified content type

func NewGetWorkerActionsMetadataRequest

func NewGetWorkerActionsMetadataRequest(server string, params *GetWorkerActionsMetadataParams) (*http.Request, error)

NewGetWorkerActionsMetadataRequest constructs an http.Request for the GetWorkerActionsMetadata method

func NewGetWorkerActionsRequest

func NewGetWorkerActionsRequest(server string) (*http.Request, error)

NewGetWorkerActionsRequest constructs an http.Request for the GetWorkerActions method

func NewGetWorkerExecutionHistoryRequest

func NewGetWorkerExecutionHistoryRequest(server string, params *GetWorkerExecutionHistoryParams) (*http.Request, error)

NewGetWorkerExecutionHistoryRequest constructs an http.Request for the GetWorkerExecutionHistory method

func NewGetWorkerRequest

func NewGetWorkerRequest(server string, workerKey string) (*http.Request, error)

NewGetWorkerRequest constructs an http.Request for the GetWorker method

func NewGetWorkerScaffoldTsConfigRequest

func NewGetWorkerScaffoldTsConfigRequest(server string, params *GetWorkerScaffoldTsConfigParams) (*http.Request, error)

NewGetWorkerScaffoldTsConfigRequest constructs an http.Request for the GetWorkerScaffoldTsConfig method

func NewGetWorkersRequest

func NewGetWorkersRequest(server string) (*http.Request, error)

NewGetWorkersRequest constructs an http.Request for the GetWorkers method

func NewRerunWorkerRequest

func NewRerunWorkerRequest(server string, workerKey string, params *RerunWorkerParams, body RerunWorkerJSONRequestBody) (*http.Request, error)

NewRerunWorkerRequest calls the generic RerunWorker builder with application/json body

func NewRerunWorkerRequestWithBody

func NewRerunWorkerRequestWithBody(server string, workerKey string, params *RerunWorkerParams, contentType string, body io.Reader) (*http.Request, error)

NewRerunWorkerRequestWithBody constructs an http.Request for the RerunWorker method, with any body, and a specified content type

func NewUpdateWorkerRequest

func NewUpdateWorkerRequest(server string, body UpdateWorkerJSONRequestBody) (*http.Request, error)

NewUpdateWorkerRequest calls the generic UpdateWorker builder with application/json body

func NewUpdateWorkerRequestWithBody

func NewUpdateWorkerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateWorkerRequestWithBody constructs an http.Request for the UpdateWorker method, with any body, and a specified content type

Types

type ActionMetadata

type ActionMetadata struct {
	// Action Optional within this object. Identity of the action.
	Action *struct {
		// Application Optional within this object. Service that raises the action, such as `artifactory` or `access`.
		Application *string `json:"application,omitempty"`

		// Name Optional within this object. Action name, one of the values accepted by action on create.
		Name *string `json:"name,omitempty"`
	} `json:"action,omitempty"`

	// Async Optional within this object. True for actions that run after the operation has committed (the AFTER_ actions and SCHEDULED_EVENT), which cannot change its outcome.
	Async *bool `json:"async,omitempty"`

	// Description Optional within this object. What the action is for.
	Description *string `json:"description,omitempty"`

	// ExecutionRequestType Optional within this object. Name of the input type in typesDefinitions, such as BeforeDownloadRequest.
	ExecutionRequestType *string `json:"executionRequestType,omitempty"`

	// FilterType Optional within this object. Which filterCriteria member applies: FILTER_REPO for artifactFilterCriteria, SCHEDULE for schedule. Absent for actions that take no filter.
	FilterType *ActionMetadataFilterType `json:"filterType,omitempty"`

	// MandatoryFilter Optional within this object. When true the action requires the filterCriteria member named by filterType; when absent or false the action rejects a filter.
	MandatoryFilter *bool `json:"mandatoryFilter,omitempty"`

	// RequestSchema Optional within this object. JSON schema of the input as text, when available.
	RequestSchema *string `json:"requestSchema,omitempty"`

	// SampleCode Optional within this object. Example worker script.
	SampleCode *string `json:"sampleCode,omitempty"`

	// SamplePayload Optional within this object. Example input as JSON text.
	SamplePayload *string `json:"samplePayload,omitempty"`

	// SupportProjects Optional within this object. Whether project administrators may create workers for this action.
	SupportProjects *bool `json:"supportProjects,omitempty"`

	// TypesDefinitions Optional within this object. TypeScript declarations of the input and result types. Status enums are numeric (for example DOWNLOAD_PROCEED = 1); workers may return either the number or the member name as a string; both are accepted.
	TypesDefinitions *string `json:"typesDefinitions,omitempty"`

	// WikiUrl Optional within this object. Link to documentation for the action.
	WikiUrl *string `json:"wikiUrl,omitempty"`
}

ActionMetadata Everything needed to write a worker for one action.

type ActionMetadataFilterType

type ActionMetadataFilterType string

ActionMetadataFilterType Optional within this object. Which filterCriteria member applies: FILTER_REPO for artifactFilterCriteria, SCHEDULE for schedule. Absent for actions that take no filter.

const (
	FILTERREPO ActionMetadataFilterType = "FILTER_REPO"
	SCHEDULE   ActionMetadataFilterType = "SCHEDULE"
)

Defines values for ActionMetadataFilterType.

func (ActionMetadataFilterType) Valid

func (e ActionMetadataFilterType) Valid() bool

Valid indicates whether the value is a known member of the ActionMetadataFilterType enum.

type CheckWorkersLivenessResponse

type CheckWorkersLivenessResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseCheckWorkersLivenessResponse

func ParseCheckWorkersLivenessResponse(rsp *http.Response) (*CheckWorkersLivenessResponse, error)

ParseCheckWorkersLivenessResponse parses an HTTP response from a CheckWorkersLivenessWithResponse call

func (CheckWorkersLivenessResponse) ContentType

func (r CheckWorkersLivenessResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CheckWorkersLivenessResponse) GetBody

func (r CheckWorkersLivenessResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CheckWorkersLivenessResponse) Status

Status returns HTTPResponse.Status

func (CheckWorkersLivenessResponse) StatusCode

func (r CheckWorkersLivenessResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CheckWorkersReadinessResponse

type CheckWorkersReadinessResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseCheckWorkersReadinessResponse

func ParseCheckWorkersReadinessResponse(rsp *http.Response) (*CheckWorkersReadinessResponse, error)

ParseCheckWorkersReadinessResponse parses an HTTP response from a CheckWorkersReadinessWithResponse call

func (CheckWorkersReadinessResponse) ContentType

func (r CheckWorkersReadinessResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CheckWorkersReadinessResponse) GetBody

func (r CheckWorkersReadinessResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CheckWorkersReadinessResponse) Status

Status returns HTTPResponse.Status

func (CheckWorkersReadinessResponse) StatusCode

func (r CheckWorkersReadinessResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CheckWorkersLiveness

func (c *Client) CheckWorkersLiveness(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

CheckWorkersLiveness Workers liveness

Answers when the Workers service is running. No authentication. The service is part of the single process, so this mirrors the process liveness probe.

Corresponds with GET /api/v1/system/liveness (the `CheckWorkersLiveness` operationId).

func (*Client) CheckWorkersReadiness

func (c *Client) CheckWorkersReadiness(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

CheckWorkersReadiness Workers readiness

Answers when the Workers service can run workers. No authentication.

Corresponds with GET /api/v1/system/readiness (the `CheckWorkersReadiness` operationId).

func (*Client) CreateWorker

func (c *Client) CreateWorker(ctx context.Context, params *CreateWorkerParams, body CreateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWorker Create a worker

Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.

Takes a body of the `application/json` content type.

Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).

func (*Client) CreateWorkerWithBody

func (c *Client) CreateWorkerWithBody(ctx context.Context, params *CreateWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWorkerWithBody Create a worker

Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.

Takes any type of body and a specified content type.

Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).

func (*Client) DeleteWorker

func (c *Client) DeleteWorker(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteWorker Delete a worker

Deletes a worker; its recorded executions are removed with it. Platform administrators only.

Corresponds with DELETE /api/v1/workers/{workerKey} (the `DeleteWorker` operationId).

func (*Client) ExecuteHttpTriggeredWorker

func (c *Client) ExecuteHttpTriggeredWorker(ctx context.Context, workerKey string, body ExecuteHttpTriggeredWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteHttpTriggeredWorker Execute a worker

Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

Takes a body of the `application/json` content type.

Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).

func (*Client) ExecuteHttpTriggeredWorkerWithBody

func (c *Client) ExecuteHttpTriggeredWorkerWithBody(ctx context.Context, workerKey string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteHttpTriggeredWorkerWithBody Execute a worker

Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

Takes any type of body and a specified content type.

Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).

func (*Client) ExecuteWorkerTest

func (c *Client) ExecuteWorkerTest(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, body ExecuteWorkerTestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteWorkerTest Test a saved worker

Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.

Takes a body of the `application/json` content type.

Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).

func (*Client) ExecuteWorkerTestGeneric

func (c *Client) ExecuteWorkerTestGeneric(ctx context.Context, params *ExecuteWorkerTestGenericParams, body ExecuteWorkerTestGenericJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteWorkerTestGeneric Test an unsaved script

Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Takes a body of the `application/json` content type.

Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).

func (*Client) ExecuteWorkerTestGenericWithBody

func (c *Client) ExecuteWorkerTestGenericWithBody(ctx context.Context, params *ExecuteWorkerTestGenericParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteWorkerTestGenericWithBody Test an unsaved script

Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Takes any type of body and a specified content type.

Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).

func (*Client) ExecuteWorkerTestWithBody

func (c *Client) ExecuteWorkerTestWithBody(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ExecuteWorkerTestWithBody Test a saved worker

Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.

Takes any type of body and a specified content type.

Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).

func (*Client) GetWorker

func (c *Client) GetWorker(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorker Get a worker

Returns one worker, including its script. Platform administrators only.

Corresponds with GET /api/v1/workers/{workerKey} (the `GetWorker` operationId).

func (*Client) GetWorkerActions

func (c *Client) GetWorkerActions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorkerActions List action names

Returns the names of the actions this instance can trigger. Platform administrators only.

Corresponds with GET /api/v1/actions (the `GetWorkerActions` operationId).

func (*Client) GetWorkerActionsMetadata

func (c *Client) GetWorkerActionsMetadata(ctx context.Context, params *GetWorkerActionsMetadataParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorkerActionsMetadata Describe the actions

Returns the metadata of each action this instance can trigger: sample input, TypeScript types, filter rules and sample code. Platform administrators, or project administrators with projectKey.

Corresponds with GET /api/v2/actions (the `GetWorkerActionsMetadata` operationId).

func (*Client) GetWorkerExecutionHistory

func (c *Client) GetWorkerExecutionHistory(ctx context.Context, params *GetWorkerExecutionHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorkerExecutionHistory List recorded executions

Returns recorded executions, newest first. Successful runs are recorded only for workers with debug true; failures, including runs stopped by a limit, always are, with errorCode set. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Corresponds with GET /api/v1/execution_history (the `GetWorkerExecutionHistory` operationId).

func (*Client) GetWorkerScaffoldTsConfig

func (c *Client) GetWorkerScaffoldTsConfig(ctx context.Context, params *GetWorkerScaffoldTsConfigParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorkerScaffoldTsConfig Get the TypeScript settings

Returns the TypeScript configuration worker scripts are compiled with. Platform administrators, or project administrators with projectKey.

Corresponds with GET /api/v1/scaffold/tsconfig (the `GetWorkerScaffoldTsConfig` operationId).

func (*Client) GetWorkers

func (c *Client) GetWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWorkers List workers

Returns every worker. Platform administrators only.

Corresponds with GET /api/v1/workers (the `GetWorkers` operationId).

func (*Client) RerunWorker

func (c *Client) RerunWorker(ctx context.Context, workerKey string, params *RerunWorkerParams, body RerunWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

RerunWorker Rerun a recorded execution

Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.

Takes a body of the `application/json` content type.

Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).

func (*Client) RerunWorkerWithBody

func (c *Client) RerunWorkerWithBody(ctx context.Context, workerKey string, params *RerunWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

RerunWorkerWithBody Rerun a recorded execution

Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.

Takes any type of body and a specified content type.

Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).

func (*Client) UpdateWorker

func (c *Client) UpdateWorker(ctx context.Context, body UpdateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateWorker Update a worker

Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.

Takes a body of the `application/json` content type.

Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).

func (*Client) UpdateWorkerWithBody

func (c *Client) UpdateWorkerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateWorkerWithBody Update a worker

Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.

Takes any type of body and a specified content type.

Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).

type ClientInterface

type ClientInterface interface {

	// GetWorkerActions List action names
	//
	// Returns the names of the actions this instance can trigger. Platform administrators only.
	//
	// Corresponds with GET /api/v1/actions (the `GetWorkerActions` operationId).
	GetWorkerActions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteHttpTriggeredWorkerWithBody Execute a worker
	//
	// Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).
	ExecuteHttpTriggeredWorkerWithBody(ctx context.Context, workerKey string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteHttpTriggeredWorker Execute a worker
	//
	// Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).
	ExecuteHttpTriggeredWorker(ctx context.Context, workerKey string, body ExecuteHttpTriggeredWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWorkerExecutionHistory List recorded executions
	//
	// Returns recorded executions, newest first. Successful runs are recorded only for workers with debug true; failures, including runs stopped by a limit, always are, with errorCode set. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Corresponds with GET /api/v1/execution_history (the `GetWorkerExecutionHistory` operationId).
	GetWorkerExecutionHistory(ctx context.Context, params *GetWorkerExecutionHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RerunWorkerWithBody Rerun a recorded execution
	//
	// Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).
	RerunWorkerWithBody(ctx context.Context, workerKey string, params *RerunWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RerunWorker Rerun a recorded execution
	//
	// Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).
	RerunWorker(ctx context.Context, workerKey string, params *RerunWorkerParams, body RerunWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWorkerScaffoldTsConfig Get the TypeScript settings
	//
	// Returns the TypeScript configuration worker scripts are compiled with. Platform administrators, or project administrators with projectKey.
	//
	// Corresponds with GET /api/v1/scaffold/tsconfig (the `GetWorkerScaffoldTsConfig` operationId).
	GetWorkerScaffoldTsConfig(ctx context.Context, params *GetWorkerScaffoldTsConfigParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CheckWorkersLiveness Workers liveness
	//
	// Answers when the Workers service is running. No authentication. The service is part of the single process, so this mirrors the process liveness probe.
	//
	// Corresponds with GET /api/v1/system/liveness (the `CheckWorkersLiveness` operationId).
	CheckWorkersLiveness(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CheckWorkersReadiness Workers readiness
	//
	// Answers when the Workers service can run workers. No authentication.
	//
	// Corresponds with GET /api/v1/system/readiness (the `CheckWorkersReadiness` operationId).
	CheckWorkersReadiness(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteWorkerTestGenericWithBody Test an unsaved script
	//
	// Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).
	ExecuteWorkerTestGenericWithBody(ctx context.Context, params *ExecuteWorkerTestGenericParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteWorkerTestGeneric Test an unsaved script
	//
	// Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).
	ExecuteWorkerTestGeneric(ctx context.Context, params *ExecuteWorkerTestGenericParams, body ExecuteWorkerTestGenericJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteWorkerTestWithBody Test a saved worker
	//
	// Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).
	ExecuteWorkerTestWithBody(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExecuteWorkerTest Test a saved worker
	//
	// Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).
	ExecuteWorkerTest(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, body ExecuteWorkerTestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWorkers List workers
	//
	// Returns every worker. Platform administrators only.
	//
	// Corresponds with GET /api/v1/workers (the `GetWorkers` operationId).
	GetWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWorkerWithBody Create a worker
	//
	// Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).
	CreateWorkerWithBody(ctx context.Context, params *CreateWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWorker Create a worker
	//
	// Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).
	CreateWorker(ctx context.Context, params *CreateWorkerParams, body CreateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateWorkerWithBody Update a worker
	//
	// Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).
	UpdateWorkerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateWorker Update a worker
	//
	// Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).
	UpdateWorker(ctx context.Context, body UpdateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteWorker Delete a worker
	//
	// Deletes a worker; its recorded executions are removed with it. Platform administrators only.
	//
	// Corresponds with DELETE /api/v1/workers/{workerKey} (the `DeleteWorker` operationId).
	DeleteWorker(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWorker Get a worker
	//
	// Returns one worker, including its script. Platform administrators only.
	//
	// Corresponds with GET /api/v1/workers/{workerKey} (the `GetWorker` operationId).
	GetWorker(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWorkerActionsMetadata Describe the actions
	//
	// Returns the metadata of each action this instance can trigger: sample input, TypeScript types, filter rules and sample code. Platform administrators, or project administrators with projectKey.
	//
	// Corresponds with GET /api/v2/actions (the `GetWorkerActionsMetadata` operationId).
	GetWorkerActionsMetadata(ctx context.Context, params *GetWorkerActionsMetadataParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CheckWorkersLivenessWithResponse

func (c *ClientWithResponses) CheckWorkersLivenessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CheckWorkersLivenessResponse, error)

CheckWorkersLivenessWithResponse Workers liveness

Answers when the Workers service is running. No authentication. The service is part of the single process, so this mirrors the process liveness probe.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/system/liveness (the `CheckWorkersLiveness` operationId).

func (*ClientWithResponses) CheckWorkersReadinessWithResponse

func (c *ClientWithResponses) CheckWorkersReadinessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CheckWorkersReadinessResponse, error)

CheckWorkersReadinessWithResponse Workers readiness

Answers when the Workers service can run workers. No authentication.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/system/readiness (the `CheckWorkersReadiness` operationId).

func (*ClientWithResponses) CreateWorkerWithBodyWithResponse

func (c *ClientWithResponses) CreateWorkerWithBodyWithResponse(ctx context.Context, params *CreateWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkerResponse, error)

CreateWorkerWithBodyWithResponse Create a worker

Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).

func (*ClientWithResponses) CreateWorkerWithResponse

func (c *ClientWithResponses) CreateWorkerWithResponse(ctx context.Context, params *CreateWorkerParams, body CreateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkerResponse, error)

CreateWorkerWithResponse Create a worker

Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).

func (*ClientWithResponses) DeleteWorkerWithResponse

func (c *ClientWithResponses) DeleteWorkerWithResponse(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*DeleteWorkerResponse, error)

DeleteWorkerWithResponse Delete a worker

Deletes a worker; its recorded executions are removed with it. Platform administrators only.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /api/v1/workers/{workerKey} (the `DeleteWorker` operationId).

func (*ClientWithResponses) ExecuteHttpTriggeredWorkerWithBodyWithResponse

func (c *ClientWithResponses) ExecuteHttpTriggeredWorkerWithBodyWithResponse(ctx context.Context, workerKey string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteHttpTriggeredWorkerResponse, error)

ExecuteHttpTriggeredWorkerWithBodyWithResponse Execute a worker

Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).

func (*ClientWithResponses) ExecuteHttpTriggeredWorkerWithResponse

func (c *ClientWithResponses) ExecuteHttpTriggeredWorkerWithResponse(ctx context.Context, workerKey string, body ExecuteHttpTriggeredWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*ExecuteHttpTriggeredWorkerResponse, error)

ExecuteHttpTriggeredWorkerWithResponse Execute a worker

Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).

func (*ClientWithResponses) ExecuteWorkerTestGenericWithBodyWithResponse

func (c *ClientWithResponses) ExecuteWorkerTestGenericWithBodyWithResponse(ctx context.Context, params *ExecuteWorkerTestGenericParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestGenericResponse, error)

ExecuteWorkerTestGenericWithBodyWithResponse Test an unsaved script

Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).

func (*ClientWithResponses) ExecuteWorkerTestGenericWithResponse

ExecuteWorkerTestGenericWithResponse Test an unsaved script

Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).

func (*ClientWithResponses) ExecuteWorkerTestWithBodyWithResponse

func (c *ClientWithResponses) ExecuteWorkerTestWithBodyWithResponse(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestResponse, error)

ExecuteWorkerTestWithBodyWithResponse Test a saved worker

Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).

func (*ClientWithResponses) ExecuteWorkerTestWithResponse

func (c *ClientWithResponses) ExecuteWorkerTestWithResponse(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, body ExecuteWorkerTestJSONRequestBody, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestResponse, error)

ExecuteWorkerTestWithResponse Test a saved worker

Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).

func (*ClientWithResponses) GetWorkerActionsMetadataWithResponse

func (c *ClientWithResponses) GetWorkerActionsMetadataWithResponse(ctx context.Context, params *GetWorkerActionsMetadataParams, reqEditors ...RequestEditorFn) (*GetWorkerActionsMetadataResponse, error)

GetWorkerActionsMetadataWithResponse Describe the actions

Returns the metadata of each action this instance can trigger: sample input, TypeScript types, filter rules and sample code. Platform administrators, or project administrators with projectKey.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v2/actions (the `GetWorkerActionsMetadata` operationId).

func (*ClientWithResponses) GetWorkerActionsWithResponse

func (c *ClientWithResponses) GetWorkerActionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetWorkerActionsResponse, error)

GetWorkerActionsWithResponse List action names

Returns the names of the actions this instance can trigger. Platform administrators only.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/actions (the `GetWorkerActions` operationId).

func (*ClientWithResponses) GetWorkerExecutionHistoryWithResponse

func (c *ClientWithResponses) GetWorkerExecutionHistoryWithResponse(ctx context.Context, params *GetWorkerExecutionHistoryParams, reqEditors ...RequestEditorFn) (*GetWorkerExecutionHistoryResponse, error)

GetWorkerExecutionHistoryWithResponse List recorded executions

Returns recorded executions, newest first. Successful runs are recorded only for workers with debug true; failures, including runs stopped by a limit, always are, with errorCode set. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/execution_history (the `GetWorkerExecutionHistory` operationId).

func (*ClientWithResponses) GetWorkerScaffoldTsConfigWithResponse

func (c *ClientWithResponses) GetWorkerScaffoldTsConfigWithResponse(ctx context.Context, params *GetWorkerScaffoldTsConfigParams, reqEditors ...RequestEditorFn) (*GetWorkerScaffoldTsConfigResponse, error)

GetWorkerScaffoldTsConfigWithResponse Get the TypeScript settings

Returns the TypeScript configuration worker scripts are compiled with. Platform administrators, or project administrators with projectKey.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/scaffold/tsconfig (the `GetWorkerScaffoldTsConfig` operationId).

func (*ClientWithResponses) GetWorkerWithResponse

func (c *ClientWithResponses) GetWorkerWithResponse(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*GetWorkerResponse, error)

GetWorkerWithResponse Get a worker

Returns one worker, including its script. Platform administrators only.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/workers/{workerKey} (the `GetWorker` operationId).

func (*ClientWithResponses) GetWorkersWithResponse

func (c *ClientWithResponses) GetWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetWorkersResponse, error)

GetWorkersWithResponse List workers

Returns every worker. Platform administrators only.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /api/v1/workers (the `GetWorkers` operationId).

func (*ClientWithResponses) RerunWorkerWithBodyWithResponse

func (c *ClientWithResponses) RerunWorkerWithBodyWithResponse(ctx context.Context, workerKey string, params *RerunWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunWorkerResponse, error)

RerunWorkerWithBodyWithResponse Rerun a recorded execution

Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).

func (*ClientWithResponses) RerunWorkerWithResponse

func (c *ClientWithResponses) RerunWorkerWithResponse(ctx context.Context, workerKey string, params *RerunWorkerParams, body RerunWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunWorkerResponse, error)

RerunWorkerWithResponse Rerun a recorded execution

Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).

func (*ClientWithResponses) UpdateWorkerWithBodyWithResponse

func (c *ClientWithResponses) UpdateWorkerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkerResponse, error)

UpdateWorkerWithBodyWithResponse Update a worker

Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).

func (*ClientWithResponses) UpdateWorkerWithResponse

func (c *ClientWithResponses) UpdateWorkerWithResponse(ctx context.Context, body UpdateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkerResponse, error)

UpdateWorkerWithResponse Update a worker

Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// GetWorkerActionsWithResponse List action names
	//
	// Returns the names of the actions this instance can trigger. Platform administrators only.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/actions (the `GetWorkerActions` operationId).
	GetWorkerActionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetWorkerActionsResponse, error)

	// ExecuteHttpTriggeredWorkerWithBodyWithResponse Execute a worker
	//
	// Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).
	ExecuteHttpTriggeredWorkerWithBodyWithResponse(ctx context.Context, workerKey string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteHttpTriggeredWorkerResponse, error)

	// ExecuteHttpTriggeredWorkerWithResponse Execute a worker
	//
	// Runs a GENERIC_EVENT worker synchronously with the given input and returns {data, executionStatus}. Administrators, or any authenticated user when the worker is shared. A worker for any other action is rejected with 400; a run that breaches a limit is terminated, recorded in the execution history with its errorCode, and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/execute/{workerKey} (the `ExecuteHttpTriggeredWorker` operationId).
	ExecuteHttpTriggeredWorkerWithResponse(ctx context.Context, workerKey string, body ExecuteHttpTriggeredWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*ExecuteHttpTriggeredWorkerResponse, error)

	// GetWorkerExecutionHistoryWithResponse List recorded executions
	//
	// Returns recorded executions, newest first. Successful runs are recorded only for workers with debug true; failures, including runs stopped by a limit, always are, with errorCode set. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/execution_history (the `GetWorkerExecutionHistory` operationId).
	GetWorkerExecutionHistoryWithResponse(ctx context.Context, params *GetWorkerExecutionHistoryParams, reqEditors ...RequestEditorFn) (*GetWorkerExecutionHistoryResponse, error)

	// RerunWorkerWithBodyWithResponse Rerun a recorded execution
	//
	// Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).
	RerunWorkerWithBodyWithResponse(ctx context.Context, workerKey string, params *RerunWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunWorkerResponse, error)

	// RerunWorkerWithResponse Rerun a recorded execution
	//
	// Runs the worker's current script again with the input of a recorded execution. Any authenticated user allowed to run the worker; others get 403.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/rerun/{workerKey} (the `RerunWorker` operationId).
	RerunWorkerWithResponse(ctx context.Context, workerKey string, params *RerunWorkerParams, body RerunWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunWorkerResponse, error)

	// GetWorkerScaffoldTsConfigWithResponse Get the TypeScript settings
	//
	// Returns the TypeScript configuration worker scripts are compiled with. Platform administrators, or project administrators with projectKey.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/scaffold/tsconfig (the `GetWorkerScaffoldTsConfig` operationId).
	GetWorkerScaffoldTsConfigWithResponse(ctx context.Context, params *GetWorkerScaffoldTsConfigParams, reqEditors ...RequestEditorFn) (*GetWorkerScaffoldTsConfigResponse, error)

	// CheckWorkersLivenessWithResponse Workers liveness
	//
	// Answers when the Workers service is running. No authentication. The service is part of the single process, so this mirrors the process liveness probe.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/system/liveness (the `CheckWorkersLiveness` operationId).
	CheckWorkersLivenessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CheckWorkersLivenessResponse, error)

	// CheckWorkersReadinessWithResponse Workers readiness
	//
	// Answers when the Workers service can run workers. No authentication.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/system/readiness (the `CheckWorkersReadiness` operationId).
	CheckWorkersReadinessWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CheckWorkersReadinessResponse, error)

	// ExecuteWorkerTestGenericWithBodyWithResponse Test an unsaved script
	//
	// Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).
	ExecuteWorkerTestGenericWithBodyWithResponse(ctx context.Context, params *ExecuteWorkerTestGenericParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestGenericResponse, error)

	// ExecuteWorkerTestGenericWithResponse Test an unsaved script
	//
	// Transpiles and runs a script that is not saved, with the given action and input, and returns its outcome keyed by action. Nothing is stored. A run that breaches a limit is terminated and answered with 400, its errorCode in the message. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators only.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/test (the `ExecuteWorkerTestGeneric` operationId).
	ExecuteWorkerTestGenericWithResponse(ctx context.Context, params *ExecuteWorkerTestGenericParams, body ExecuteWorkerTestGenericJSONRequestBody, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestGenericResponse, error)

	// ExecuteWorkerTestWithBodyWithResponse Test a saved worker
	//
	// Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).
	ExecuteWorkerTestWithBodyWithResponse(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestResponse, error)

	// ExecuteWorkerTestWithResponse Test a saved worker
	//
	// Runs the given script in the context of a saved worker: its secrets and properties apply, overlaid by any staged ones, and a BEFORE_ decision is returned without being applied to a real operation. A run that breaches a limit is terminated and answered with 400. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails. Platform administrators, or project administrators for the worker's project.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/test/{workerKey} (the `ExecuteWorkerTest` operationId).
	ExecuteWorkerTestWithResponse(ctx context.Context, workerKey string, params *ExecuteWorkerTestParams, body ExecuteWorkerTestJSONRequestBody, reqEditors ...RequestEditorFn) (*ExecuteWorkerTestResponse, error)

	// GetWorkersWithResponse List workers
	//
	// Returns every worker. Platform administrators only.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/workers (the `GetWorkers` operationId).
	GetWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetWorkersResponse, error)

	// CreateWorkerWithBodyWithResponse Create a worker
	//
	// Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).
	CreateWorkerWithBodyWithResponse(ctx context.Context, params *CreateWorkerParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkerResponse, error)

	// CreateWorkerWithResponse Create a worker
	//
	// Saves a new worker after transpiling its script. Platform administrators, or project administrators with projectKey for actions that support projects. A duplicate key is rejected with 400.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /api/v1/workers (the `CreateWorker` operationId).
	CreateWorkerWithResponse(ctx context.Context, params *CreateWorkerParams, body CreateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkerResponse, error)

	// UpdateWorkerWithBodyWithResponse Update a worker
	//
	// Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).
	UpdateWorkerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkerResponse, error)

	// UpdateWorkerWithResponse Update a worker
	//
	// Changes an existing worker, identified by key in the body; a new script is transpiled before it is saved. Platform administrators only.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /api/v1/workers (the `UpdateWorker` operationId).
	UpdateWorkerWithResponse(ctx context.Context, body UpdateWorkerJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkerResponse, error)

	// DeleteWorkerWithResponse Delete a worker
	//
	// Deletes a worker; its recorded executions are removed with it. Platform administrators only.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /api/v1/workers/{workerKey} (the `DeleteWorker` operationId).
	DeleteWorkerWithResponse(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*DeleteWorkerResponse, error)

	// GetWorkerWithResponse Get a worker
	//
	// Returns one worker, including its script. Platform administrators only.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v1/workers/{workerKey} (the `GetWorker` operationId).
	GetWorkerWithResponse(ctx context.Context, workerKey string, reqEditors ...RequestEditorFn) (*GetWorkerResponse, error)

	// GetWorkerActionsMetadataWithResponse Describe the actions
	//
	// Returns the metadata of each action this instance can trigger: sample input, TypeScript types, filter rules and sample code. Platform administrators, or project administrators with projectKey.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /api/v2/actions (the `GetWorkerActionsMetadata` operationId).
	GetWorkerActionsMetadataWithResponse(ctx context.Context, params *GetWorkerActionsMetadataParams, reqEditors ...RequestEditorFn) (*GetWorkerActionsMetadataResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateWorkerJSONRequestBody

type CreateWorkerJSONRequestBody = WorkerCreateRequest

CreateWorkerJSONRequestBody defines body for CreateWorker for application/json ContentType.

type CreateWorkerParams

type CreateWorkerParams struct {
	// ProjectKey Optional query parameter. Project to act for. Required for project administrators, who must also name the same project in the worker.
	ProjectKey *string `form:"projectKey,omitempty" json:"projectKey,omitempty"`
}

CreateWorkerParams defines parameters for CreateWorker.

type CreateWorkerResponse

type CreateWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseCreateWorkerResponse

func ParseCreateWorkerResponse(rsp *http.Response) (*CreateWorkerResponse, error)

ParseCreateWorkerResponse parses an HTTP response from a CreateWorkerWithResponse call

func (CreateWorkerResponse) ContentType

func (r CreateWorkerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateWorkerResponse) GetBody

func (r CreateWorkerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateWorkerResponse) GetJSON400

func (r CreateWorkerResponse) GetJSON400() *WorkerBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreateWorkerResponse) GetJSON401

func (r CreateWorkerResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (CreateWorkerResponse) GetJSON403

func (r CreateWorkerResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (CreateWorkerResponse) Status

func (r CreateWorkerResponse) Status() string

Status returns HTTPResponse.Status

func (CreateWorkerResponse) StatusCode

func (r CreateWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteWorkerResponse

type DeleteWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseDeleteWorkerResponse

func ParseDeleteWorkerResponse(rsp *http.Response) (*DeleteWorkerResponse, error)

ParseDeleteWorkerResponse parses an HTTP response from a DeleteWorkerWithResponse call

func (DeleteWorkerResponse) ContentType

func (r DeleteWorkerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteWorkerResponse) GetBody

func (r DeleteWorkerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteWorkerResponse) GetJSON401

func (r DeleteWorkerResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DeleteWorkerResponse) GetJSON403

func (r DeleteWorkerResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (DeleteWorkerResponse) GetJSON404

func (r DeleteWorkerResponse) GetJSON404() *WorkerNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DeleteWorkerResponse) Status

func (r DeleteWorkerResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteWorkerResponse) StatusCode

func (r DeleteWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ErrorResponse

type ErrorResponse struct {
	// Errors Required within this object. One entry per error.
	Errors []struct {
		// Code Required within this object. A symbolic code such as NOT_FOUND.
		Code string `json:"code"`

		// Message Required within this object. Human readable explanation.
		Message string `json:"message"`
	} `json:"errors"`
}

ErrorResponse The error envelope for /worker. For a run stopped by a limit, code carries the errorCode and message the matching errorMessage.

type ExecuteHttpTriggeredWorkerJSONRequestBody

type ExecuteHttpTriggeredWorkerJSONRequestBody = WorkerExecutionPayload

ExecuteHttpTriggeredWorkerJSONRequestBody defines body for ExecuteHttpTriggeredWorker for application/json ContentType.

type ExecuteHttpTriggeredWorkerResponse

type ExecuteHttpTriggeredWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerExecutionResult
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseExecuteHttpTriggeredWorkerResponse

func ParseExecuteHttpTriggeredWorkerResponse(rsp *http.Response) (*ExecuteHttpTriggeredWorkerResponse, error)

ParseExecuteHttpTriggeredWorkerResponse parses an HTTP response from a ExecuteHttpTriggeredWorkerWithResponse call

func (ExecuteHttpTriggeredWorkerResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ExecuteHttpTriggeredWorkerResponse) GetBody

GetBody returns the raw response body bytes

func (ExecuteHttpTriggeredWorkerResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ExecuteHttpTriggeredWorkerResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ExecuteHttpTriggeredWorkerResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ExecuteHttpTriggeredWorkerResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ExecuteHttpTriggeredWorkerResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ExecuteHttpTriggeredWorkerResponse) Status

Status returns HTTPResponse.Status

func (ExecuteHttpTriggeredWorkerResponse) StatusCode

func (r ExecuteHttpTriggeredWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ExecuteWorkerTestGenericJSONRequestBody

type ExecuteWorkerTestGenericJSONRequestBody = WorkerTestRequest

ExecuteWorkerTestGenericJSONRequestBody defines body for ExecuteWorkerTestGeneric for application/json ContentType.

type ExecuteWorkerTestGenericParams

type ExecuteWorkerTestGenericParams struct {
	// Debug Optional query parameter. When true the run's log lines are kept with the result. Defaults to false.
	Debug *bool `form:"debug,omitempty" json:"debug,omitempty"`
}

ExecuteWorkerTestGenericParams defines parameters for ExecuteWorkerTestGeneric.

type ExecuteWorkerTestGenericResponse

type ExecuteWorkerTestGenericResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerTestResult
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseExecuteWorkerTestGenericResponse

func ParseExecuteWorkerTestGenericResponse(rsp *http.Response) (*ExecuteWorkerTestGenericResponse, error)

ParseExecuteWorkerTestGenericResponse parses an HTTP response from a ExecuteWorkerTestGenericWithResponse call

func (ExecuteWorkerTestGenericResponse) ContentType

func (r ExecuteWorkerTestGenericResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ExecuteWorkerTestGenericResponse) GetBody

func (r ExecuteWorkerTestGenericResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ExecuteWorkerTestGenericResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ExecuteWorkerTestGenericResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ExecuteWorkerTestGenericResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ExecuteWorkerTestGenericResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ExecuteWorkerTestGenericResponse) Status

Status returns HTTPResponse.Status

func (ExecuteWorkerTestGenericResponse) StatusCode

func (r ExecuteWorkerTestGenericResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ExecuteWorkerTestJSONRequestBody

type ExecuteWorkerTestJSONRequestBody = WorkerTestRequest

ExecuteWorkerTestJSONRequestBody defines body for ExecuteWorkerTest for application/json ContentType.

type ExecuteWorkerTestParams

type ExecuteWorkerTestParams struct {
	// Debug Optional query parameter. When true the run's log lines are kept with the result. Defaults to false.
	Debug *bool `form:"debug,omitempty" json:"debug,omitempty"`
}

ExecuteWorkerTestParams defines parameters for ExecuteWorkerTest.

type ExecuteWorkerTestResponse

type ExecuteWorkerTestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerTestResult
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseExecuteWorkerTestResponse

func ParseExecuteWorkerTestResponse(rsp *http.Response) (*ExecuteWorkerTestResponse, error)

ParseExecuteWorkerTestResponse parses an HTTP response from a ExecuteWorkerTestWithResponse call

func (ExecuteWorkerTestResponse) ContentType

func (r ExecuteWorkerTestResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ExecuteWorkerTestResponse) GetBody

func (r ExecuteWorkerTestResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ExecuteWorkerTestResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ExecuteWorkerTestResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ExecuteWorkerTestResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (ExecuteWorkerTestResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (ExecuteWorkerTestResponse) GetJSON404

func (r ExecuteWorkerTestResponse) GetJSON404() *WorkerNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ExecuteWorkerTestResponse) Status

func (r ExecuteWorkerTestResponse) Status() string

Status returns HTTPResponse.Status

func (ExecuteWorkerTestResponse) StatusCode

func (r ExecuteWorkerTestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkerActionsMetadataParams

type GetWorkerActionsMetadataParams struct {
	// ProjectKey Optional query parameter. Project to act for. Required for project administrators, who must also name the same project in the worker.
	ProjectKey *string `form:"projectKey,omitempty" json:"projectKey,omitempty"`
}

GetWorkerActionsMetadataParams defines parameters for GetWorkerActionsMetadata.

type GetWorkerActionsMetadataResponse

type GetWorkerActionsMetadataResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]ActionMetadata
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseGetWorkerActionsMetadataResponse

func ParseGetWorkerActionsMetadataResponse(rsp *http.Response) (*GetWorkerActionsMetadataResponse, error)

ParseGetWorkerActionsMetadataResponse parses an HTTP response from a GetWorkerActionsMetadataWithResponse call

func (GetWorkerActionsMetadataResponse) ContentType

func (r GetWorkerActionsMetadataResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkerActionsMetadataResponse) GetBody

func (r GetWorkerActionsMetadataResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetWorkerActionsMetadataResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkerActionsMetadataResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkerActionsMetadataResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetWorkerActionsMetadataResponse) Status

Status returns HTTPResponse.Status

func (GetWorkerActionsMetadataResponse) StatusCode

func (r GetWorkerActionsMetadataResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkerActionsResponse

type GetWorkerActionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]string
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
}

func ParseGetWorkerActionsResponse

func ParseGetWorkerActionsResponse(rsp *http.Response) (*GetWorkerActionsResponse, error)

ParseGetWorkerActionsResponse parses an HTTP response from a GetWorkerActionsWithResponse call

func (GetWorkerActionsResponse) ContentType

func (r GetWorkerActionsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkerActionsResponse) GetBody

func (r GetWorkerActionsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetWorkerActionsResponse) GetJSON200

func (r GetWorkerActionsResponse) GetJSON200() *[]string

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkerActionsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkerActionsResponse) Status

func (r GetWorkerActionsResponse) Status() string

Status returns HTTPResponse.Status

func (GetWorkerActionsResponse) StatusCode

func (r GetWorkerActionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkerExecutionHistoryParams

type GetWorkerExecutionHistoryParams struct {
	// MaxItems Optional query parameter. Return at most this many entries.
	MaxItems *int `form:"maxItems,omitempty" json:"maxItems,omitempty"`

	// Start Optional query parameter. Exclude executions that started before this time, in epoch milliseconds.
	Start *int64 `form:"start,omitempty" json:"start,omitempty"`

	// End Optional query parameter. Exclude executions that started after this time, in epoch milliseconds.
	End *int64 `form:"end,omitempty" json:"end,omitempty"`

	// WorkerKey Optional query parameter. Only runs of this worker.
	WorkerKey *string `form:"workerKey,omitempty" json:"workerKey,omitempty"`

	// ShowTestRun Optional query parameter. When true, test runs are included. Defaults to false.
	ShowTestRun *bool `form:"showTestRun,omitempty" json:"showTestRun,omitempty"`

	// ProjectKey Optional query parameter. Project scope; required for project administrators.
	ProjectKey *string `form:"projectKey,omitempty" json:"projectKey,omitempty"`
}

GetWorkerExecutionHistoryParams defines parameters for GetWorkerExecutionHistory.

type GetWorkerExecutionHistoryResponse

type GetWorkerExecutionHistoryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]WorkerExecutionHistoryEntry
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseGetWorkerExecutionHistoryResponse

func ParseGetWorkerExecutionHistoryResponse(rsp *http.Response) (*GetWorkerExecutionHistoryResponse, error)

ParseGetWorkerExecutionHistoryResponse parses an HTTP response from a GetWorkerExecutionHistoryWithResponse call

func (GetWorkerExecutionHistoryResponse) ContentType

func (r GetWorkerExecutionHistoryResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkerExecutionHistoryResponse) GetBody

GetBody returns the raw response body bytes

func (GetWorkerExecutionHistoryResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkerExecutionHistoryResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkerExecutionHistoryResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetWorkerExecutionHistoryResponse) Status

Status returns HTTPResponse.Status

func (GetWorkerExecutionHistoryResponse) StatusCode

func (r GetWorkerExecutionHistoryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkerResponse

type GetWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Worker
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseGetWorkerResponse

func ParseGetWorkerResponse(rsp *http.Response) (*GetWorkerResponse, error)

ParseGetWorkerResponse parses an HTTP response from a GetWorkerWithResponse call

func (GetWorkerResponse) ContentType

func (r GetWorkerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkerResponse) GetBody

func (r GetWorkerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetWorkerResponse) GetJSON200

func (r GetWorkerResponse) GetJSON200() *Worker

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkerResponse) GetJSON401

func (r GetWorkerResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkerResponse) GetJSON403

func (r GetWorkerResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetWorkerResponse) GetJSON404

func (r GetWorkerResponse) GetJSON404() *WorkerNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetWorkerResponse) Status

func (r GetWorkerResponse) Status() string

Status returns HTTPResponse.Status

func (GetWorkerResponse) StatusCode

func (r GetWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkerScaffoldTsConfigParams

type GetWorkerScaffoldTsConfigParams struct {
	// ProjectKey Optional query parameter. Project to act for. Required for project administrators, who must also name the same project in the worker.
	ProjectKey *string `form:"projectKey,omitempty" json:"projectKey,omitempty"`
}

GetWorkerScaffoldTsConfigParams defines parameters for GetWorkerScaffoldTsConfig.

type GetWorkerScaffoldTsConfigResponse

type GetWorkerScaffoldTsConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerScaffoldTsConfig
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseGetWorkerScaffoldTsConfigResponse

func ParseGetWorkerScaffoldTsConfigResponse(rsp *http.Response) (*GetWorkerScaffoldTsConfigResponse, error)

ParseGetWorkerScaffoldTsConfigResponse parses an HTTP response from a GetWorkerScaffoldTsConfigWithResponse call

func (GetWorkerScaffoldTsConfigResponse) ContentType

func (r GetWorkerScaffoldTsConfigResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkerScaffoldTsConfigResponse) GetBody

GetBody returns the raw response body bytes

func (GetWorkerScaffoldTsConfigResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkerScaffoldTsConfigResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkerScaffoldTsConfigResponse) GetJSON403

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetWorkerScaffoldTsConfigResponse) Status

Status returns HTTPResponse.Status

func (GetWorkerScaffoldTsConfigResponse) StatusCode

func (r GetWorkerScaffoldTsConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWorkersResponse

type GetWorkersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]Worker
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
}

func ParseGetWorkersResponse

func ParseGetWorkersResponse(rsp *http.Response) (*GetWorkersResponse, error)

ParseGetWorkersResponse parses an HTTP response from a GetWorkersWithResponse call

func (GetWorkersResponse) ContentType

func (r GetWorkersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWorkersResponse) GetBody

func (r GetWorkersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetWorkersResponse) GetJSON200

func (r GetWorkersResponse) GetJSON200() *[]Worker

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWorkersResponse) GetJSON401

func (r GetWorkersResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetWorkersResponse) GetJSON403

func (r GetWorkersResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetWorkersResponse) Status

func (r GetWorkersResponse) Status() string

Status returns HTTPResponse.Status

func (GetWorkersResponse) StatusCode

func (r GetWorkersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RerunWorkerJSONBody

type RerunWorkerJSONBody struct {
	// HistoryEntryId Required within this object. id of the history entry whose input is replayed.
	HistoryEntryId string `json:"historyEntryId"`
}

RerunWorkerJSONBody defines parameters for RerunWorker.

type RerunWorkerJSONRequestBody

type RerunWorkerJSONRequestBody RerunWorkerJSONBody

RerunWorkerJSONRequestBody defines body for RerunWorker for application/json ContentType.

type RerunWorkerParams

type RerunWorkerParams struct {
	// ForceRecord Optional query parameter. Record this run in the history even when the worker has debug false. Defaults to false.
	ForceRecord *bool `form:"forceRecord,omitempty" json:"forceRecord,omitempty"`
}

RerunWorkerParams defines parameters for RerunWorker.

type RerunWorkerResponse

type RerunWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WorkerExecutionResult
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseRerunWorkerResponse

func ParseRerunWorkerResponse(rsp *http.Response) (*RerunWorkerResponse, error)

ParseRerunWorkerResponse parses an HTTP response from a RerunWorkerWithResponse call

func (RerunWorkerResponse) ContentType

func (r RerunWorkerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RerunWorkerResponse) GetBody

func (r RerunWorkerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RerunWorkerResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (RerunWorkerResponse) GetJSON400

func (r RerunWorkerResponse) GetJSON400() *WorkerBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (RerunWorkerResponse) GetJSON401

func (r RerunWorkerResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (RerunWorkerResponse) GetJSON403

func (r RerunWorkerResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (RerunWorkerResponse) GetJSON404

func (r RerunWorkerResponse) GetJSON404() *WorkerNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (RerunWorkerResponse) Status

func (r RerunWorkerResponse) Status() string

Status returns HTTPResponse.Status

func (RerunWorkerResponse) StatusCode

func (r RerunWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateWorkerJSONRequestBody

type UpdateWorkerJSONRequestBody = WorkerUpdateRequest

UpdateWorkerJSONRequestBody defines body for UpdateWorker for application/json ContentType.

type UpdateWorkerResponse

type UpdateWorkerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *WorkerBadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *WorkerUnauthorized
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *WorkerForbidden
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *WorkerNotFound
}

func ParseUpdateWorkerResponse

func ParseUpdateWorkerResponse(rsp *http.Response) (*UpdateWorkerResponse, error)

ParseUpdateWorkerResponse parses an HTTP response from a UpdateWorkerWithResponse call

func (UpdateWorkerResponse) ContentType

func (r UpdateWorkerResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateWorkerResponse) GetBody

func (r UpdateWorkerResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateWorkerResponse) GetJSON400

func (r UpdateWorkerResponse) GetJSON400() *WorkerBadRequest

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (UpdateWorkerResponse) GetJSON401

func (r UpdateWorkerResponse) GetJSON401() *WorkerUnauthorized

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (UpdateWorkerResponse) GetJSON403

func (r UpdateWorkerResponse) GetJSON403() *WorkerForbidden

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (UpdateWorkerResponse) GetJSON404

func (r UpdateWorkerResponse) GetJSON404() *WorkerNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (UpdateWorkerResponse) Status

func (r UpdateWorkerResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateWorkerResponse) StatusCode

func (r UpdateWorkerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Worker

type Worker struct {
	// Action Optional within this object. The event that runs the worker. BEFORE_ actions run synchronously inside the operation and can veto or alter it; AFTER_ actions run after it has committed; GENERIC_EVENT workers run only when called through the execute operation. The server accepts only the actions it can trigger, which GET /api/v2/actions lists; any other value is rejected with 400.
	Action *string `json:"action,omitempty"`

	// Debug Optional within this object. When true every run is recorded in the execution history; when false, the default, only failed runs are.
	Debug *bool `json:"debug,omitempty"`

	// Description Optional within this object. Free text shown with the worker.
	Description *string `json:"description,omitempty"`

	// Enabled Optional within this object. Whether the worker runs when its event occurs.
	Enabled *bool `json:"enabled,omitempty"`

	// FilterCriteria Optional within this object. Which events trigger the worker. Required for actions whose metadata has mandatoryFilter true, ignored for GENERIC_EVENT.
	FilterCriteria *WorkerFilterCriteria `json:"filterCriteria,omitempty"`

	// Key Optional within this object. Identifier of the worker.
	Key *string `json:"key,omitempty"`

	// ProjectKey Optional within this object. Project that owns the worker; empty for a platform-level worker. Must match the projectKey query parameter when a project administrator makes the call.
	ProjectKey *string `json:"projectKey,omitempty"`

	// Properties Optional within this object. Clear-text settings for the worker, merged by key on update.
	Properties *[]WorkerProperty `json:"properties,omitempty"`

	// Secrets Optional within this object. Secrets for the worker. On update, entries are merged by key; markedForRemoval deletes one. Values are never returned.
	Secrets *[]WorkerSecret `json:"secrets,omitempty"`

	// Shared Optional within this object. When true, users who are not administrators may execute the worker through the execute operation. Only meaningful for GENERIC_EVENT. Defaults to false.
	Shared *bool `json:"shared,omitempty"`

	// SourceCode Optional within this object. The script exactly as last saved.
	SourceCode *string `json:"sourceCode,omitempty"`
}

Worker A worker definition. Source is TypeScript or JavaScript, sent as plain text or as base64:<encoded>, transpiled by esbuild when saved and run by the embedded goja engine. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

type WorkerBadRequest

type WorkerBadRequest = ErrorResponse

WorkerBadRequest The error envelope for /worker. For a run stopped by a limit, code carries the errorCode and message the matching errorMessage.

type WorkerCreateRequest

type WorkerCreateRequest struct {
	// Action Required within this object. The event that runs the worker. BEFORE_ actions run synchronously inside the operation and can veto or alter it; AFTER_ actions run after it has committed; GENERIC_EVENT workers run only when called through the execute operation. SCHEDULED_EVENT workers run on the cron schedule in filterCriteria.schedule. The server accepts only the actions it can trigger, which GET /api/v2/actions lists; any other value is rejected with 400. AFTER_SAVE, BEFORE_UPLOAD_REQUEST, BEFORE_REMOTE_INFO_REQUEST and AFTER_WORKLOAD_STATE_CHANGE_REQUEST are accepted as aliases.
	Action WorkerCreateRequestAction `json:"action"`

	// Debug Optional within this object. When true every run is recorded in the execution history; when false, the default, only failed runs are.
	Debug *bool `json:"debug,omitempty"`

	// Description Optional within this object. Free text shown with the worker.
	Description *string `json:"description,omitempty"`

	// Enabled Required within this object. Whether the worker runs when its event occurs.
	Enabled bool `json:"enabled"`

	// FilterCriteria Optional within this object. Which events trigger the worker. Required for actions whose metadata has mandatoryFilter true, ignored for GENERIC_EVENT.
	FilterCriteria *WorkerFilterCriteria `json:"filterCriteria,omitempty"`

	// Key Required within this object. Identifier of the worker, unique on the instance.
	Key string `json:"key"`

	// ProjectKey Optional within this object. Project that owns the worker; empty for a platform-level worker. Must match the projectKey query parameter when a project administrator makes the call.
	ProjectKey *string `json:"projectKey,omitempty"`

	// Properties Optional within this object. Clear-text settings for the worker, merged by key on update.
	Properties *[]WorkerProperty `json:"properties,omitempty"`

	// Secrets Optional within this object. Secrets for the worker. On update, entries are merged by key; markedForRemoval deletes one. Values are never returned.
	Secrets *[]WorkerSecret `json:"secrets,omitempty"`

	// Shared Optional within this object. When true, users who are not administrators may execute the worker through the execute operation. Only meaningful for GENERIC_EVENT. Defaults to false.
	Shared *bool `json:"shared,omitempty"`

	// SourceCode Required within this object. The worker script, TypeScript or JavaScript, as plain text or as base64:<encoded source>. A script that does not transpile is rejected with 400 and the compiler message.
	SourceCode string `json:"sourceCode"`
}

WorkerCreateRequest A worker definition. Source is TypeScript or JavaScript, sent as plain text or as base64:<encoded>, transpiled by esbuild when saved and run by the embedded goja engine. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

type WorkerCreateRequestAction

type WorkerCreateRequestAction string

WorkerCreateRequestAction Required within this object. The event that runs the worker. BEFORE_ actions run synchronously inside the operation and can veto or alter it; AFTER_ actions run after it has committed; GENERIC_EVENT workers run only when called through the execute operation. SCHEDULED_EVENT workers run on the cron schedule in filterCriteria.schedule. The server accepts only the actions it can trigger, which GET /api/v2/actions lists; any other value is rejected with 400. AFTER_SAVE, BEFORE_UPLOAD_REQUEST, BEFORE_REMOTE_INFO_REQUEST and AFTER_WORKLOAD_STATE_CHANGE_REQUEST are accepted as aliases.

const (
	WorkerCreateRequestActionAFTERBUILDINFOSAVE              WorkerCreateRequestAction = "AFTER_BUILD_INFO_SAVE"
	WorkerCreateRequestActionAFTERCOPY                       WorkerCreateRequestAction = "AFTER_COPY"
	WorkerCreateRequestActionAFTERCREATE                     WorkerCreateRequestAction = "AFTER_CREATE"
	WorkerCreateRequestActionAFTERDELETE                     WorkerCreateRequestAction = "AFTER_DELETE"
	WorkerCreateRequestActionAFTERDOWNLOAD                   WorkerCreateRequestAction = "AFTER_DOWNLOAD"
	WorkerCreateRequestActionAFTERDOWNLOADERROR              WorkerCreateRequestAction = "AFTER_DOWNLOAD_ERROR"
	WorkerCreateRequestActionAFTERMOVE                       WorkerCreateRequestAction = "AFTER_MOVE"
	WorkerCreateRequestActionAFTERPROPERTYCREATE             WorkerCreateRequestAction = "AFTER_PROPERTY_CREATE"
	WorkerCreateRequestActionAFTERPROPERTYDELETE             WorkerCreateRequestAction = "AFTER_PROPERTY_DELETE"
	WorkerCreateRequestActionAFTERREMOTEDOWNLOAD             WorkerCreateRequestAction = "AFTER_REMOTE_DOWNLOAD"
	WorkerCreateRequestActionAFTERREPOCREATE                 WorkerCreateRequestAction = "AFTER_REPO_CREATE"
	WorkerCreateRequestActionAFTERREPODELETE                 WorkerCreateRequestAction = "AFTER_REPO_DELETE"
	WorkerCreateRequestActionAFTERREPOUPDATE                 WorkerCreateRequestAction = "AFTER_REPO_UPDATE"
	WorkerCreateRequestActionAFTERSAVE                       WorkerCreateRequestAction = "AFTER_SAVE"
	WorkerCreateRequestActionAFTERWORKLOADSTATECHANGE        WorkerCreateRequestAction = "AFTER_WORKLOAD_STATE_CHANGE"
	WorkerCreateRequestActionAFTERWORKLOADSTATECHANGEREQUEST WorkerCreateRequestAction = "AFTER_WORKLOAD_STATE_CHANGE_REQUEST"
	WorkerCreateRequestActionALTALLRESPONSES                 WorkerCreateRequestAction = "ALT_ALL_RESPONSES"
	WorkerCreateRequestActionALTREMOTECONTENT                WorkerCreateRequestAction = "ALT_REMOTE_CONTENT"
	WorkerCreateRequestActionALTREMOTEPATH                   WorkerCreateRequestAction = "ALT_REMOTE_PATH"
	WorkerCreateRequestActionALTRESPONSE                     WorkerCreateRequestAction = "ALT_RESPONSE"
	WorkerCreateRequestActionBEFOREBUILDINFOSAVE             WorkerCreateRequestAction = "BEFORE_BUILD_INFO_SAVE"
	WorkerCreateRequestActionBEFORECOPY                      WorkerCreateRequestAction = "BEFORE_COPY"
	WorkerCreateRequestActionBEFORECREATE                    WorkerCreateRequestAction = "BEFORE_CREATE"
	WorkerCreateRequestActionBEFORECREATETOKEN               WorkerCreateRequestAction = "BEFORE_CREATE_TOKEN"
	WorkerCreateRequestActionBEFOREDELETE                    WorkerCreateRequestAction = "BEFORE_DELETE"
	WorkerCreateRequestActionBEFOREDELETEREPLICATION         WorkerCreateRequestAction = "BEFORE_DELETE_REPLICATION"
	WorkerCreateRequestActionBEFOREDIRECTORYREPLICATION      WorkerCreateRequestAction = "BEFORE_DIRECTORY_REPLICATION"
	WorkerCreateRequestActionBEFOREDOWNLOAD                  WorkerCreateRequestAction = "BEFORE_DOWNLOAD"
	WorkerCreateRequestActionBEFOREDOWNLOADREQUEST           WorkerCreateRequestAction = "BEFORE_DOWNLOAD_REQUEST"
	WorkerCreateRequestActionBEFOREFILEREPLICATION           WorkerCreateRequestAction = "BEFORE_FILE_REPLICATION"
	WorkerCreateRequestActionBEFOREMOVE                      WorkerCreateRequestAction = "BEFORE_MOVE"
	WorkerCreateRequestActionBEFOREPROPERTYCREATE            WorkerCreateRequestAction = "BEFORE_PROPERTY_CREATE"
	WorkerCreateRequestActionBEFOREPROPERTYDELETE            WorkerCreateRequestAction = "BEFORE_PROPERTY_DELETE"
	WorkerCreateRequestActionBEFOREPROPERTYREPLICATION       WorkerCreateRequestAction = "BEFORE_PROPERTY_REPLICATION"
	WorkerCreateRequestActionBEFOREREMOTEDOWNLOAD            WorkerCreateRequestAction = "BEFORE_REMOTE_DOWNLOAD"
	WorkerCreateRequestActionBEFOREREMOTEINFO                WorkerCreateRequestAction = "BEFORE_REMOTE_INFO"
	WorkerCreateRequestActionBEFOREREMOTEINFOREQUEST         WorkerCreateRequestAction = "BEFORE_REMOTE_INFO_REQUEST"
	WorkerCreateRequestActionBEFOREREPOCREATE                WorkerCreateRequestAction = "BEFORE_REPO_CREATE"
	WorkerCreateRequestActionBEFOREREPODELETE                WorkerCreateRequestAction = "BEFORE_REPO_DELETE"
	WorkerCreateRequestActionBEFOREREPOUPDATE                WorkerCreateRequestAction = "BEFORE_REPO_UPDATE"
	WorkerCreateRequestActionBEFOREREVOKETOKEN               WorkerCreateRequestAction = "BEFORE_REVOKE_TOKEN"
	WorkerCreateRequestActionBEFORESTATISTICSREPLICATION     WorkerCreateRequestAction = "BEFORE_STATISTICS_REPLICATION"
	WorkerCreateRequestActionBEFORETOKENEXPIRY               WorkerCreateRequestAction = "BEFORE_TOKEN_EXPIRY"
	WorkerCreateRequestActionBEFOREUPLOAD                    WorkerCreateRequestAction = "BEFORE_UPLOAD"
	WorkerCreateRequestActionBEFOREUPLOADREQUEST             WorkerCreateRequestAction = "BEFORE_UPLOAD_REQUEST"
	WorkerCreateRequestActionGENERICEVENT                    WorkerCreateRequestAction = "GENERIC_EVENT"
	WorkerCreateRequestActionSCHEDULEDEVENT                  WorkerCreateRequestAction = "SCHEDULED_EVENT"
)

Defines values for WorkerCreateRequestAction.

func (WorkerCreateRequestAction) Valid

func (e WorkerCreateRequestAction) Valid() bool

Valid indicates whether the value is a known member of the WorkerCreateRequestAction enum.

type WorkerExecutionHistoryEntry

type WorkerExecutionHistoryEntry struct {
	// EndTimeMillis Optional within this object. When the run ended, epoch milliseconds.
	EndTimeMillis *int64 `json:"endTimeMillis,omitempty"`

	// ErrorCode Optional within this object. Set when the run failed. These codes come with a fixed errorMessage: WORKER_MEMORY_LIMIT ('Worker used too much memory'), WORKER_CPU_LIMIT ('Worker used too much cpu time'), WORKER_EXECUTION_TIMEOUT ('Worker execution timeout'), WORKER_QUEUE_TIMEOUT ('Worker waited for too long in the queue'), WORKER_KILLED ('The worker has been killed unexpectedly'), WORKER_FLOATING_PROMISE ('Floating promises are not allowed. Make sure to await all promises'). WORKER_SCRIPT_ERROR marks an exception thrown by the script, and WORKER_PAYLOAD_TOO_LARGE an input or result over 100 KiB.
	ErrorCode *WorkerExecutionHistoryEntryErrorCode `json:"errorCode,omitempty"`

	// ErrorMessage Optional within this object. Human readable reason for a failed run.
	ErrorMessage *string `json:"errorMessage,omitempty"`

	// ExecutedVersion Optional within this object. Version of the worker that ran, when the worker is versioned.
	ExecutedVersion *string `json:"executedVersion,omitempty"`

	// ExecutionStatus Required within this object. STATUS_SUCCESS, or STATUS_FAILURE for a failed run (see errorCode).
	ExecutionStatus string `json:"executionStatus"`

	// StartTimeMillis Required within this object. When the run started, epoch milliseconds.
	StartTimeMillis int64 `json:"startTimeMillis"`

	// TestRun Optional within this object. True for runs made through the test operations; listed only with showTestRun=true.
	TestRun *bool `json:"testRun,omitempty"`

	// TraceId Optional within this object. Request trace identifier, for correlating with server logs.
	TraceId *string `json:"traceId,omitempty"`

	// TriggeredBy Optional within this object. User or token subject whose operation raised the event, or the scheduler.
	TriggeredBy *string `json:"triggeredBy,omitempty"`

	// WorkerKey Required within this object. The worker that ran.
	WorkerKey string `json:"workerKey"`

	// WorkerProjectKey Optional within this object. Project of the worker; empty at platform level.
	WorkerProjectKey *string `json:"workerProjectKey,omitempty"`

	// WorkerType Optional within this object. The action the worker handles, such as BEFORE_DOWNLOAD.
	WorkerType *string `json:"workerType,omitempty"`
}

WorkerExecutionHistoryEntry One recorded run.

type WorkerExecutionHistoryEntryErrorCode

type WorkerExecutionHistoryEntryErrorCode string

WorkerExecutionHistoryEntryErrorCode Optional within this object. Set when the run failed. These codes come with a fixed errorMessage: WORKER_MEMORY_LIMIT ('Worker used too much memory'), WORKER_CPU_LIMIT ('Worker used too much cpu time'), WORKER_EXECUTION_TIMEOUT ('Worker execution timeout'), WORKER_QUEUE_TIMEOUT ('Worker waited for too long in the queue'), WORKER_KILLED ('The worker has been killed unexpectedly'), WORKER_FLOATING_PROMISE ('Floating promises are not allowed. Make sure to await all promises'). WORKER_SCRIPT_ERROR marks an exception thrown by the script, and WORKER_PAYLOAD_TOO_LARGE an input or result over 100 KiB.

const (
	WorkerExecutionHistoryEntryErrorCodeWORKERCPULIMIT         WorkerExecutionHistoryEntryErrorCode = "WORKER_CPU_LIMIT"
	WorkerExecutionHistoryEntryErrorCodeWORKEREXECUTIONTIMEOUT WorkerExecutionHistoryEntryErrorCode = "WORKER_EXECUTION_TIMEOUT"
	WorkerExecutionHistoryEntryErrorCodeWORKERFLOATINGPROMISE  WorkerExecutionHistoryEntryErrorCode = "WORKER_FLOATING_PROMISE"
	WorkerExecutionHistoryEntryErrorCodeWORKERKILLED           WorkerExecutionHistoryEntryErrorCode = "WORKER_KILLED"
	WorkerExecutionHistoryEntryErrorCodeWORKERMEMORYLIMIT      WorkerExecutionHistoryEntryErrorCode = "WORKER_MEMORY_LIMIT"
	WorkerExecutionHistoryEntryErrorCodeWORKERPAYLOADTOOLARGE  WorkerExecutionHistoryEntryErrorCode = "WORKER_PAYLOAD_TOO_LARGE"
	WorkerExecutionHistoryEntryErrorCodeWORKERQUEUETIMEOUT     WorkerExecutionHistoryEntryErrorCode = "WORKER_QUEUE_TIMEOUT"
	WorkerExecutionHistoryEntryErrorCodeWORKERSCRIPTERROR      WorkerExecutionHistoryEntryErrorCode = "WORKER_SCRIPT_ERROR"
)

Defines values for WorkerExecutionHistoryEntryErrorCode.

func (WorkerExecutionHistoryEntryErrorCode) Valid

Valid indicates whether the value is a known member of the WorkerExecutionHistoryEntryErrorCode enum.

type WorkerExecutionPayload

type WorkerExecutionPayload map[string]interface{}

WorkerExecutionPayload Input handed to the worker as its data argument. Its shape depends on the action; GET /api/v2/actions gives a sample payload and TypeScript types for each one.

type WorkerExecutionResult

type WorkerExecutionResult struct {
	// Data Optional within this object. What the script returned, unchanged. For BEFORE_ actions it carries the decision (status and message) in the shape the action's types define.
	Data *map[string]interface{} `json:"data,omitempty"`

	// ErrorCode Optional within this object. Set when the run failed. These codes come with a fixed errorMessage: WORKER_MEMORY_LIMIT ('Worker used too much memory'), WORKER_CPU_LIMIT ('Worker used too much cpu time'), WORKER_EXECUTION_TIMEOUT ('Worker execution timeout'), WORKER_QUEUE_TIMEOUT ('Worker waited for too long in the queue'), WORKER_KILLED ('The worker has been killed unexpectedly'), WORKER_FLOATING_PROMISE ('Floating promises are not allowed. Make sure to await all promises'). WORKER_SCRIPT_ERROR marks an exception thrown by the script, and WORKER_PAYLOAD_TOO_LARGE an input or result over 100 KiB.
	ErrorCode *WorkerExecutionResultErrorCode `json:"errorCode,omitempty"`

	// ErrorMessage Optional within this object. Human readable reason for a failed run; see errorCode.
	ErrorMessage *string `json:"errorMessage,omitempty"`

	// ExecutionStatus Optional within this object. STATUS_SUCCESS when the script completed, STATUS_FAILURE for a failed run.
	ExecutionStatus      *string                `json:"executionStatus,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

WorkerExecutionResult The outcome of one run: the script's return value under data, and executionStatus.

func (WorkerExecutionResult) Get

func (a WorkerExecutionResult) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for WorkerExecutionResult. Returns the specified element and whether it was found

func (WorkerExecutionResult) MarshalJSON

func (a WorkerExecutionResult) MarshalJSON() ([]byte, error)

Override default JSON handling for WorkerExecutionResult to handle AdditionalProperties

func (*WorkerExecutionResult) Set

func (a *WorkerExecutionResult) Set(fieldName string, value interface{})

Setter for additional properties for WorkerExecutionResult

func (*WorkerExecutionResult) UnmarshalJSON

func (a *WorkerExecutionResult) UnmarshalJSON(b []byte) error

Override default JSON handling for WorkerExecutionResult to handle AdditionalProperties

type WorkerExecutionResultErrorCode

type WorkerExecutionResultErrorCode string

WorkerExecutionResultErrorCode Optional within this object. Set when the run failed. These codes come with a fixed errorMessage: WORKER_MEMORY_LIMIT ('Worker used too much memory'), WORKER_CPU_LIMIT ('Worker used too much cpu time'), WORKER_EXECUTION_TIMEOUT ('Worker execution timeout'), WORKER_QUEUE_TIMEOUT ('Worker waited for too long in the queue'), WORKER_KILLED ('The worker has been killed unexpectedly'), WORKER_FLOATING_PROMISE ('Floating promises are not allowed. Make sure to await all promises'). WORKER_SCRIPT_ERROR marks an exception thrown by the script, and WORKER_PAYLOAD_TOO_LARGE an input or result over 100 KiB.

const (
	WorkerExecutionResultErrorCodeWORKERCPULIMIT         WorkerExecutionResultErrorCode = "WORKER_CPU_LIMIT"
	WorkerExecutionResultErrorCodeWORKEREXECUTIONTIMEOUT WorkerExecutionResultErrorCode = "WORKER_EXECUTION_TIMEOUT"
	WorkerExecutionResultErrorCodeWORKERFLOATINGPROMISE  WorkerExecutionResultErrorCode = "WORKER_FLOATING_PROMISE"
	WorkerExecutionResultErrorCodeWORKERKILLED           WorkerExecutionResultErrorCode = "WORKER_KILLED"
	WorkerExecutionResultErrorCodeWORKERMEMORYLIMIT      WorkerExecutionResultErrorCode = "WORKER_MEMORY_LIMIT"
	WorkerExecutionResultErrorCodeWORKERPAYLOADTOOLARGE  WorkerExecutionResultErrorCode = "WORKER_PAYLOAD_TOO_LARGE"
	WorkerExecutionResultErrorCodeWORKERQUEUETIMEOUT     WorkerExecutionResultErrorCode = "WORKER_QUEUE_TIMEOUT"
	WorkerExecutionResultErrorCodeWORKERSCRIPTERROR      WorkerExecutionResultErrorCode = "WORKER_SCRIPT_ERROR"
)

Defines values for WorkerExecutionResultErrorCode.

func (WorkerExecutionResultErrorCode) Valid

Valid indicates whether the value is a known member of the WorkerExecutionResultErrorCode enum.

type WorkerFilterCriteria

type WorkerFilterCriteria struct {
	// ArtifactFilterCriteria Optional within this object. Selection for artifact and repository actions.
	ArtifactFilterCriteria *struct {
		// AnyFederated Optional within this object. When true, events in every federated repository trigger the worker.
		AnyFederated *bool `json:"anyFederated,omitempty"`

		// AnyLocal Optional within this object. When true, events in every local repository trigger the worker.
		AnyLocal *bool `json:"anyLocal,omitempty"`

		// AnyRemote Optional within this object. When true, events in every remote repository and its cache trigger the worker.
		AnyRemote *bool `json:"anyRemote,omitempty"`

		// ExcludePatterns Optional within this object. Ant patterns of paths that never trigger the worker; empty excludes nothing.
		ExcludePatterns *[]string `json:"excludePatterns,omitempty"`

		// IncludePatterns Optional within this object. Ant patterns of paths that trigger the worker; empty means every path.
		IncludePatterns *[]string `json:"includePatterns,omitempty"`

		// RepoKeys Optional within this object. Repository keys whose events trigger the worker.
		RepoKeys *[]string `json:"repoKeys,omitempty"`
	} `json:"artifactFilterCriteria,omitempty"`

	// Schedule Optional within this object. Cron schedule for SCHEDULED_EVENT workers; required for that action and rejected for others.
	Schedule *struct {
		// Cron Required within this object. Cron expression for when the worker runs.
		Cron string `json:"cron"`

		// Timezone Optional within this object. IANA time zone the expression is evaluated in. Defaults to UTC.
		Timezone *string `json:"timezone,omitempty"`
	} `json:"schedule,omitempty"`
}

WorkerFilterCriteria Selects the events that trigger a worker: artifactFilterCriteria for repository actions whose metadata filterType is FILTER_REPO, schedule for SCHEDULED_EVENT (filterType SCHEDULE). Repository keys and the any* switches combine with OR.

type WorkerForbidden

type WorkerForbidden = ErrorResponse

WorkerForbidden The error envelope for /worker. For a run stopped by a limit, code carries the errorCode and message the matching errorMessage.

type WorkerNotFound

type WorkerNotFound = ErrorResponse

WorkerNotFound The error envelope for /worker. For a run stopped by a limit, code carries the errorCode and message the matching errorMessage.

type WorkerProperty

type WorkerProperty struct {
	// Key Required within this object. Property name, unique within the worker.
	Key string `json:"key"`

	// MarkedForRemoval Optional within this object. On update, true deletes the property named by key. Defaults to false.
	MarkedForRemoval *bool `json:"markedForRemoval,omitempty"`

	// Value Optional within this object. The property value.
	Value *string `json:"value,omitempty"`
}

WorkerProperty A named clear-text setting available to the worker. Unlike secrets, values are stored and returned as given.

type WorkerScaffoldTsConfig

type WorkerScaffoldTsConfig struct {
	// CompilerOptions Optional within this object. Compiler options matching what esbuild applies when a worker is saved.
	CompilerOptions *map[string]interface{} `json:"compilerOptions,omitempty"`

	// Exclude Optional within this object. Paths excluded from compilation.
	Exclude *[]string `json:"exclude,omitempty"`

	// Include Optional within this object. Glob patterns of the files to compile.
	Include *[]string `json:"include,omitempty"`
}

WorkerScaffoldTsConfig The TypeScript settings worker scripts are compiled with, for editors and local type checking.

type WorkerSecret

type WorkerSecret struct {
	// Key Required within this object. Secret name, unique within the worker.
	Key string `json:"key"`

	// MarkedForRemoval Optional within this object. On update, true deletes the secret named by key. Defaults to false.
	MarkedForRemoval *bool `json:"markedForRemoval,omitempty"`

	// Value Optional within this object. The secret value. Omitted on reads; on update, omitting it keeps the stored value.
	Value *string `json:"value,omitempty"`
}

WorkerSecret A named secret available to the worker as context.secrets.get(key). Values are sealed at rest and never returned.

type WorkerTestRequest

type WorkerTestRequest struct {
	// Action Required within this object. The action whose input and result types apply, such as BEFORE_DOWNLOAD or GENERIC_EVENT.
	Action string `json:"action"`

	// Code Required within this object. The script to run, TypeScript or JavaScript, plain or base64:<encoded>. Import statements are not allowed.
	Code string `json:"code"`

	// Data Required within this object. The input handed to the script as its data argument, in the action's request shape (GET /api/v2/actions gives a sample).
	Data map[string]interface{} `json:"data"`

	// StagedProperties Optional within this object. Properties for this run only, merged over the saved worker's by key.
	StagedProperties *[]WorkerProperty `json:"stagedProperties,omitempty"`

	// StagedSecrets Optional within this object. Secrets for this run only, merged over the saved worker's by key.
	StagedSecrets *[]WorkerSecret `json:"stagedSecrets,omitempty"`
}

WorkerTestRequest A test run of a script. The script runs with the given action and input without being saved; staged secrets and properties overlay the saved worker's when the run names one.

type WorkerTestResult

type WorkerTestResult map[string]WorkerExecutionResult

WorkerTestResult Test run outcome keyed by the action name in lower camel case, for example {"genericEvent": {"data": ..., "executionStatus": "STATUS_SUCCESS"}} for GENERIC_EVENT or beforeDownload for BEFORE_DOWNLOAD.

type WorkerUnauthorized

type WorkerUnauthorized = ErrorResponse

WorkerUnauthorized The error envelope for /worker. For a run stopped by a limit, code carries the errorCode and message the matching errorMessage.

type WorkerUpdateRequest

type WorkerUpdateRequest struct {
	// Action Optional within this object. The event that runs the worker. BEFORE_ actions run synchronously inside the operation and can veto or alter it; AFTER_ actions run after it has committed; GENERIC_EVENT workers run only when called through the execute operation. SCHEDULED_EVENT workers run on the cron schedule in filterCriteria.schedule. The server accepts only the actions it can trigger, which GET /api/v2/actions lists; any other value is rejected with 400. AFTER_SAVE, BEFORE_UPLOAD_REQUEST, BEFORE_REMOTE_INFO_REQUEST and AFTER_WORKLOAD_STATE_CHANGE_REQUEST are accepted as aliases.
	Action *WorkerUpdateRequestAction `json:"action,omitempty"`

	// Debug Optional within this object. When true every run is recorded in the execution history; when false, the default, only failed runs are.
	Debug *bool `json:"debug,omitempty"`

	// Description Optional within this object. Free text shown with the worker.
	Description *string `json:"description,omitempty"`

	// Enabled Optional within this object. Whether the worker runs when its event occurs.
	Enabled *bool `json:"enabled,omitempty"`

	// FilterCriteria Optional within this object. Which events trigger the worker. Required for actions whose metadata has mandatoryFilter true, ignored for GENERIC_EVENT.
	FilterCriteria *WorkerFilterCriteria `json:"filterCriteria,omitempty"`

	// Key Required within this object. Identifier of the worker to update; it cannot be changed.
	Key string `json:"key"`

	// ProjectKey Optional within this object. Project that owns the worker; empty for a platform-level worker. Must match the projectKey query parameter when a project administrator makes the call.
	ProjectKey *string `json:"projectKey,omitempty"`

	// Properties Optional within this object. Clear-text settings for the worker, merged by key on update.
	Properties *[]WorkerProperty `json:"properties,omitempty"`

	// Secrets Optional within this object. Secrets for the worker. On update, entries are merged by key; markedForRemoval deletes one. Values are never returned.
	Secrets *[]WorkerSecret `json:"secrets,omitempty"`

	// Shared Optional within this object. When true, users who are not administrators may execute the worker through the execute operation. Only meaningful for GENERIC_EVENT. Defaults to false.
	Shared *bool `json:"shared,omitempty"`

	// SourceCode Optional within this object. The worker script, TypeScript or JavaScript, as plain text or as base64:<encoded source>. A script that does not transpile is rejected with 400 and the compiler message.
	SourceCode *string `json:"sourceCode,omitempty"`
}

WorkerUpdateRequest A worker definition. Source is TypeScript or JavaScript, sent as plain text or as base64:<encoded>, transpiled by esbuild when saved and run by the embedded goja engine. Each execution runs alone in a helper process under these limits: 64 MiB of memory (the run is interrupted on breach and the helper replaced at twice that), 1 s of CPU time, 5 s per platform or HTTP call, 20 s overall, a call stack depth of 100, 100 KiB of JSON input and of result, and source of at most 100,000 characters. Helpers form a pool of min(4, GOMAXPROCS); a run that waits longer than 30 s for a helper fails.

type WorkerUpdateRequestAction

type WorkerUpdateRequestAction string

WorkerUpdateRequestAction Optional within this object. The event that runs the worker. BEFORE_ actions run synchronously inside the operation and can veto or alter it; AFTER_ actions run after it has committed; GENERIC_EVENT workers run only when called through the execute operation. SCHEDULED_EVENT workers run on the cron schedule in filterCriteria.schedule. The server accepts only the actions it can trigger, which GET /api/v2/actions lists; any other value is rejected with 400. AFTER_SAVE, BEFORE_UPLOAD_REQUEST, BEFORE_REMOTE_INFO_REQUEST and AFTER_WORKLOAD_STATE_CHANGE_REQUEST are accepted as aliases.

const (
	WorkerUpdateRequestActionAFTERBUILDINFOSAVE              WorkerUpdateRequestAction = "AFTER_BUILD_INFO_SAVE"
	WorkerUpdateRequestActionAFTERCOPY                       WorkerUpdateRequestAction = "AFTER_COPY"
	WorkerUpdateRequestActionAFTERCREATE                     WorkerUpdateRequestAction = "AFTER_CREATE"
	WorkerUpdateRequestActionAFTERDELETE                     WorkerUpdateRequestAction = "AFTER_DELETE"
	WorkerUpdateRequestActionAFTERDOWNLOAD                   WorkerUpdateRequestAction = "AFTER_DOWNLOAD"
	WorkerUpdateRequestActionAFTERDOWNLOADERROR              WorkerUpdateRequestAction = "AFTER_DOWNLOAD_ERROR"
	WorkerUpdateRequestActionAFTERMOVE                       WorkerUpdateRequestAction = "AFTER_MOVE"
	WorkerUpdateRequestActionAFTERPROPERTYCREATE             WorkerUpdateRequestAction = "AFTER_PROPERTY_CREATE"
	WorkerUpdateRequestActionAFTERPROPERTYDELETE             WorkerUpdateRequestAction = "AFTER_PROPERTY_DELETE"
	WorkerUpdateRequestActionAFTERREMOTEDOWNLOAD             WorkerUpdateRequestAction = "AFTER_REMOTE_DOWNLOAD"
	WorkerUpdateRequestActionAFTERREPOCREATE                 WorkerUpdateRequestAction = "AFTER_REPO_CREATE"
	WorkerUpdateRequestActionAFTERREPODELETE                 WorkerUpdateRequestAction = "AFTER_REPO_DELETE"
	WorkerUpdateRequestActionAFTERREPOUPDATE                 WorkerUpdateRequestAction = "AFTER_REPO_UPDATE"
	WorkerUpdateRequestActionAFTERSAVE                       WorkerUpdateRequestAction = "AFTER_SAVE"
	WorkerUpdateRequestActionAFTERWORKLOADSTATECHANGE        WorkerUpdateRequestAction = "AFTER_WORKLOAD_STATE_CHANGE"
	WorkerUpdateRequestActionAFTERWORKLOADSTATECHANGEREQUEST WorkerUpdateRequestAction = "AFTER_WORKLOAD_STATE_CHANGE_REQUEST"
	WorkerUpdateRequestActionALTALLRESPONSES                 WorkerUpdateRequestAction = "ALT_ALL_RESPONSES"
	WorkerUpdateRequestActionALTREMOTECONTENT                WorkerUpdateRequestAction = "ALT_REMOTE_CONTENT"
	WorkerUpdateRequestActionALTREMOTEPATH                   WorkerUpdateRequestAction = "ALT_REMOTE_PATH"
	WorkerUpdateRequestActionALTRESPONSE                     WorkerUpdateRequestAction = "ALT_RESPONSE"
	WorkerUpdateRequestActionBEFOREBUILDINFOSAVE             WorkerUpdateRequestAction = "BEFORE_BUILD_INFO_SAVE"
	WorkerUpdateRequestActionBEFORECOPY                      WorkerUpdateRequestAction = "BEFORE_COPY"
	WorkerUpdateRequestActionBEFORECREATE                    WorkerUpdateRequestAction = "BEFORE_CREATE"
	WorkerUpdateRequestActionBEFORECREATETOKEN               WorkerUpdateRequestAction = "BEFORE_CREATE_TOKEN"
	WorkerUpdateRequestActionBEFOREDELETE                    WorkerUpdateRequestAction = "BEFORE_DELETE"
	WorkerUpdateRequestActionBEFOREDELETEREPLICATION         WorkerUpdateRequestAction = "BEFORE_DELETE_REPLICATION"
	WorkerUpdateRequestActionBEFOREDIRECTORYREPLICATION      WorkerUpdateRequestAction = "BEFORE_DIRECTORY_REPLICATION"
	WorkerUpdateRequestActionBEFOREDOWNLOAD                  WorkerUpdateRequestAction = "BEFORE_DOWNLOAD"
	WorkerUpdateRequestActionBEFOREDOWNLOADREQUEST           WorkerUpdateRequestAction = "BEFORE_DOWNLOAD_REQUEST"
	WorkerUpdateRequestActionBEFOREFILEREPLICATION           WorkerUpdateRequestAction = "BEFORE_FILE_REPLICATION"
	WorkerUpdateRequestActionBEFOREMOVE                      WorkerUpdateRequestAction = "BEFORE_MOVE"
	WorkerUpdateRequestActionBEFOREPROPERTYCREATE            WorkerUpdateRequestAction = "BEFORE_PROPERTY_CREATE"
	WorkerUpdateRequestActionBEFOREPROPERTYDELETE            WorkerUpdateRequestAction = "BEFORE_PROPERTY_DELETE"
	WorkerUpdateRequestActionBEFOREPROPERTYREPLICATION       WorkerUpdateRequestAction = "BEFORE_PROPERTY_REPLICATION"
	WorkerUpdateRequestActionBEFOREREMOTEDOWNLOAD            WorkerUpdateRequestAction = "BEFORE_REMOTE_DOWNLOAD"
	WorkerUpdateRequestActionBEFOREREMOTEINFO                WorkerUpdateRequestAction = "BEFORE_REMOTE_INFO"
	WorkerUpdateRequestActionBEFOREREMOTEINFOREQUEST         WorkerUpdateRequestAction = "BEFORE_REMOTE_INFO_REQUEST"
	WorkerUpdateRequestActionBEFOREREPOCREATE                WorkerUpdateRequestAction = "BEFORE_REPO_CREATE"
	WorkerUpdateRequestActionBEFOREREPODELETE                WorkerUpdateRequestAction = "BEFORE_REPO_DELETE"
	WorkerUpdateRequestActionBEFOREREPOUPDATE                WorkerUpdateRequestAction = "BEFORE_REPO_UPDATE"
	WorkerUpdateRequestActionBEFOREREVOKETOKEN               WorkerUpdateRequestAction = "BEFORE_REVOKE_TOKEN"
	WorkerUpdateRequestActionBEFORESTATISTICSREPLICATION     WorkerUpdateRequestAction = "BEFORE_STATISTICS_REPLICATION"
	WorkerUpdateRequestActionBEFORETOKENEXPIRY               WorkerUpdateRequestAction = "BEFORE_TOKEN_EXPIRY"
	WorkerUpdateRequestActionBEFOREUPLOAD                    WorkerUpdateRequestAction = "BEFORE_UPLOAD"
	WorkerUpdateRequestActionBEFOREUPLOADREQUEST             WorkerUpdateRequestAction = "BEFORE_UPLOAD_REQUEST"
	WorkerUpdateRequestActionGENERICEVENT                    WorkerUpdateRequestAction = "GENERIC_EVENT"
	WorkerUpdateRequestActionSCHEDULEDEVENT                  WorkerUpdateRequestAction = "SCHEDULED_EVENT"
)

Defines values for WorkerUpdateRequestAction.

func (WorkerUpdateRequestAction) Valid

func (e WorkerUpdateRequestAction) Valid() bool

Valid indicates whether the value is a known member of the WorkerUpdateRequestAction enum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL