oapi

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfirmMessagesRequest added in v0.4.0

func NewConfirmMessagesRequest(server string, params *ConfirmMessagesParams, body ConfirmMessagesJSONRequestBody) (*http.Request, error)

NewConfirmMessagesRequest calls the generic ConfirmMessages builder with application/json body

func NewConfirmMessagesRequestWithBody added in v0.4.0

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

NewConfirmMessagesRequestWithBody generates requests for ConfirmMessages with any type of body

func NewDeleteEndpointRequest added in v0.6.0

func NewDeleteEndpointRequest(server string, externalId ExternalId, params *DeleteEndpointParams) (*http.Request, error)

NewDeleteEndpointRequest generates requests for DeleteEndpoint

func NewListAuthorizedTenantsRequest added in v0.8.0

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

NewListAuthorizedTenantsRequest generates requests for ListAuthorizedTenants

func NewListTenantEndpointsRequest added in v0.8.0

func NewListTenantEndpointsRequest(server string, tenantId TenantId) (*http.Request, error)

NewListTenantEndpointsRequest generates requests for ListTenantEndpoints

func NewPutEndpointRequest

func NewPutEndpointRequest(server string, externalId ExternalId, params *PutEndpointParams, body PutEndpointJSONRequestBody) (*http.Request, error)

NewPutEndpointRequest calls the generic PutEndpoint builder with application/json body

func NewPutEndpointRequestWithBody

func NewPutEndpointRequestWithBody(server string, externalId ExternalId, params *PutEndpointParams, contentType string, body io.Reader) (*http.Request, error)

NewPutEndpointRequestWithBody generates requests for PutEndpoint with any type of body

func NewReceiveEventsRequest added in v0.2.0

func NewReceiveEventsRequest(server string, params *ReceiveEventsParams) (*http.Request, error)

NewReceiveEventsRequest generates requests for ReceiveEvents

func NewSendMessagesRequestWithBody

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

NewSendMessagesRequestWithBody generates requests for SendMessages with any type of body

Types

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) ConfirmMessages added in v0.4.0

