Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 11 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.7.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAckMessagesRequest

func NewAckMessagesRequest(server string, subscriptionId SubscriptionId, body AckMessagesJSONRequestBody) (*http.Request, error)

NewAckMessagesRequest calls the generic AckMessages builder with application/json body

func NewAckMessagesRequestWithBody

func NewAckMessagesRequestWithBody(server string, subscriptionId SubscriptionId, contentType string, body io.Reader) (*http.Request, error)

NewAckMessagesRequestWithBody generates requests for AckMessages with any type of body

func NewNackMessagesRequest

func NewNackMessagesRequest(server string, subscriptionId SubscriptionId, body NackMessagesJSONRequestBody) (*http.Request, error)

NewNackMessagesRequest calls the generic NackMessages builder with application/json body

func NewNackMessagesRequestWithBody

func NewNackMessagesRequestWithBody(server string, subscriptionId SubscriptionId, contentType string, body io.Reader) (*http.Request, error)

NewNackMessagesRequestWithBody generates requests for NackMessages with any type of body

func NewPublishMessagesRequest

func NewPublishMessagesRequest(server string, body PublishMessagesJSONRequestBody) (*http.Request, error)

NewPublishMessagesRequest calls the generic PublishMessages builder with application/json body

func NewPublishMessagesRequestWithBody

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

NewPublishMessagesRequestWithBody generates requests for PublishMessages with any type of body

func NewPullMessagesRequest

func NewPullMessagesRequest(server string, subscriptionId SubscriptionId, params *PullMessagesParams) (*http.Request, error)

NewPullMessagesRequest generates requests for PullMessages

func NewPurgeTopicRequest

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

NewPurgeTopicRequest generates requests for PurgeTopic

Types

type AckMessagesFromTopicRequest

type AckMessagesFromTopicRequest struct {
	// AckIds List of ids to acknowledge.
	AckIds []string `json:"ackIds"`
}

AckMessagesFromTopicRequest defines model for ackMessagesFromTopicRequest.

type AckMessagesJSONRequestBody

type AckMessagesJSONRequestBody = AckMessagesFromTopicRequest

AckMessagesJSONRequestBody defines body for AckMessages for application/json ContentType.

type AckMessagesResponse

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

func ParseAckMessagesResponse

func ParseAckMessagesResponse(rsp *http.Response) (*AckMessagesResponse, error)

ParseAckMessagesResponse parses an HTTP response from a AckMessagesWithResponse call

func (AckMessagesResponse) ContentType

func (r AckMessagesResponse) ContentType() string

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

func (AckMessagesResponse) Status

func (r AckMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (AckMessagesResponse) StatusCode

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

func (c *Client) AckMessages(ctx context.Context, subscriptionId SubscriptionId, body AckMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AckMessagesWithBody

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

func (*Client) NackMessages

func (c *Client) NackMessages(ctx context.Context, subscriptionId SubscriptionId, body NackMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) NackMessagesWithBody

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

func (*Client) PublishMessages

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

func (*Client) PublishMessagesWithBody

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

func (*Client) PullMessages

func (c *Client) PullMessages(ctx context.Context, subscriptionId SubscriptionId, params *PullMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PurgeTopic

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

type ClientInterface

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

	PublishMessages(ctx context.Context, body PublishMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	AckMessages(ctx context.Context, subscriptionId SubscriptionId, body AckMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	NackMessages(ctx context.Context, subscriptionId SubscriptionId, body NackMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PullMessages request
	PullMessages(ctx context.Context, subscriptionId SubscriptionId, params *PullMessagesParams, 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) AckMessagesWithBodyWithResponse

func (c *ClientWithResponses) AckMessagesWithBodyWithResponse(ctx context.Context, subscriptionId SubscriptionId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AckMessagesResponse, error)

AckMessagesWithBodyWithResponse request with arbitrary body returning *AckMessagesResponse

func (*ClientWithResponses) AckMessagesWithResponse

func (c *ClientWithResponses) AckMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, body AckMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*AckMessagesResponse, error)

func (*ClientWithResponses) NackMessagesWithBodyWithResponse

func (c *ClientWithResponses) NackMessagesWithBodyWithResponse(ctx context.Context, subscriptionId SubscriptionId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*NackMessagesResponse, error)

NackMessagesWithBodyWithResponse request with arbitrary body returning *NackMessagesResponse

func (*ClientWithResponses) NackMessagesWithResponse

func (c *ClientWithResponses) NackMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, body NackMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*NackMessagesResponse, error)

func (*ClientWithResponses) PublishMessagesWithBodyWithResponse

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

PublishMessagesWithBodyWithResponse request with arbitrary body returning *PublishMessagesResponse

func (*ClientWithResponses) PublishMessagesWithResponse

func (c *ClientWithResponses) PublishMessagesWithResponse(ctx context.Context, body PublishMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PublishMessagesResponse, error)

func (*ClientWithResponses) PullMessagesWithResponse

func (c *ClientWithResponses) PullMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, params *PullMessagesParams, reqEditors ...RequestEditorFn) (*PullMessagesResponse, error)

PullMessagesWithResponse request returning *PullMessagesResponse

func (*ClientWithResponses) PurgeTopicWithResponse

func (c *ClientWithResponses) PurgeTopicWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PurgeTopicResponse, error)

PurgeTopicWithResponse request returning *PurgeTopicResponse

type ClientWithResponsesInterface

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

	PublishMessagesWithResponse(ctx context.Context, body PublishMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PublishMessagesResponse, error)

	// PurgeTopicWithResponse request
	PurgeTopicWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PurgeTopicResponse, error)

	// AckMessagesWithBodyWithResponse request with any body
	AckMessagesWithBodyWithResponse(ctx context.Context, subscriptionId SubscriptionId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AckMessagesResponse, error)

	AckMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, body AckMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*AckMessagesResponse, error)

	// NackMessagesWithBodyWithResponse request with any body
	NackMessagesWithBodyWithResponse(ctx context.Context, subscriptionId SubscriptionId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*NackMessagesResponse, error)

	NackMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, body NackMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*NackMessagesResponse, error)

	// PullMessagesWithResponse request
	PullMessagesWithResponse(ctx context.Context, subscriptionId SubscriptionId, params *PullMessagesParams, reqEditors ...RequestEditorFn) (*PullMessagesResponse, error)
}

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

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 {
	// AckId An auto generated unique id for acknowledging the message.
	AckId string `json:"ackId"`

	// CreateTime The point in time the resource was created.
	CreateTime time.Time `json:"createTime"`

	// Data Base64 encoded messages.
	Data []byte `json:"data"`

	// DeliveryAttempts Number of times the message has been tried to be delivered.
	DeliveryAttempts uint64 `json:"deliveryAttempts"`
}

