gen

package
v0.0.0-...-c8da0d6 Latest Latest
Warning

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

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

README

go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 \
    -package gen \
    -generate types,client \
    -o api.gen.go \
    openapi-3.0.json

Documentation

Overview

Package gen 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

This section is empty.

Variables

This section is empty.

Functions

func NewGetMessagesRequest

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

NewGetMessagesRequest generates requests for GetMessages

func NewGetStatusRequest

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

NewGetStatusRequest generates requests for GetStatus

func NewPostMessageRequest

func NewPostMessageRequest(server string, body PostMessageJSONRequestBody) (*http.Request, error)

NewPostMessageRequest calls the generic PostMessage builder with application/json body

func NewPostMessageRequestWithBody

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

NewPostMessageRequestWithBody generates requests for PostMessage with any type of body

func NewSubscribeEventsRequest

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

NewSubscribeEventsRequest generates requests for SubscribeEvents

Types

type AgentStatus

type AgentStatus string

AgentStatus defines model for AgentStatus.

const (
	Running AgentStatus = "running"
	Stable  AgentStatus = "stable"
)

Defines values for AgentStatus.

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) GetMessages

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

func (*Client) GetStatus

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

func (*Client) PostMessage

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

func (*Client) PostMessageWithBody

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

func (*Client) SubscribeEvents

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

type ClientInterface

type ClientInterface interface {
	// SubscribeEvents request
	SubscribeEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	PostMessage(ctx context.Context, body PostMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetStatus request
	GetStatus(ctx context.Context, 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) GetMessagesWithResponse

func (c *ClientWithResponses) GetMessagesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMessagesResponse, error)

GetMessagesWithResponse request returning *GetMessagesResponse

func (*ClientWithResponses) GetStatusWithResponse

func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)

GetStatusWithResponse request returning *GetStatusResponse

func (*ClientWithResponses) PostMessageWithBodyWithResponse

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

PostMessageWithBodyWithResponse request with arbitrary body returning *PostMessageResponse

func (*ClientWithResponses) PostMessageWithResponse

func (c *ClientWithResponses) PostMessageWithResponse(ctx context.Context, body PostMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMessageResponse, error)

func (*ClientWithResponses) SubscribeEventsWithResponse

func (c *ClientWithResponses) SubscribeEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SubscribeEventsResponse, error)

SubscribeEventsWithResponse request returning *SubscribeEventsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// SubscribeEventsWithResponse request
	SubscribeEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SubscribeEventsResponse, error)

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

	PostMessageWithResponse(ctx context.Context, body PostMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMessageResponse, error)

	// GetMessagesWithResponse request
	GetMessagesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMessagesResponse, error)

	// GetStatusWithResponse request
	GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
}

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

type ConversationRole

type ConversationRole string

ConversationRole defines model for ConversationRole.

const (
	ConversationRoleAgent ConversationRole = "agent"
	ConversationRoleUser  ConversationRole = "user"
)

Defines values for ConversationRole.

type ErrorDetail

type ErrorDetail struct {
	// Location Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
	Location *string `json:"location,omitempty"`

	// Message Error message text
	Message *string `json:"message,omitempty"`

	// Value The value at the given location
	Value *interface{} `json:"value,omitempty"`
}

ErrorDetail defines model for ErrorDetail.

type ErrorModel

type ErrorModel struct {
	// Schema A URL to the JSON Schema for this object.
	Schema *string `json:"$schema,omitempty"`

	// Detail A human-readable explanation specific to this occurrence of the problem.
	Detail *string `json:"detail,omitempty"`

	// Errors Optional list of individual error details
	Errors *[]ErrorDetail `json:"errors"`

	// Instance A URI reference that identifies the specific occurrence of the problem.
	Instance *string `json:"instance,omitempty"`

	// Status HTTP status code
	Status *int64 `json:"status,omitempty"`

	// Title A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
	Title *string `json:"title,omitempty"`

	// Type A URI reference to human-readable documentation for the error.
	Type *string `json:"type,omitempty"`
}

ErrorModel defines model for ErrorModel.

type GetMessagesResponse

type GetMessagesResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *MessagesResponseBody
	ApplicationproblemJSONDefault *ErrorModel
}

func ParseGetMessagesResponse

func ParseGetMessagesResponse(rsp *http.Response) (*GetMessagesResponse, error)

ParseGetMessagesResponse parses an HTTP response from a GetMessagesWithResponse call

