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 ¶
- func NewAgentHeartbeatRequest(server string, agentId AgentIdPath, body AgentHeartbeatJSONRequestBody) (*http.Request, error)
- func NewAgentHeartbeatRequestWithBody(server string, agentId AgentIdPath, contentType string, body io.Reader) (*http.Request, error)
- func NewCreateAgentRequest(server string, body CreateAgentJSONRequestBody) (*http.Request, error)
- func NewCreateAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetAgentRequest(server string, agentId AgentIdPath) (*http.Request, error)
- func NewListAgentsRequest(server string, params *ListAgentsParams) (*http.Request, error)
- type AgentHeartbeatResponse
- type Client
- func (c *Client) AgentHeartbeat(ctx context.Context, agentId AgentIdPath, body AgentHeartbeatJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) AgentHeartbeatWithBody(ctx context.Context, agentId AgentIdPath, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CreateAgent(ctx context.Context, body CreateAgentJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateAgentWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetAgent(ctx context.Context, agentId AgentIdPath, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListAgents(ctx context.Context, params *ListAgentsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AgentHeartbeatWithBodyWithResponse(ctx context.Context, agentId AgentIdPath, contentType string, body io.Reader, ...) (*AgentHeartbeatResponse, error)
- func (c *ClientWithResponses) AgentHeartbeatWithResponse(ctx context.Context, agentId AgentIdPath, body AgentHeartbeatJSONRequestBody, ...) (*AgentHeartbeatResponse, error)
- func (c *ClientWithResponses) CreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateAgentResponse, error)
- func (c *ClientWithResponses) CreateAgentWithResponse(ctx context.Context, body CreateAgentJSONRequestBody, ...) (*CreateAgentResponse, error)
- func (c *ClientWithResponses) GetAgentWithResponse(ctx context.Context, agentId AgentIdPath, reqEditors ...RequestEditorFn) (*GetAgentResponse, error)
- func (c *ClientWithResponses) ListAgentsWithResponse(ctx context.Context, params *ListAgentsParams, reqEditors ...RequestEditorFn) (*ListAgentsResponse, error)
- type ClientWithResponsesInterface
- type CreateAgentResponse
- type GetAgentResponse
- type HttpRequestDoer
- type ListAgentsResponse
- type RequestEditorFn
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 ¶
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 ¶
NewGetAgentRequest generates requests for GetAgent
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 (*Client) AgentHeartbeatWithBody ¶
func (*Client) CreateAgent ¶
func (*Client) CreateAgentWithBody ¶
func (*Client) ListAgents ¶
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 ¶
ClientOption allows setting custom parameters during construction
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 ¶
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