client

package
v0.0.0-...-3384764 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentHeartbeatRequest

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

NewAgentHeartbeatRequest calls the generic AgentHeartbeat builder with application/json body

func NewAgentHeartbeatRequestWithBody

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

NewAgentHeartbeatRequestWithBody generates requests for AgentHeartbeat with any type of body

func NewCreateAgentRequest

func NewCreateAgentRequest(server string, body CreateAgentJSONRequestBody) (*http.Request, error)

NewCreateAgentRequest calls the generic CreateAgent builder with application/json body

func NewCreateAgentRequestWithBody

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

NewCreateAgentRequestWithBody generates requests for CreateAgent with any type of body

func NewGetAgentRequest

func NewGetAgentRequest(server string, agentId AgentIdPath) (*http.Request, error)

NewGetAgentRequest generates requests for GetAgent

func NewListAgentsRequest

func NewListAgentsRequest(server string, params *ListAgentsParams) (*http.Request, error)

NewListAgentsRequest generates requests for ListAgents

Types

type AgentHeartbeatResponse

type AgentHeartbeatResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *Agent
	ApplicationproblemJSON400     *Error
	ApplicationproblemJSON404     *Error
	ApplicationproblemJSONDefault *Error
}

func ParseAgentHeartbeatResponse

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

ParseAgentHeartbeatResponse parses an HTTP response from a AgentHeartbeatWithResponse call

func (AgentHeartbeatResponse) ContentType

func (r AgentHeartbeatResponse) ContentType() string

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

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

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

func (*Client) AgentHeartbeatWithBody

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

func (*Client) CreateAgent

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

func (*Client) CreateAgentWithBody

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

func (*Client) GetAgent

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

func (*Client) ListAgents

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

type ClientInterface

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

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

	CreateAgent(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAgent request
	GetAgent(ctx context.Context, agentId AgentIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	AgentHeartbeat(ctx context.Context, agentId AgentIdPath, body AgentHeartbeatJSONRequestBody, 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) AgentHeartbeatWithBodyWithResponse

func (c *ClientWithResponses) AgentHeartbeatWithBodyWithResponse(ctx context.Context, agentId AgentIdPath, 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, agentId AgentIdPath, body AgentHeartbeatJSONRequestBody, reqEditors ...RequestEditorFn) (*AgentHeartbeatResponse, error)

func (*ClientWithResponses) CreateAgentWithBodyWithResponse

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

CreateAgentWithBodyWithResponse request with arbitrary body returning *CreateAgentResponse

func (*ClientWithResponses) CreateAgentWithResponse

func (c *ClientWithResponses) CreateAgentWithResponse(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

func (*ClientWithResponses) GetAgentWithResponse

func (c *ClientWithResponses) GetAgentWithResponse(ctx context.Context, agentId AgentIdPath, reqEditors ...RequestEditorFn) (*GetAgentResponse, error)

GetAgentWithResponse request returning *GetAgentResponse

func (*ClientWithResponses) ListAgentsWithResponse

func (c *ClientWithResponses) ListAgentsWithResponse(ctx context.Context, params *ListAgentsParams, reqEditors ...RequestEditorFn) (*ListAgentsResponse, error)

ListAgentsWithResponse request returning *ListAgentsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListAgentsWithResponse request
	ListAgentsWithResponse(ctx context.Context, params *ListAgentsParams, reqEditors ...RequestEditorFn) (*ListAgentsResponse, error)

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

	CreateAgentWithResponse(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

	// GetAgentWithResponse request
	GetAgentWithResponse(ctx context.Context, agentId AgentIdPath, reqEditors ...RequestEditorFn) (*GetAgentResponse, error)

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

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

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

type CreateAgentResponse

type CreateAgentResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *Agent
	JSON201                       *Agent
	ApplicationproblemJSON400     *Error
	ApplicationproblemJSON409     *Error
	ApplicationproblemJSONDefault *Error
}

func ParseCreateAgentResponse

func ParseCreateAgentResponse(rsp *http.Response) (*CreateAgentResponse, error)

ParseCreateAgentResponse parses an HTTP response from a CreateAgentWithResponse call

func (CreateAgentResponse) ContentType

func (r CreateAgentResponse) ContentType() string

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

func (CreateAgentResponse) Status

func (r CreateAgentResponse) Status() string

Status returns HTTPResponse.Status

func (CreateAgentResponse) StatusCode

func (r CreateAgentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetAgentResponse

type GetAgentResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *Agent
	ApplicationproblemJSON400     *Error
	ApplicationproblemJSON404     *Error
	ApplicationproblemJSONDefault *Error
}

func ParseGetAgentResponse

func ParseGetAgentResponse(rsp *http.Response) (*GetAgentResponse, error)

ParseGetAgentResponse parses an HTTP response from a GetAgentWithResponse call

func (GetAgentResponse) ContentType

func (r GetAgentResponse) ContentType() string

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

func (GetAgentResponse) Status

func (r GetAgentResponse) Status() string

Status returns HTTPResponse.Status

func (GetAgentResponse) StatusCode

func (r GetAgentResponse) 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 ListAgentsResponse

type ListAgentsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *AgentList
	ApplicationproblemJSON400     *Error
	ApplicationproblemJSONDefault *Error
}

func ParseListAgentsResponse

func ParseListAgentsResponse(rsp *http.Response) (*ListAgentsResponse, error)

ParseListAgentsResponse parses an HTTP response from a ListAgentsWithResponse call

func (ListAgentsResponse) ContentType

func (r ListAgentsResponse) ContentType() string

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

func (ListAgentsResponse) Status

func (r ListAgentsResponse) Status() string

Status returns HTTPResponse.Status

func (ListAgentsResponse) StatusCode

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

Jump to

Keyboard shortcuts

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