api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	OAuthScopes = "OAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewAgentAPIPingRequest

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

NewAgentAPIPingRequest generates requests for AgentAPIPing

func NewAgentCheckinRequest added in v1.0.0

func NewAgentCheckinRequest(server string, body AgentCheckinJSONRequestBody) (*http.Request, error)

NewAgentCheckinRequest calls the generic AgentCheckin builder with application/json body

func NewAgentCheckinRequestWithBody added in v1.0.0

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

NewAgentCheckinRequestWithBody generates requests for AgentCheckin with any type of body

func NewAgentHeartbeatRequest

func NewAgentHeartbeatRequest(server string, body AgentHeartbeatJSONRequestBody) (*http.Request, error)

NewAgentHeartbeatRequest calls the generic AgentHeartbeat builder with application/json body

func NewAgentHeartbeatRequestWithBody

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

NewAgentHeartbeatRequestWithBody generates requests for AgentHeartbeat with any type of body

func NewHealthRequest

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

NewHealthRequest generates requests for Health

func NewTaskPollRequest

func NewTaskPollRequest(server string, body TaskPollJSONRequestBody) (*http.Request, error)

NewTaskPollRequest calls the generic TaskPoll builder with application/json body

func NewTaskPollRequestWithBody

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

NewTaskPollRequestWithBody generates requests for TaskPoll with any type of body

func NewUpdateTaskRequest

func NewUpdateTaskRequest(server string, taskName TaskName, body UpdateTaskJSONRequestBody) (*http.Request, error)

NewUpdateTaskRequest calls the generic UpdateTask builder with application/json body

func NewUpdateTaskRequestWithBody

func NewUpdateTaskRequestWithBody(server string, taskName TaskName, contentType string, body io.Reader) (*http.Request, error)

NewUpdateTaskRequestWithBody generates requests for UpdateTask with any type of body

Types

type AgentAPIPingResponse

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

func ParseAgentAPIPingResponse

func ParseAgentAPIPingResponse(rsp *http.Response) (*AgentAPIPingResponse, error)

ParseAgentAPIPingResponse parses an HTTP response from a AgentAPIPingWithResponse call

func (AgentAPIPingResponse) Status

func (r AgentAPIPingResponse) Status() string

Status returns HTTPResponse.Status

func (AgentAPIPingResponse) StatusCode

func (r AgentAPIPingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AgentCheckinInput added in v1.0.0

type AgentCheckinInput struct {
	AgentID      *string      `json:"agentID,omitempty"`
	AgentVersion *string      `json:"agentVersion,omitempty"`
	PoolLabels   *[]PoolLabel `json:"poolLabels,omitempty"`
}

AgentCheckinInput defines model for agentCheckinInput.

type AgentCheckinJSONRequestBody added in v1.0.0

type AgentCheckinJSONRequestBody = AgentCheckinInput

AgentCheckinJSONRequestBody defines body for AgentCheckin for application/json ContentType.

type AgentCheckinOutput added in v1.0.0

type AgentCheckinOutput struct {
	AuthToken                  *string                `json:"authToken,omitempty"`
	RequiredAgentVersion       *string                `json:"requiredAgentVersion,omitempty"`
	WorkerEnvironmentVariables *[]EnvironmentVariable `json:"workerEnvironmentVariables,omitempty"`
	WorkerImageURI             *string                `json:"workerImageURI,omitempty"`
}

AgentCheckinOutput defines model for agentCheckinOutput.

type AgentCheckinResponse added in v1.0.0

type AgentCheckinResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AgentCheckinOutput
}

func ParseAgentCheckinResponse added in v1.0.0

func ParseAgentCheckinResponse(rsp *http.Response) (*AgentCheckinResponse, error)

ParseAgentCheckinResponse parses an HTTP response from a AgentCheckinWithResponse call

func (AgentCheckinResponse) Status added in v1.0.0

func (r AgentCheckinResponse) Status() string

Status returns HTTPResponse.Status

func (AgentCheckinResponse) StatusCode added in v1.0.0

