Documentation
¶
Overview ¶
Package openmeter provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewCreateMeterRequest(server string, params *CreateMeterParams, body CreateMeterJSONRequestBody) (*http.Request, error)
- func NewCreateMeterRequestWithBody(server string, params *CreateMeterParams, contentType string, body io.Reader) (*http.Request, error)
- func NewCreateNamespaceRequest(server string, body CreateNamespaceJSONRequestBody) (*http.Request, error)
- func NewCreateNamespaceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams) (*http.Request, error)
- func NewGetMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams) (*http.Request, error)
- func NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody(server string, params *IngestEventsParams, ...) (*http.Request, error)
- func NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody(server string, params *IngestEventsParams, ...) (*http.Request, error)
- func NewIngestEventsRequestWithBody(server string, params *IngestEventsParams, contentType string, body io.Reader) (*http.Request, error)
- func NewListEventsRequest(server string, params *ListEventsParams) (*http.Request, error)
- func NewListMeterSubjectsRequest(server string, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams) (*http.Request, error)
- func NewListMetersRequest(server string, params *ListMetersParams) (*http.Request, error)
- func NewQueryMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type BadRequestProblemResponse
- type Client
- func (c *Client) CreateMeter(ctx context.Context, params *CreateMeterParams, ...) (*http.Response, error)
- func (c *Client) CreateMeterWithBody(ctx context.Context, params *CreateMeterParams, contentType string, ...) (*http.Response, error)
- func (c *Client) CreateNamespace(ctx context.Context, body CreateNamespaceJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateNamespaceWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) DeleteMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, ...) (*http.Response, error)
- func (c *Client) GetMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, ...) (*http.Response, error)
- func (c *Client) IngestEventsWithApplicationCloudeventsBatchPlusJSONBody(ctx context.Context, params *IngestEventsParams, ...) (*http.Response, error)
- func (c *Client) IngestEventsWithApplicationCloudeventsPlusJSONBody(ctx context.Context, params *IngestEventsParams, ...) (*http.Response, error)
- func (c *Client) IngestEventsWithBody(ctx context.Context, params *IngestEventsParams, contentType string, ...) (*http.Response, error)
- func (c *Client) ListEvents(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListMeterSubjects(ctx context.Context, meterIdOrSlug MeterIdOrSlug, ...) (*http.Response, error)
- func (c *Client) ListMeters(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) QueryMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateMeterWithBodyWithResponse(ctx context.Context, params *CreateMeterParams, contentType string, ...) (*CreateMeterResponse, error)
- func (c *ClientWithResponses) CreateMeterWithResponse(ctx context.Context, params *CreateMeterParams, ...) (*CreateMeterResponse, error)
- func (c *ClientWithResponses) CreateNamespaceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateNamespaceResponse, error)
- func (c *ClientWithResponses) CreateNamespaceWithResponse(ctx context.Context, body CreateNamespaceJSONRequestBody, ...) (*CreateNamespaceResponse, error)
- func (c *ClientWithResponses) DeleteMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, ...) (*DeleteMeterResponse, error)
- func (c *ClientWithResponses) GetMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, ...) (*GetMeterResponse, error)
- func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, ...) (*IngestEventsResponse, error)
- func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, ...) (*IngestEventsResponse, error)
- func (c *ClientWithResponses) IngestEventsWithBodyWithResponse(ctx context.Context, params *IngestEventsParams, contentType string, ...) (*IngestEventsResponse, error)
- func (c *ClientWithResponses) ListEventsWithResponse(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
- func (c *ClientWithResponses) ListMeterSubjectsWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, ...) (*ListMeterSubjectsResponse, error)
- func (c *ClientWithResponses) ListMetersWithResponse(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)
- func (c *ClientWithResponses) QueryMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, ...) (*QueryMeterResponse, error)
- type ClientWithResponsesInterface
- type CreateMeterJSONRequestBody
- type CreateMeterParams
- type CreateMeterResponse
- type CreateNamespaceJSONRequestBody
- type CreateNamespaceResponse
- type DeleteMeterParams
- type DeleteMeterResponse
- type ErrResponse
- type Event
- type GetMeterParams
- type GetMeterResponse
- type HttpRequestDoer
- type IdOrSlug
- type IngestEventsApplicationCloudeventsBatchPlusJSONBody
- type IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody
- type IngestEventsApplicationCloudeventsPlusJSONRequestBody
- type IngestEventsParams
- type IngestEventsResponse
- type ListEventsParams
- type ListEventsResponse
- type ListMeterSubjectsParams
- type ListMeterSubjectsResponse
- type ListMetersParams
- type ListMetersResponse
- type Meter
- type MeterAggregation
- type MeterIdOrSlug
- type MeterQueryRow
- type Namespace
- type NamespaceInput
- type NotFoundProblemResponse
- type NotImplementedProblemResponse
- type Problem
- type QueryMeterParams
- type QueryMeterResponse
- type RequestEditorFn
- type UnexpectedProblemResponse
- type WindowSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func NewCreateMeterRequest ¶
func NewCreateMeterRequest(server string, params *CreateMeterParams, body CreateMeterJSONRequestBody) (*http.Request, error)
NewCreateMeterRequest calls the generic CreateMeter builder with application/json body
func NewCreateMeterRequestWithBody ¶
func NewCreateMeterRequestWithBody(server string, params *CreateMeterParams, contentType string, body io.Reader) (*http.Request, error)
NewCreateMeterRequestWithBody generates requests for CreateMeter with any type of body
func NewCreateNamespaceRequest ¶
func NewCreateNamespaceRequest(server string, body CreateNamespaceJSONRequestBody) (*http.Request, error)
NewCreateNamespaceRequest calls the generic CreateNamespace builder with application/json body
func NewCreateNamespaceRequestWithBody ¶
func NewCreateNamespaceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateNamespaceRequestWithBody generates requests for CreateNamespace with any type of body
func NewDeleteMeterRequest ¶
func NewDeleteMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams) (*http.Request, error)
NewDeleteMeterRequest generates requests for DeleteMeter
func NewGetMeterRequest ¶
func NewGetMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams) (*http.Request, error)
NewGetMeterRequest generates requests for GetMeter
func NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody ¶
func NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody(server string, params *IngestEventsParams, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody) (*http.Request, error)
NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody calls the generic IngestEvents builder with application/cloudevents-batch+json body
func NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody ¶
func NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody(server string, params *IngestEventsParams, body IngestEventsApplicationCloudeventsPlusJSONRequestBody) (*http.Request, error)
NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody calls the generic IngestEvents builder with application/cloudevents+json body
func NewIngestEventsRequestWithBody ¶
func NewIngestEventsRequestWithBody(server string, params *IngestEventsParams, contentType string, body io.Reader) (*http.Request, error)
NewIngestEventsRequestWithBody generates requests for IngestEvents with any type of body
func NewListEventsRequest ¶
func NewListEventsRequest(server string, params *ListEventsParams) (*http.Request, error)
NewListEventsRequest generates requests for ListEvents
func NewListMeterSubjectsRequest ¶
func NewListMeterSubjectsRequest(server string, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams) (*http.Request, error)
NewListMeterSubjectsRequest generates requests for ListMeterSubjects
func NewListMetersRequest ¶
func NewListMetersRequest(server string, params *ListMetersParams) (*http.Request, error)
NewListMetersRequest generates requests for ListMeters
func NewQueryMeterRequest ¶
func NewQueryMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams) (*http.Request, error)
NewQueryMeterRequest generates requests for QueryMeter
Types ¶
type BadRequestProblemResponse ¶
type BadRequestProblemResponse = Problem
BadRequestProblemResponse A Problem Details object (RFC 7807)
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) CreateMeter ¶
func (c *Client) CreateMeter(ctx context.Context, params *CreateMeterParams, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateMeterWithBody ¶
func (*Client) CreateNamespace ¶
func (c *Client) CreateNamespace(ctx context.Context, body CreateNamespaceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateNamespaceWithBody ¶
func (*Client) DeleteMeter ¶
func (c *Client) DeleteMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetMeter ¶
func (c *Client) GetMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) IngestEventsWithApplicationCloudeventsBatchPlusJSONBody ¶
func (c *Client) IngestEventsWithApplicationCloudeventsBatchPlusJSONBody(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) IngestEventsWithApplicationCloudeventsPlusJSONBody ¶
func (c *Client) IngestEventsWithApplicationCloudeventsPlusJSONBody(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) IngestEventsWithBody ¶
func (*Client) ListEvents ¶
func (c *Client) ListEvents(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListMeterSubjects ¶
func (c *Client) ListMeterSubjects(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListMeters ¶
func (c *Client) ListMeters(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) QueryMeter ¶
func (c *Client) QueryMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// ListEvents request
ListEvents(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// IngestEventsWithBody request with any body
IngestEventsWithBody(ctx context.Context, params *IngestEventsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
IngestEventsWithApplicationCloudeventsPlusJSONBody(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
IngestEventsWithApplicationCloudeventsBatchPlusJSONBody(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListMeters request
ListMeters(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateMeterWithBody request with any body
CreateMeterWithBody(ctx context.Context, params *CreateMeterParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateMeter(ctx context.Context, params *CreateMeterParams, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteMeter request
DeleteMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetMeter request
GetMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryMeter request
QueryMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListMeterSubjects request
ListMeterSubjects(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateNamespaceWithBody request with any body
CreateNamespaceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateNamespace(ctx context.Context, body CreateNamespaceJSONRequestBody, 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) CreateMeterWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateMeterWithBodyWithResponse(ctx context.Context, params *CreateMeterParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)
CreateMeterWithBodyWithResponse request with arbitrary body returning *CreateMeterResponse
func (*ClientWithResponses) CreateMeterWithResponse ¶
func (c *ClientWithResponses) CreateMeterWithResponse(ctx context.Context, params *CreateMeterParams, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)
func (*ClientWithResponses) CreateNamespaceWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateNamespaceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateNamespaceResponse, error)
CreateNamespaceWithBodyWithResponse request with arbitrary body returning *CreateNamespaceResponse
func (*ClientWithResponses) CreateNamespaceWithResponse ¶
func (c *ClientWithResponses) CreateNamespaceWithResponse(ctx context.Context, body CreateNamespaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateNamespaceResponse, error)
func (*ClientWithResponses) DeleteMeterWithResponse ¶
func (c *ClientWithResponses) DeleteMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)
DeleteMeterWithResponse request returning *DeleteMeterResponse
func (*ClientWithResponses) GetMeterWithResponse ¶
func (c *ClientWithResponses) GetMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, reqEditors ...RequestEditorFn) (*GetMeterResponse, error)
GetMeterWithResponse request returning *GetMeterResponse
func (*ClientWithResponses) IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse ¶
func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
func (*ClientWithResponses) IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse ¶
func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
func (*ClientWithResponses) IngestEventsWithBodyWithResponse ¶
func (c *ClientWithResponses) IngestEventsWithBodyWithResponse(ctx context.Context, params *IngestEventsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
IngestEventsWithBodyWithResponse request with arbitrary body returning *IngestEventsResponse
func (*ClientWithResponses) ListEventsWithResponse ¶
func (c *ClientWithResponses) ListEventsWithResponse(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
ListEventsWithResponse request returning *ListEventsResponse
func (*ClientWithResponses) ListMeterSubjectsWithResponse ¶
func (c *ClientWithResponses) ListMeterSubjectsWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams, reqEditors ...RequestEditorFn) (*ListMeterSubjectsResponse, error)
ListMeterSubjectsWithResponse request returning *ListMeterSubjectsResponse
func (*ClientWithResponses) ListMetersWithResponse ¶
func (c *ClientWithResponses) ListMetersWithResponse(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)
ListMetersWithResponse request returning *ListMetersResponse
func (*ClientWithResponses) QueryMeterWithResponse ¶
func (c *ClientWithResponses) QueryMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*QueryMeterResponse, error)
QueryMeterWithResponse request returning *QueryMeterResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// ListEventsWithResponse request
ListEventsWithResponse(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)
// IngestEventsWithBodyWithResponse request with any body
IngestEventsWithBodyWithResponse(ctx context.Context, params *IngestEventsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse(ctx context.Context, params *IngestEventsParams, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)
// ListMetersWithResponse request
ListMetersWithResponse(ctx context.Context, params *ListMetersParams, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)
// CreateMeterWithBodyWithResponse request with any body
CreateMeterWithBodyWithResponse(ctx context.Context, params *CreateMeterParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)
CreateMeterWithResponse(ctx context.Context, params *CreateMeterParams, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)
// DeleteMeterWithResponse request
DeleteMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *DeleteMeterParams, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)
// GetMeterWithResponse request
GetMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *GetMeterParams, reqEditors ...RequestEditorFn) (*GetMeterResponse, error)
// QueryMeterWithResponse request
QueryMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*QueryMeterResponse, error)
// ListMeterSubjectsWithResponse request
ListMeterSubjectsWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *ListMeterSubjectsParams, reqEditors ...RequestEditorFn) (*ListMeterSubjectsResponse, error)
// CreateNamespaceWithBodyWithResponse request with any body
CreateNamespaceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateNamespaceResponse, error)
CreateNamespaceWithResponse(ctx context.Context, body CreateNamespaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateNamespaceResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateMeterJSONRequestBody ¶
type CreateMeterJSONRequestBody = Meter
CreateMeterJSONRequestBody defines body for CreateMeter for application/json ContentType.
type CreateMeterParams ¶
type CreateMeterParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
CreateMeterParams defines parameters for CreateMeter.
type CreateMeterResponse ¶
type CreateMeterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Meter
ApplicationproblemJSON400 *BadRequestProblemResponse
ApplicationproblemJSON501 *NotImplementedProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseCreateMeterResponse ¶
func ParseCreateMeterResponse(rsp *http.Response) (*CreateMeterResponse, error)
ParseCreateMeterResponse parses an HTTP response from a CreateMeterWithResponse call
func (CreateMeterResponse) Status ¶
func (r CreateMeterResponse) Status() string
Status returns HTTPResponse.Status
func (CreateMeterResponse) StatusCode ¶
func (r CreateMeterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateNamespaceJSONRequestBody ¶
type CreateNamespaceJSONRequestBody = Namespace
CreateNamespaceJSONRequestBody defines body for CreateNamespace for application/json ContentType.
type CreateNamespaceResponse ¶
type CreateNamespaceResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseCreateNamespaceResponse ¶
func ParseCreateNamespaceResponse(rsp *http.Response) (*CreateNamespaceResponse, error)
ParseCreateNamespaceResponse parses an HTTP response from a CreateNamespaceWithResponse call
func (CreateNamespaceResponse) Status ¶
func (r CreateNamespaceResponse) Status() string
Status returns HTTPResponse.Status
func (CreateNamespaceResponse) StatusCode ¶
func (r CreateNamespaceResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteMeterParams ¶
type DeleteMeterParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
DeleteMeterParams defines parameters for DeleteMeter.
type DeleteMeterResponse ¶
type DeleteMeterResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSON404 *NotFoundProblemResponse
ApplicationproblemJSON501 *NotImplementedProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseDeleteMeterResponse ¶
func ParseDeleteMeterResponse(rsp *http.Response) (*DeleteMeterResponse, error)
ParseDeleteMeterResponse parses an HTTP response from a DeleteMeterWithResponse call
func (DeleteMeterResponse) Status ¶
func (r DeleteMeterResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteMeterResponse) StatusCode ¶
func (r DeleteMeterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ErrResponse ¶
type ErrResponse struct {
Err error `json:"-"` // low-level runtime error
StatusCode int `json:"statusCode"` // http response status code
StatusText string `json:"status"` // user-level status message
AppCode int64 `json:"code,omitempty"` // application-specific error code
Message string `json:"message,omitempty"` // application-level error message, for debugging
}
ErrResponse renderer type for handling all sorts of errors. In the best case scenario, the excellent github.com/pkg/errors package helps reveal information on the error, setting it on Err, and in the Render() method, using it to set the application-specific error code in AppCode.
type GetMeterParams ¶
type GetMeterParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
GetMeterParams defines parameters for GetMeter.
type GetMeterResponse ¶
type GetMeterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Meter
ApplicationproblemJSON404 *NotFoundProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseGetMeterResponse ¶
func ParseGetMeterResponse(rsp *http.Response) (*GetMeterResponse, error)
ParseGetMeterResponse parses an HTTP response from a GetMeterWithResponse call
func (GetMeterResponse) Status ¶
func (r GetMeterResponse) Status() string
Status returns HTTPResponse.Status
func (GetMeterResponse) StatusCode ¶
func (r GetMeterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type IngestEventsApplicationCloudeventsBatchPlusJSONBody ¶
type IngestEventsApplicationCloudeventsBatchPlusJSONBody = []Event
IngestEventsApplicationCloudeventsBatchPlusJSONBody defines parameters for IngestEvents.
type IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody ¶
type IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody = IngestEventsApplicationCloudeventsBatchPlusJSONBody
IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody defines body for IngestEvents for application/cloudevents-batch+json ContentType.
type IngestEventsApplicationCloudeventsPlusJSONRequestBody ¶
type IngestEventsApplicationCloudeventsPlusJSONRequestBody = Event
IngestEventsApplicationCloudeventsPlusJSONRequestBody defines body for IngestEvents for application/cloudevents+json ContentType.
type IngestEventsParams ¶
type IngestEventsParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
IngestEventsParams defines parameters for IngestEvents.
type IngestEventsResponse ¶
type IngestEventsResponse struct {
Body []byte
HTTPResponse *http.Response
ApplicationproblemJSON400 *BadRequestProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseIngestEventsResponse ¶
func ParseIngestEventsResponse(rsp *http.Response) (*IngestEventsResponse, error)
ParseIngestEventsResponse parses an HTTP response from a IngestEventsWithResponse call
func (IngestEventsResponse) Status ¶
func (r IngestEventsResponse) Status() string
Status returns HTTPResponse.Status
func (IngestEventsResponse) StatusCode ¶
func (r IngestEventsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListEventsParams ¶
type ListEventsParams struct {
// Limit Number of events to return.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
ListEventsParams defines parameters for ListEvents.
type ListEventsResponse ¶
type ListEventsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Event
ApplicationproblemJSON400 *BadRequestProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseListEventsResponse ¶
func ParseListEventsResponse(rsp *http.Response) (*ListEventsResponse, error)
ParseListEventsResponse parses an HTTP response from a ListEventsWithResponse call
func (ListEventsResponse) Status ¶
func (r ListEventsResponse) Status() string
Status returns HTTPResponse.Status
func (ListEventsResponse) StatusCode ¶
func (r ListEventsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListMeterSubjectsParams ¶
type ListMeterSubjectsParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
ListMeterSubjectsParams defines parameters for ListMeterSubjects.
type ListMeterSubjectsResponse ¶
type ListMeterSubjectsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]string
ApplicationproblemJSON400 *BadRequestProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseListMeterSubjectsResponse ¶
func ParseListMeterSubjectsResponse(rsp *http.Response) (*ListMeterSubjectsResponse, error)
ParseListMeterSubjectsResponse parses an HTTP response from a ListMeterSubjectsWithResponse call
func (ListMeterSubjectsResponse) Status ¶
func (r ListMeterSubjectsResponse) Status() string
Status returns HTTPResponse.Status
func (ListMeterSubjectsResponse) StatusCode ¶
func (r ListMeterSubjectsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListMetersParams ¶
type ListMetersParams struct {
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
ListMetersParams defines parameters for ListMeters.
type ListMetersResponse ¶
type ListMetersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Meter
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseListMetersResponse ¶
func ParseListMetersResponse(rsp *http.Response) (*ListMetersResponse, error)
ParseListMetersResponse parses an HTTP response from a ListMetersWithResponse call
func (ListMetersResponse) Status ¶
func (r ListMetersResponse) Status() string
Status returns HTTPResponse.Status
func (ListMetersResponse) StatusCode ¶
func (r ListMetersResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MeterAggregation ¶
type MeterAggregation = models.MeterAggregation
MeterAggregation The aggregation type to use for the meter.
type MeterQueryRow ¶
type MeterQueryRow = models.MeterQueryRow
MeterQueryRow defines model for MeterQueryRow.
type Namespace ¶
type Namespace struct {
// Namespace A namespace
Namespace string `json:"namespace"`
}
Namespace defines model for Namespace.
type NotFoundProblemResponse ¶
type NotFoundProblemResponse = Problem
NotFoundProblemResponse A Problem Details object (RFC 7807)
type NotImplementedProblemResponse ¶
type NotImplementedProblemResponse = Problem
NotImplementedProblemResponse A Problem Details object (RFC 7807)
type QueryMeterParams ¶
type QueryMeterParams struct {
// From Start date-time in RFC 3339 format in UTC timezone.
// Must be aligned with the window size.
// Inclusive.
From *time.Time `form:"from,omitempty" json:"from,omitempty"`
// To End date-time in RFC 3339 format in UTC timezone.
// Must be aligned with the window size.
// Inclusive.
To *time.Time `form:"to,omitempty" json:"to,omitempty"`
// WindowSize If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group.
WindowSize *WindowSize `form:"windowSize,omitempty" json:"windowSize,omitempty"`
// Aggregation If not specified, OpenMeter will use the default aggregation type.
// As OpenMeter stores aggregates defined by meter config, passing a different aggregate can lead to inaccurate results.
// For example getting the MIN of SUMs.
Aggregation *MeterAggregation `form:"aggregation,omitempty" json:"aggregation,omitempty"`
Subject *[]string `form:"subject,omitempty" json:"subject,omitempty"`
// GroupBy If not specified a single aggregate will be returned for each subject and time window.
GroupBy *[]string `form:"groupBy,omitempty" json:"groupBy,omitempty"`
// OMNamespace Optional namespace
NamespaceInput *NamespaceInput `json:"OM-Namespace,omitempty"`
}
QueryMeterParams defines parameters for QueryMeter.
type QueryMeterResponse ¶
type QueryMeterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *struct {
Data []MeterQueryRow `json:"data"`
From *time.Time `json:"from,omitempty"`
To *time.Time `json:"to,omitempty"`
WindowSize *WindowSize `json:"windowSize,omitempty"`
}
ApplicationproblemJSON400 *BadRequestProblemResponse
ApplicationproblemJSONDefault *UnexpectedProblemResponse
}
func ParseQueryMeterResponse ¶
func ParseQueryMeterResponse(rsp *http.Response) (*QueryMeterResponse, error)
ParseQueryMeterResponse parses an HTTP response from a QueryMeterWithResponse call
func (QueryMeterResponse) Status ¶
func (r QueryMeterResponse) Status() string
Status returns HTTPResponse.Status
func (QueryMeterResponse) StatusCode ¶
func (r QueryMeterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type UnexpectedProblemResponse ¶
type UnexpectedProblemResponse = Problem
UnexpectedProblemResponse A Problem Details object (RFC 7807)