func (GetMessagesResponse) Status

func (r GetMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (GetMessagesResponse) StatusCode

func (r GetMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetStatusResponse

type GetStatusResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *StatusResponseBody
	ApplicationproblemJSONDefault *ErrorModel
}

func ParseGetStatusResponse

func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)

ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call

func (GetStatusResponse) Status

func (r GetStatusResponse) Status() string

Status returns HTTPResponse.Status

func (GetStatusResponse) StatusCode

func (r GetStatusResponse) 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 Message

type Message struct {
	// Content Message content. The message is formatted as it appears in the agent's terminal session, meaning it consists of lines of text with 80 characters per line.
	Content string `json:"content"`

	// Id Unique identifier for the message. This identifier also represents the order of the message in the conversation history.
	Id   int64            `json:"id"`
	Role ConversationRole `json:"role"`

	// Time Timestamp of the message
	Time time.Time `json:"time"`
}

Message defines model for Message.

type MessageRequestBody

type MessageRequestBody struct {
	// Schema A URL to the JSON Schema for this object.
	Schema *string `json:"$schema,omitempty"`

	// Content Message content
	Content string      `json:"content"`
	Type    MessageType `json:"type"`
}

MessageRequestBody defines model for MessageRequestBody.

type MessageResponseBody

type MessageResponseBody struct {
	// Schema A URL to the JSON Schema for this object.
	Schema *string `json:"$schema,omitempty"`

	// Ok Indicates whether the message was sent successfully. For messages of type 'user', success means detecting that the agent began executing the task described. For messages of type 'raw', success means the keystrokes were sent to the terminal.
	Ok bool `json:"ok"`
}

MessageResponseBody defines model for MessageResponseBody.

type MessageType

type MessageType string

MessageType defines model for MessageType.

const (
	MessageTypeRaw  MessageType = "raw"
	MessageTypeUser MessageType = "user"
)

Defines values for MessageType.

type MessageUpdateBody

type MessageUpdateBody struct {
	// Id Unique identifier for the message. This identifier also represents the order of the message in the conversation history.
	Id int64 `json:"id"`

	// Message Message content. The message is formatted as it appears in the agent's terminal session, meaning it consists of lines of text with 80 characters per line.
	Message string           `json:"message"`
	Role    ConversationRole `json:"role"`

	// Time Timestamp of the message
	Time time.Time `json:"time"`
}

MessageUpdateBody defines model for MessageUpdateBody.

type MessagesResponseBody

type MessagesResponseBody struct {
	// Schema A URL to the JSON Schema for this object.
	Schema *string `json:"$schema,omitempty"`

	// Messages List of messages
	Messages []Message `json:"messages"`
}

MessagesResponseBody defines model for MessagesResponseBody.

type PostMessageJSONRequestBody

type PostMessageJSONRequestBody = MessageRequestBody

PostMessageJSONRequestBody defines body for PostMessage for application/json ContentType.

type PostMessageResponse

type PostMessageResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *MessageResponseBody
	ApplicationproblemJSONDefault *ErrorModel
}

func ParsePostMessageResponse

func ParsePostMessageResponse(rsp *http.Response) (*PostMessageResponse, error)

ParsePostMessageResponse parses an HTTP response from a PostMessageWithResponse call

func (PostMessageResponse) Status

func (r PostMessageResponse) Status() string

Status returns HTTPResponse.Status

func (PostMessageResponse) StatusCode

func (r PostMessageResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type StatusChangeBody

type StatusChangeBody struct {
	Status AgentStatus `json:"status"`
}

StatusChangeBody defines model for StatusChangeBody.

type StatusResponseBody

type StatusResponseBody struct {
	// Schema A URL to the JSON Schema for this object.
	Schema *string     `json:"$schema,omitempty"`
	Status AgentStatus `json:"status"`
}

StatusResponseBody defines model for StatusResponseBody.

type SubscribeEventsResponse

type SubscribeEventsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSONDefault *ErrorModel
}

func ParseSubscribeEventsResponse

func ParseSubscribeEventsResponse(rsp *http.Response) (*SubscribeEventsResponse, error)

ParseSubscribeEventsResponse parses an HTTP response from a SubscribeEventsWithResponse call

func (SubscribeEventsResponse) Status

func (r SubscribeEventsResponse) Status() string

Status returns HTTPResponse.Status

func (SubscribeEventsResponse) StatusCode

func (r SubscribeEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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