func (r AgentCheckinResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AgentHeartbeatInput

type AgentHeartbeatInput struct {
	AgentName  *string      `json:"agentName,omitempty"`
	PoolLabels *[]PoolLabel `json:"poolLabels,omitempty"`
	TaskName   *TaskName    `json:"taskName,omitempty"`
	TaskStatus *TaskStatus  `json:"taskStatus,omitempty"`
}

AgentHeartbeatInput defines model for agentHeartbeatInput.

type AgentHeartbeatJSONRequestBody

type AgentHeartbeatJSONRequestBody = AgentHeartbeatInput

AgentHeartbeatJSONRequestBody defines body for AgentHeartbeat for application/json ContentType.

type AgentHeartbeatResponse

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

func ParseAgentHeartbeatResponse

func ParseAgentHeartbeatResponse(rsp *http.Response) (*AgentHeartbeatResponse, error)

ParseAgentHeartbeatResponse parses an HTTP response from a AgentHeartbeatWithResponse call

func (AgentHeartbeatResponse) Status

func (r AgentHeartbeatResponse) Status() string

Status returns HTTPResponse.Status

func (AgentHeartbeatResponse) StatusCode

func (r AgentHeartbeatResponse) 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) AgentAPIPing

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

func (*Client) AgentCheckin added in v1.0.0

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

func (*Client) AgentCheckinWithBody added in v1.0.0

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

func (*Client) AgentHeartbeat

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

func (*Client) AgentHeartbeatWithBody

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

func (*Client) Health

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

func (*Client) TaskPoll

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

func (*Client) TaskPollWithBody

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

func (*Client) UpdateTask

func (c *Client) UpdateTask(ctx context.Context, taskName TaskName, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateTaskWithBody

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

type ClientInterface

type ClientInterface interface {
	// AgentCheckinWithBody request with any body
	AgentCheckinWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AgentCheckin(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AgentAPIPing request
	AgentAPIPing(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Health request
	Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AgentHeartbeatWithBody request with any body
	AgentHeartbeatWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AgentHeartbeat(ctx context.Context, body AgentHeartbeatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TaskPollWithBody request with any body
	TaskPollWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	TaskPoll(ctx context.Context, body TaskPollJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTaskWithBody request with any body
	UpdateTaskWithBody(ctx context.Context, taskName TaskName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateTask(ctx context.Context, taskName TaskName, body UpdateTaskJSONRequestBody, 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) AgentAPIPingWithResponse

func (c *ClientWithResponses) AgentAPIPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AgentAPIPingResponse, error)

AgentAPIPingWithResponse request returning *AgentAPIPingResponse

func (*ClientWithResponses) AgentCheckinWithBodyWithResponse added in v1.0.0

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

AgentCheckinWithBodyWithResponse request with arbitrary body returning *AgentCheckinResponse

func (*ClientWithResponses) AgentCheckinWithResponse added in v1.0.0

func (c *ClientWithResponses) AgentCheckinWithResponse(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)

func (*ClientWithResponses) AgentHeartbeatWithBodyWithResponse

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

AgentHeartbeatWithBodyWithResponse request with arbitrary body returning *AgentHeartbeatResponse

func (*ClientWithResponses) AgentHeartbeatWithResponse

func (c *ClientWithResponses) AgentHeartbeatWithResponse(ctx context.Context, body AgentHeartbeatJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentHeartbeatResponse, error)

func (*ClientWithResponses) HealthWithResponse

func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)

HealthWithResponse request returning *HealthResponse

func (*ClientWithResponses) TaskPollWithBodyWithResponse

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

TaskPollWithBodyWithResponse request with arbitrary body returning *TaskPollResponse

func (*ClientWithResponses) TaskPollWithResponse

func (c *ClientWithResponses) TaskPollWithResponse(ctx context.Context, body TaskPollJSONRequestBody, reqEditors ...RequestEditorFn) (*TaskPollResponse, error)

func (*ClientWithResponses) UpdateTaskWithBodyWithResponse

func (c *ClientWithResponses) UpdateTaskWithBodyWithResponse(ctx context.Context, taskName TaskName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)

UpdateTaskWithBodyWithResponse request with arbitrary body returning *UpdateTaskResponse

func (*ClientWithResponses) UpdateTaskWithResponse

func (c *ClientWithResponses) UpdateTaskWithResponse(ctx context.Context, taskName TaskName, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// AgentCheckinWithBodyWithResponse request with any body
	AgentCheckinWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)

	AgentCheckinWithResponse(ctx context.Context, body AgentCheckinJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentCheckinResponse, error)

	// AgentAPIPingWithResponse request
	AgentAPIPingWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AgentAPIPingResponse, error)

	// HealthWithResponse request
	HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)

	// AgentHeartbeatWithBodyWithResponse request with any body
	AgentHeartbeatWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AgentHeartbeatResponse, error)

	AgentHeartbeatWithResponse(ctx context.Context, body AgentHeartbeatJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentHeartbeatResponse, error)

	// TaskPollWithBodyWithResponse request with any body
	TaskPollWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TaskPollResponse, error)

	TaskPollWithResponse(ctx context.Context, body TaskPollJSONRequestBody, reqEditors ...RequestEditorFn) (*TaskPollResponse, error)

	// UpdateTaskWithBodyWithResponse request with any body
	UpdateTaskWithBodyWithResponse(ctx context.Context, taskName TaskName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)

	UpdateTaskWithResponse(ctx context.Context, taskName TaskName, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)
}

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