Message defines model for message.

type Messages

type Messages struct {
	Messages []Message `json:"messages"`
}

Messages defines model for messages.

type NackMessagesFromTopicRequest

type NackMessagesFromTopicRequest struct {
	// NackIds List of ids to not acknowledge.
	NackIds []string `json:"nackIds"`
}

NackMessagesFromTopicRequest defines model for nackMessagesFromTopicRequest.

type NackMessagesJSONRequestBody

type NackMessagesJSONRequestBody = NackMessagesFromTopicRequest

NackMessagesJSONRequestBody defines body for NackMessages for application/json ContentType.

type NackMessagesResponse

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

func ParseNackMessagesResponse

func ParseNackMessagesResponse(rsp *http.Response) (*NackMessagesResponse, error)

ParseNackMessagesResponse parses an HTTP response from a NackMessagesWithResponse call

func (NackMessagesResponse) ContentType

func (r NackMessagesResponse) ContentType() string

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

func (NackMessagesResponse) Status

func (r NackMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (NackMessagesResponse) StatusCode

func (r NackMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PublishMessage

type PublishMessage struct {
	// Data Base64 encoded message payload.
	Data []byte `json:"data"`
}

PublishMessage defines model for publishMessage.

type PublishMessageToTopicRequest

type PublishMessageToTopicRequest struct {
	// Messages The messages to publish.
	Messages []PublishMessage `json:"messages"`
}

PublishMessageToTopicRequest defines model for publishMessageToTopicRequest.

type PublishMessagesJSONRequestBody

type PublishMessagesJSONRequestBody = PublishMessageToTopicRequest

PublishMessagesJSONRequestBody defines body for PublishMessages for application/json ContentType.

type PublishMessagesResponse

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

func ParsePublishMessagesResponse

func ParsePublishMessagesResponse(rsp *http.Response) (*PublishMessagesResponse, error)

ParsePublishMessagesResponse parses an HTTP response from a PublishMessagesWithResponse call

func (PublishMessagesResponse) ContentType

func (r PublishMessagesResponse) ContentType() string

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

func (PublishMessagesResponse) Status

func (r PublishMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (PublishMessagesResponse) StatusCode

func (r PublishMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PullMessagesParams

type PullMessagesParams struct {
	// PubSubMaxMessages The maximum number of messages to pull.
	PubSubMaxMessages *int32 `json:"PubSub-Max-Messages,omitempty"`

	// PubSubLongPullDuration The maximum amount of milliseconds to keep an connection open, awaiting a new message on the server.
	PubSubLongPullDuration *int32 `json:"PubSub-Long-Pull-Duration,omitempty"`
}

PullMessagesParams defines parameters for PullMessages.

type PullMessagesResponse

type PullMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Messages
}

func ParsePullMessagesResponse

func ParsePullMessagesResponse(rsp *http.Response) (*PullMessagesResponse, error)

ParsePullMessagesResponse parses an HTTP response from a PullMessagesWithResponse call

func (PullMessagesResponse) ContentType

func (r PullMessagesResponse) ContentType() string

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

func (PullMessagesResponse) Status

func (r PullMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (PullMessagesResponse) StatusCode

func (r PullMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PurgeTopicResponse

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

func ParsePurgeTopicResponse

func ParsePurgeTopicResponse(rsp *http.Response) (*PurgeTopicResponse, error)

ParsePurgeTopicResponse parses an HTTP response from a PurgeTopicWithResponse call

func (PurgeTopicResponse) ContentType

func (r PurgeTopicResponse) ContentType() string

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

func (PurgeTopicResponse) Status

func (r PurgeTopicResponse) Status() string

Status returns HTTPResponse.Status

func (PurgeTopicResponse) StatusCode

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

type SubscriptionId = openapi_types.UUID

SubscriptionId defines model for subscriptionId.

Jump to

Keyboard shortcuts

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