func (c *Client) ConfirmMessages(ctx context.Context, params *ConfirmMessagesParams, body ConfirmMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ConfirmMessagesWithBody added in v0.4.0

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

func (*Client) DeleteEndpoint added in v0.6.0

func (c *Client) DeleteEndpoint(ctx context.Context, externalId ExternalId, params *DeleteEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListAuthorizedTenants added in v0.8.0

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

func (*Client) ListTenantEndpoints added in v0.8.0

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

func (*Client) PutEndpoint

func (c *Client) PutEndpoint(ctx context.Context, externalId ExternalId, params *PutEndpointParams, body PutEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PutEndpointWithBody

func (c *Client) PutEndpointWithBody(ctx context.Context, externalId ExternalId, params *PutEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ReceiveEvents added in v0.2.0

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

func (*Client) SendMessagesWithBody

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

type ClientInterface

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

	ConfirmMessages(ctx context.Context, params *ConfirmMessagesParams, body ConfirmMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteEndpoint request
	DeleteEndpoint(ctx context.Context, externalId ExternalId, params *DeleteEndpointParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutEndpointWithBody request with any body
	PutEndpointWithBody(ctx context.Context, externalId ExternalId, params *PutEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PutEndpoint(ctx context.Context, externalId ExternalId, params *PutEndpointParams, body PutEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReceiveEvents request
	ReceiveEvents(ctx context.Context, params *ReceiveEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	// ListTenantEndpoints request
	ListTenantEndpoints(ctx context.Context, tenantId TenantId, 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) ConfirmMessagesWithBodyWithResponse added in v0.4.0

func (c *ClientWithResponses) ConfirmMessagesWithBodyWithResponse(ctx context.Context, params *ConfirmMessagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfirmMessagesResponse, error)

ConfirmMessagesWithBodyWithResponse request with arbitrary body returning *ConfirmMessagesResponse

func (*ClientWithResponses) ConfirmMessagesWithResponse added in v0.4.0

func (c *ClientWithResponses) ConfirmMessagesWithResponse(ctx context.Context, params *ConfirmMessagesParams, body ConfirmMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmMessagesResponse, error)

func (*ClientWithResponses) DeleteEndpointWithResponse added in v0.6.0

func (c *ClientWithResponses) DeleteEndpointWithResponse(ctx context.Context, externalId ExternalId, params *DeleteEndpointParams, reqEditors ...RequestEditorFn) (*DeleteEndpointResponse, error)

DeleteEndpointWithResponse request returning *DeleteEndpointResponse

func (*ClientWithResponses) ListAuthorizedTenantsWithResponse added in v0.8.0

func (c *ClientWithResponses) ListAuthorizedTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAuthorizedTenantsResponse, error)

ListAuthorizedTenantsWithResponse request returning *ListAuthorizedTenantsResponse

func (*ClientWithResponses) ListTenantEndpointsWithResponse added in v0.8.0

func (c *ClientWithResponses) ListTenantEndpointsWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*ListTenantEndpointsResponse, error)

ListTenantEndpointsWithResponse request returning *ListTenantEndpointsResponse

func (*ClientWithResponses) PutEndpointWithBodyWithResponse

func (c *ClientWithResponses) PutEndpointWithBodyWithResponse(ctx context.Context, externalId ExternalId, params *PutEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutEndpointResponse, error)

PutEndpointWithBodyWithResponse request with arbitrary body returning *PutEndpointResponse

func (*ClientWithResponses) PutEndpointWithResponse

func (c *ClientWithResponses) PutEndpointWithResponse(ctx context.Context, externalId ExternalId, params *PutEndpointParams, body PutEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*PutEndpointResponse, error)

func (*ClientWithResponses) ReceiveEventsWithResponse added in v0.2.0

func (c *ClientWithResponses) ReceiveEventsWithResponse(ctx context.Context, params *ReceiveEventsParams, reqEditors ...RequestEditorFn) (*ReceiveEventsResponse, error)

ReceiveEventsWithResponse request returning *ReceiveEventsResponse

func (*ClientWithResponses) SendMessagesWithBodyWithResponse

func (c *ClientWithResponses) SendMessagesWithBodyWithResponse(ctx context.Context, params *SendMessagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendMessagesResponse, error)

SendMessagesWithBodyWithResponse request with arbitrary body returning *SendMessagesResponse

type ClientWithResponsesInterface

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

	ConfirmMessagesWithResponse(ctx context.Context, params *ConfirmMessagesParams, body ConfirmMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmMessagesResponse, error)

	// DeleteEndpointWithResponse request
	DeleteEndpointWithResponse(ctx context.Context, externalId ExternalId, params *DeleteEndpointParams, reqEditors ...RequestEditorFn) (*DeleteEndpointResponse, error)

	// PutEndpointWithBodyWithResponse request with any body
	PutEndpointWithBodyWithResponse(ctx context.Context, externalId ExternalId, params *PutEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutEndpointResponse, error)

	PutEndpointWithResponse(ctx context.Context, externalId ExternalId, params *PutEndpointParams, body PutEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*PutEndpointResponse, error)

	// ReceiveEventsWithResponse request
	ReceiveEventsWithResponse(ctx context.Context, params *ReceiveEventsParams, reqEditors ...RequestEditorFn) (*ReceiveEventsResponse, error)

	// SendMessagesWithBodyWithResponse request with any body
	SendMessagesWithBodyWithResponse(ctx context.Context, params *SendMessagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendMessagesResponse, error)

	// ListAuthorizedTenantsWithResponse request
	ListAuthorizedTenantsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAuthorizedTenantsResponse, error)

	// ListTenantEndpointsWithResponse request
	ListTenantEndpointsWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*ListTenantEndpointsResponse, error)
}

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

type ConfirmMessagesResponse added in v0.4.0

type ConfirmMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
}

func ParseConfirmMessagesResponse added in v0.4.0

func ParseConfirmMessagesResponse(rsp *http.Response) (*ConfirmMessagesResponse, error)

ParseConfirmMessagesResponse parses an HTTP response from a ConfirmMessagesWithResponse call

func (ConfirmMessagesResponse) Status added in v0.4.0

func (r ConfirmMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (ConfirmMessagesResponse) StatusCode added in v0.4.0

func (r ConfirmMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteEndpointResponse added in v0.6.0

type DeleteEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
	JSON404      *ErrorResponse
}

func ParseDeleteEndpointResponse added in v0.6.0

func ParseDeleteEndpointResponse(rsp *http.Response) (*DeleteEndpointResponse, error)

ParseDeleteEndpointResponse parses an HTTP response from a DeleteEndpointWithResponse call

func (DeleteEndpointResponse) Status added in v0.6.0

func (r DeleteEndpointResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteEndpointResponse) StatusCode added in v0.6.0

func (r DeleteEndpointResponse) 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 ListAuthorizedTenantsResponse added in v0.8.0

type ListAuthorizedTenantsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TenantsListResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
}

func ParseListAuthorizedTenantsResponse added in v0.8.0

func ParseListAuthorizedTenantsResponse(rsp *http.Response) (*ListAuthorizedTenantsResponse, error)

ParseListAuthorizedTenantsResponse parses an HTTP response from a ListAuthorizedTenantsWithResponse call

func (ListAuthorizedTenantsResponse) Status added in v0.8.0

Status returns HTTPResponse.Status

func (ListAuthorizedTenantsResponse) StatusCode added in v0.8.0

func (r ListAuthorizedTenantsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListTenantEndpointsResponse added in v0.8.0

type ListTenantEndpointsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EndpointsListResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
}

func ParseListTenantEndpointsResponse added in v0.8.0

func ParseListTenantEndpointsResponse(rsp *http.Response) (*ListTenantEndpointsResponse, error)

ParseListTenantEndpointsResponse parses an HTTP response from a ListTenantEndpointsWithResponse call

func (ListTenantEndpointsResponse) Status added in v0.8.0

Status returns HTTPResponse.Status

func (ListTenantEndpointsResponse) StatusCode added in v0.8.0

func (r ListTenantEndpointsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutEndpointResponse

type PutEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Endpoint
	JSON201      *Endpoint
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
	JSON413      *ErrorResponse
}

func ParsePutEndpointResponse

func ParsePutEndpointResponse(rsp *http.Response) (*PutEndpointResponse, error)

ParsePutEndpointResponse parses an HTTP response from a PutEndpointWithResponse call

func (PutEndpointResponse) Status

func (r PutEndpointResponse) Status() string

Status returns HTTPResponse.Status

func (PutEndpointResponse) StatusCode

func (r PutEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ReceiveEventsResponse added in v0.2.0

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

func ParseReceiveEventsResponse added in v0.2.0

func ParseReceiveEventsResponse(rsp *http.Response) (*ReceiveEventsResponse, error)

ParseReceiveEventsResponse parses an HTTP response from a ReceiveEventsWithResponse call

func (ReceiveEventsResponse) Status added in v0.2.0

func (r ReceiveEventsResponse) Status() string

Status returns HTTPResponse.Status

func (ReceiveEventsResponse) StatusCode added in v0.2.0

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

type SendMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
	JSON413      *ErrorResponse
}

func ParseSendMessagesResponse

func ParseSendMessagesResponse(rsp *http.Response) (*SendMessagesResponse, error)

ParseSendMessagesResponse parses an HTTP response from a SendMessagesWithResponse call

func (SendMessagesResponse) Status

func (r SendMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (SendMessagesResponse) StatusCode

func (r SendMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Directories

Path Synopsis
Package models provides primitives to interact with the openapi HTTP API.
Package models provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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