type EnvironmentVariable

type EnvironmentVariable = []string

EnvironmentVariable defines model for environmentVariable.

type ErrorType added in v0.3.0

type ErrorType string

ErrorType defines model for errorType.

const (
	AGENTERRORPULLINGWORKERIMAGE ErrorType = "AGENT_ERROR_PULLING_WORKER_IMAGE"
	AGENTERRORRUNNINGWORKER      ErrorType = "AGENT_ERROR_RUNNING_WORKER"
	CUSTOMERWORKLOADERROR        ErrorType = "CUSTOMER_WORKLOAD_ERROR"
	Empty                        ErrorType = ""
	NONZEROEXITCODE              ErrorType = "NONZERO_EXIT_CODE"
	UNKNOWNERROR                 ErrorType = "UNKNOWN_ERROR"
	UNKNOWNWORKERERROR           ErrorType = "UNKNOWN_WORKER_ERROR"
)

Defines values for ErrorType.

type HealthResponse

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

func ParseHealthResponse

func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error)

ParseHealthResponse parses an HTTP response from a HealthWithResponse call

func (HealthResponse) Status

func (r HealthResponse) Status() string

Status returns HTTPResponse.Status

func (HealthResponse) StatusCode

func (r HealthResponse) 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 PoolLabel

type PoolLabel = string

PoolLabel defines model for poolLabel.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type TagPair

type TagPair = []string

TagPair defines model for tagPair.

type TaskName

type TaskName = string

TaskName defines model for taskName.

type TaskPollInput

type TaskPollInput struct {
	AgentID    string      `json:"agentID"`
	PoolLabels []PoolLabel `json:"poolLabels"`
}

TaskPollInput defines model for taskPollInput.

type TaskPollJSONRequestBody

type TaskPollJSONRequestBody = TaskPollInput

TaskPollJSONRequestBody defines body for TaskPoll for application/json ContentType.

type TaskPollOutput

type TaskPollOutput struct {
	ContainerTimeout           string                 `json:"containerTimeout"`
	RunCounter                 *int                   `json:"runCounter,omitempty"`
	Tags                       *[]TagPair             `json:"tags,omitempty"`
	TaskName                   *TaskName              `json:"taskName,omitempty"`
	WorkerEnvironmentVariables *[]EnvironmentVariable `json:"workerEnvironmentVariables,omitempty"`
	WorkerImageURI             *string                `json:"workerImageURI,omitempty"`
}

TaskPollOutput defines model for taskPollOutput.

type TaskPollResponse

type TaskPollResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TaskPollOutput
}

func ParseTaskPollResponse

func ParseTaskPollResponse(rsp *http.Response) (*TaskPollResponse, error)

ParseTaskPollResponse parses an HTTP response from a TaskPollWithResponse call

func (TaskPollResponse) Status

func (r TaskPollResponse) Status() string

Status returns HTTPResponse.Status

func (TaskPollResponse) StatusCode

func (r TaskPollResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TaskStatus

type TaskStatus string

TaskStatus defines model for taskStatus.

const (
	ERROR     TaskStatus = "ERROR"
	RUNNING   TaskStatus = "RUNNING"
	SUBMITTED TaskStatus = "SUBMITTED"
	SUCCEEDED TaskStatus = "SUCCEEDED"
)

Defines values for TaskStatus.

type UpdateTaskInput

type UpdateTaskInput struct {
	ErrorType *ErrorType  `json:"errorType"`
	Output    *string     `json:"output"`
	Status    *TaskStatus `json:"status,omitempty"`
}

UpdateTaskInput defines model for updateTaskInput.

type UpdateTaskJSONRequestBody

type UpdateTaskJSONRequestBody = UpdateTaskInput

UpdateTaskJSONRequestBody defines body for UpdateTask for application/json ContentType.

type UpdateTaskResponse

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

func ParseUpdateTaskResponse

func ParseUpdateTaskResponse(rsp *http.Response) (*UpdateTaskResponse, error)

ParseUpdateTaskResponse parses an HTTP response from a UpdateTaskWithResponse call

func (UpdateTaskResponse) Status

func (r UpdateTaskResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateTaskResponse) StatusCode

func (r UpdateTaskResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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