openmeter

package
v1.0.0-beta.85 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

README

OpenMeter Go SDK

Install

go get github.com/openmeterio/openmeter/api/client/go@v1.0.0-beta.53

Usage

Initialize client.

import (
  cloudevents "github.com/cloudevents/sdk-go/v2/event"
  om "github.com/openmeterio/openmeter/api/client/go"
)

func main() {
  // Initialize OpenMeter client
  om, err := openmeter.NewClientWithResponses("http://localhost:8888")
  if err != nil {
      panic(err.Error())
  }

  // Use OpenMeter client
  // ...
}
Ingest Event

Report usage to OpenMeter.

e := cloudevents.New()
e.SetID("00001")
e.SetSource("my-app")
e.SetType("tokens")
e.SetSubject("user-id")
e.SetTime(time.Now())
e.SetData("application/json", map[string]string{
  "tokens": "15",
  "model": "gpt-4",
})

_, err := client.IngestEventWithResponse(ctx, e)
Query Meter

Retreive usage from OpenMeter.

slug := "token-usage"
subject := []string{"user-id"}
from, _ := time.Parse(time.RFC3339, "2023-01-01T00:00:00Z")
to, _ := time.Parse(time.RFC3339, "2023-01-02T00:00:00Z")
resp, _ := client.QueryMeterWithResponse(ctx, slug, &om.QueryMeterParams{
    Subject: &subject,
    From:    &from,
    To:      &to,
})
// resp.JSON200.Data

Documentation

Overview

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

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

Index

Constants

View Source
const (
	CloudCookieAuthScopes      = "CloudCookieAuth.Scopes"
	CloudPortalTokenAuthScopes = "CloudPortalTokenAuth.Scopes"
	CloudTokenAuthScopes       = "CloudTokenAuth.Scopes"
	PortalTokenAuthScopes      = "PortalTokenAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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 NewCreateFeatureRequest

func NewCreateFeatureRequest(server string, body CreateFeatureJSONRequestBody) (*http.Request, error)

NewCreateFeatureRequest calls the generic CreateFeature builder with application/json body

func NewCreateFeatureRequestWithBody

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

NewCreateFeatureRequestWithBody generates requests for CreateFeature with any type of body

func NewCreateLedgerGrantRequest

func NewCreateLedgerGrantRequest(server string, ledgerID LedgerID, body CreateLedgerGrantJSONRequestBody) (*http.Request, error)

NewCreateLedgerGrantRequest calls the generic CreateLedgerGrant builder with application/json body

func NewCreateLedgerGrantRequestWithBody

func NewCreateLedgerGrantRequestWithBody(server string, ledgerID LedgerID, contentType string, body io.Reader) (*http.Request, error)

NewCreateLedgerGrantRequestWithBody generates requests for CreateLedgerGrant with any type of body

func NewCreateLedgerRequest

func NewCreateLedgerRequest(server string, body CreateLedgerJSONRequestBody) (*http.Request, error)

NewCreateLedgerRequest calls the generic CreateLedger builder with application/json body

func NewCreateLedgerRequestWithBody

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

NewCreateLedgerRequestWithBody generates requests for CreateLedger with any type of body

func NewCreateMeterRequest

func NewCreateMeterRequest(server string, body CreateMeterJSONRequestBody) (*http.Request, error)

NewCreateMeterRequest calls the generic CreateMeter builder with application/json body

func NewCreateMeterRequestWithBody

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

NewCreateMeterRequestWithBody generates requests for CreateMeter with any type of body

func NewCreatePortalTokenRequest

func NewCreatePortalTokenRequest(server string, body CreatePortalTokenJSONRequestBody) (*http.Request, error)

NewCreatePortalTokenRequest calls the generic CreatePortalToken builder with application/json body

func NewCreatePortalTokenRequestWithBody

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

NewCreatePortalTokenRequestWithBody generates requests for CreatePortalToken with any type of body

func NewDeleteFeatureRequest

func NewDeleteFeatureRequest(server string, featureID FeatureID) (*http.Request, error)

NewDeleteFeatureRequest generates requests for DeleteFeature

func NewDeleteMeterRequest

func NewDeleteMeterRequest(server string, meterIdOrSlug MeterIdOrSlug) (*http.Request, error)

NewDeleteMeterRequest generates requests for DeleteMeter

func NewDeleteSubjectRequest

func NewDeleteSubjectRequest(server string, subjectIdOrKey SubjectIdOrKey) (*http.Request, error)

NewDeleteSubjectRequest generates requests for DeleteSubject

func NewGetFeatureRequest

func NewGetFeatureRequest(server string, featureID FeatureID) (*http.Request, error)

NewGetFeatureRequest generates requests for GetFeature

func NewGetLedgerBalanceRequest

func NewGetLedgerBalanceRequest(server string, ledgerID LedgerID, params *GetLedgerBalanceParams) (*http.Request, error)

NewGetLedgerBalanceRequest generates requests for GetLedgerBalance

func NewGetLedgerGrantRequest

func NewGetLedgerGrantRequest(server string, ledgerID LedgerID, ledgerGrantID LedgerGrantID) (*http.Request, error)

NewGetLedgerGrantRequest generates requests for GetLedgerGrant

func NewGetLedgerHistoryRequest

func NewGetLedgerHistoryRequest(server string, ledgerID LedgerID, params *GetLedgerHistoryParams) (*http.Request, error)

NewGetLedgerHistoryRequest generates requests for GetLedgerHistory

func NewGetMeterRequest

func NewGetMeterRequest(server string, meterIdOrSlug MeterIdOrSlug) (*http.Request, error)

NewGetMeterRequest generates requests for GetMeter

func NewGetSubjectRequest

func NewGetSubjectRequest(server string, subjectIdOrKey SubjectIdOrKey) (*http.Request, error)

NewGetSubjectRequest generates requests for GetSubject

func NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody

func NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody(server string, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody) (*http.Request, error)

NewIngestEventsRequestWithApplicationCloudeventsBatchPlusJSONBody calls the generic IngestEvents builder with application/cloudevents-batch+json body

func NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody

func NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody(server string, body IngestEventsApplicationCloudeventsPlusJSONRequestBody) (*http.Request, error)

NewIngestEventsRequestWithApplicationCloudeventsPlusJSONBody calls the generic IngestEvents builder with application/cloudevents+json body

func NewIngestEventsRequestWithBody

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

NewIngestEventsRequestWithBody generates requests for IngestEvents with any type of body

func NewInvalidatePortalTokensRequest

func NewInvalidatePortalTokensRequest(server string, body InvalidatePortalTokensJSONRequestBody) (*http.Request, error)

NewInvalidatePortalTokensRequest calls the generic InvalidatePortalTokens builder with application/json body

func NewInvalidatePortalTokensRequestWithBody

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

NewInvalidatePortalTokensRequestWithBody generates requests for InvalidatePortalTokens with any type of body

func NewListEventsRequest

func NewListEventsRequest(server string, params *ListEventsParams) (*http.Request, error)

NewListEventsRequest generates requests for ListEvents

func NewListFeaturesRequest

func NewListFeaturesRequest(server string, params *ListFeaturesParams) (*http.Request, error)

NewListFeaturesRequest generates requests for ListFeatures

func NewListLedgerGrantsByLedgerRequest

func NewListLedgerGrantsByLedgerRequest(server string, ledgerID LedgerID, params *ListLedgerGrantsByLedgerParams) (*http.Request, error)

NewListLedgerGrantsByLedgerRequest generates requests for ListLedgerGrantsByLedger

func NewListLedgerGrantsRequest

func NewListLedgerGrantsRequest(server string, params *ListLedgerGrantsParams) (*http.Request, error)

NewListLedgerGrantsRequest generates requests for ListLedgerGrants

func NewListLedgersRequest

func NewListLedgersRequest(server string, params *ListLedgersParams) (*http.Request, error)

NewListLedgersRequest generates requests for ListLedgers

func NewListMeterSubjectsRequest

func NewListMeterSubjectsRequest(server string, meterIdOrSlug MeterIdOrSlug) (*http.Request, error)

NewListMeterSubjectsRequest generates requests for ListMeterSubjects

func NewListMetersRequest

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

NewListMetersRequest generates requests for ListMeters

func NewListPortalTokensRequest

func NewListPortalTokensRequest(server string, params *ListPortalTokensParams) (*http.Request, error)

NewListPortalTokensRequest generates requests for ListPortalTokens

func NewListSubjectsRequest

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

NewListSubjectsRequest generates requests for ListSubjects

func NewQueryMeterRequest

func NewQueryMeterRequest(server string, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams) (*http.Request, error)

NewQueryMeterRequest generates requests for QueryMeter

func NewQueryPortalMeterRequest

func NewQueryPortalMeterRequest(server string, meterSlug string, params *QueryPortalMeterParams) (*http.Request, error)

NewQueryPortalMeterRequest generates requests for QueryPortalMeter

func NewResetLedgerRequest

func NewResetLedgerRequest(server string, ledgerID LedgerID, body ResetLedgerJSONRequestBody) (*http.Request, error)

NewResetLedgerRequest calls the generic ResetLedger builder with application/json body

func NewResetLedgerRequestWithBody

func NewResetLedgerRequestWithBody(server string, ledgerID LedgerID, contentType string, body io.Reader) (*http.Request, error)

NewResetLedgerRequestWithBody generates requests for ResetLedger with any type of body

func NewUpsertSubjectRequest

func NewUpsertSubjectRequest(server string, body UpsertSubjectJSONRequestBody) (*http.Request, error)

NewUpsertSubjectRequest calls the generic UpsertSubject builder with application/json body

func NewUpsertSubjectRequestWithBody

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

NewUpsertSubjectRequestWithBody generates requests for UpsertSubject with any type of body

func NewVoidLedgerGrantRequest

func NewVoidLedgerGrantRequest(server string, ledgerID LedgerID, ledgerGrantID LedgerGrantID) (*http.Request, error)

NewVoidLedgerGrantRequest generates requests for VoidLedgerGrant

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type BadRequestProblemResponse

type BadRequestProblemResponse = Problem

BadRequestProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

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 NewAuthClient

func NewAuthClient(server string, apiSecret string, opts ...ClientOption) (*Client, error)

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateFeature

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

func (*Client) CreateFeatureWithBody

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

func (*Client) CreateLedger

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

func (*Client) CreateLedgerGrant

func (c *Client) CreateLedgerGrant(ctx context.Context, ledgerID LedgerID, body CreateLedgerGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateLedgerGrantWithBody

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

func (*Client) CreateLedgerWithBody

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

func (*Client) CreateMeter

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

func (*Client) CreateMeterWithBody

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

func (*Client) CreatePortalToken

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

func (*Client) CreatePortalTokenWithBody

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

func (*Client) DeleteFeature

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

func (*Client) DeleteMeter

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

func (*Client) DeleteSubject

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

func (*Client) GetFeature

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

func (*Client) GetLedgerBalance

func (c *Client) GetLedgerBalance(ctx context.Context, ledgerID LedgerID, params *GetLedgerBalanceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLedgerGrant

func (c *Client) GetLedgerGrant(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLedgerHistory

func (c *Client) GetLedgerHistory(ctx context.Context, ledgerID LedgerID, params *GetLedgerHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetMeter

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

func (*Client) GetSubject

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

func (*Client) IngestEvent

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

IngestEvents is a wrapper around generated client's IngestEventsWithApplicationCloudeventsPlusJSONBody

func (*Client) IngestEventBatch

func (c *Client) IngestEventBatch(ctx context.Context, events []Event, reqEditors ...RequestEditorFn) (*http.Response, error)

IngestEvents is a wrapper around generated client's IngestEventsWithApplicationCloudeventsBatchPlusJSONBody

func (*Client) IngestEventsWithApplicationCloudeventsBatchPlusJSONBody

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

func (*Client) IngestEventsWithApplicationCloudeventsPlusJSONBody

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

func (*Client) IngestEventsWithBody

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

func (*Client) InvalidatePortalTokens

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

func (*Client) InvalidatePortalTokensWithBody

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

func (*Client) ListEvents

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

func (*Client) ListFeatures

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

func (*Client) ListLedgerGrants

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

func (*Client) ListLedgerGrantsByLedger

func (c *Client) ListLedgerGrantsByLedger(ctx context.Context, ledgerID LedgerID, params *ListLedgerGrantsByLedgerParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListLedgers

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

func (*Client) ListMeterSubjects

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

func (*Client) ListMeters

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

func (*Client) ListPortalTokens

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

func (*Client) ListSubjects

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

func (*Client) QueryMeter

func (c *Client) QueryMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) QueryPortalMeter

func (c *Client) QueryPortalMeter(ctx context.Context, meterSlug string, params *QueryPortalMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ResetLedger

func (c *Client) ResetLedger(ctx context.Context, ledgerID LedgerID, body ResetLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ResetLedgerWithBody

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

func (*Client) UpsertSubject

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

func (*Client) UpsertSubjectWithBody

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

func (*Client) VoidLedgerGrant

func (c *Client) VoidLedgerGrant(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, 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, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	IngestEventsWithApplicationCloudeventsPlusJSONBody(ctx context.Context, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	IngestEventsWithApplicationCloudeventsBatchPlusJSONBody(ctx context.Context, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	CreateFeature(ctx context.Context, body CreateFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteFeature request
	DeleteFeature(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFeature request
	GetFeature(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	CreateLedger(ctx context.Context, body CreateLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetLedgerBalance request
	GetLedgerBalance(ctx context.Context, ledgerID LedgerID, params *GetLedgerBalanceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListLedgerGrantsByLedger request
	ListLedgerGrantsByLedger(ctx context.Context, ledgerID LedgerID, params *ListLedgerGrantsByLedgerParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateLedgerGrant(ctx context.Context, ledgerID LedgerID, body CreateLedgerGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// VoidLedgerGrant request
	VoidLedgerGrant(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLedgerGrant request
	GetLedgerGrant(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLedgerHistory request
	GetLedgerHistory(ctx context.Context, ledgerID LedgerID, params *GetLedgerHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	ResetLedger(ctx context.Context, ledgerID LedgerID, body ResetLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	CreateMeter(ctx context.Context, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteMeter request
	DeleteMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMeter request
	GetMeter(ctx context.Context, meterIdOrSlug MeterIdOrSlug, 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, reqEditors ...RequestEditorFn) (*http.Response, error)

	// QueryPortalMeter request
	QueryPortalMeter(ctx context.Context, meterSlug string, params *QueryPortalMeterParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	CreatePortalToken(ctx context.Context, body CreatePortalTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	InvalidatePortalTokens(ctx context.Context, body InvalidatePortalTokensJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	UpsertSubject(ctx context.Context, body UpsertSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteSubject request
	DeleteSubject(ctx context.Context, subjectIdOrKey SubjectIdOrKey, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSubject request
	GetSubject(ctx context.Context, subjectIdOrKey SubjectIdOrKey, 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 NewAuthClientWithResponses

func NewAuthClientWithResponses(server string, apiSecret string, opts ...ClientOption) (*ClientWithResponses, error)

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateFeatureWithBodyWithResponse

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

CreateFeatureWithBodyWithResponse request with arbitrary body returning *CreateFeatureResponse

func (*ClientWithResponses) CreateFeatureWithResponse

func (c *ClientWithResponses) CreateFeatureWithResponse(ctx context.Context, body CreateFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFeatureResponse, error)

func (*ClientWithResponses) CreateLedgerGrantWithBodyWithResponse

func (c *ClientWithResponses) CreateLedgerGrantWithBodyWithResponse(ctx context.Context, ledgerID LedgerID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLedgerGrantResponse, error)

CreateLedgerGrantWithBodyWithResponse request with arbitrary body returning *CreateLedgerGrantResponse

func (*ClientWithResponses) CreateLedgerGrantWithResponse

func (c *ClientWithResponses) CreateLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, body CreateLedgerGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLedgerGrantResponse, error)

func (*ClientWithResponses) CreateLedgerWithBodyWithResponse

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

CreateLedgerWithBodyWithResponse request with arbitrary body returning *CreateLedgerResponse

func (*ClientWithResponses) CreateLedgerWithResponse

func (c *ClientWithResponses) CreateLedgerWithResponse(ctx context.Context, body CreateLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLedgerResponse, error)

func (*ClientWithResponses) CreateMeterWithBodyWithResponse

func (c *ClientWithResponses) CreateMeterWithBodyWithResponse(ctx context.Context, 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, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)

func (*ClientWithResponses) CreatePortalTokenWithBodyWithResponse

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

CreatePortalTokenWithBodyWithResponse request with arbitrary body returning *CreatePortalTokenResponse

func (*ClientWithResponses) CreatePortalTokenWithResponse

func (c *ClientWithResponses) CreatePortalTokenWithResponse(ctx context.Context, body CreatePortalTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePortalTokenResponse, error)

func (*ClientWithResponses) DeleteFeatureWithResponse

func (c *ClientWithResponses) DeleteFeatureWithResponse(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*DeleteFeatureResponse, error)

DeleteFeatureWithResponse request returning *DeleteFeatureResponse

func (*ClientWithResponses) DeleteMeterWithResponse

func (c *ClientWithResponses) DeleteMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)

DeleteMeterWithResponse request returning *DeleteMeterResponse

func (*ClientWithResponses) DeleteSubjectWithResponse

func (c *ClientWithResponses) DeleteSubjectWithResponse(ctx context.Context, subjectIdOrKey SubjectIdOrKey, reqEditors ...RequestEditorFn) (*DeleteSubjectResponse, error)

DeleteSubjectWithResponse request returning *DeleteSubjectResponse

func (*ClientWithResponses) GetFeatureWithResponse

func (c *ClientWithResponses) GetFeatureWithResponse(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*GetFeatureResponse, error)

GetFeatureWithResponse request returning *GetFeatureResponse

func (*ClientWithResponses) GetLedgerBalanceWithResponse

func (c *ClientWithResponses) GetLedgerBalanceWithResponse(ctx context.Context, ledgerID LedgerID, params *GetLedgerBalanceParams, reqEditors ...RequestEditorFn) (*GetLedgerBalanceResponse, error)

GetLedgerBalanceWithResponse request returning *GetLedgerBalanceResponse

func (*ClientWithResponses) GetLedgerGrantWithResponse

func (c *ClientWithResponses) GetLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*GetLedgerGrantResponse, error)

GetLedgerGrantWithResponse request returning *GetLedgerGrantResponse

func (*ClientWithResponses) GetLedgerHistoryWithResponse

func (c *ClientWithResponses) GetLedgerHistoryWithResponse(ctx context.Context, ledgerID LedgerID, params *GetLedgerHistoryParams, reqEditors ...RequestEditorFn) (*GetLedgerHistoryResponse, error)

GetLedgerHistoryWithResponse request returning *GetLedgerHistoryResponse

func (*ClientWithResponses) GetMeterWithResponse

func (c *ClientWithResponses) GetMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, reqEditors ...RequestEditorFn) (*GetMeterResponse, error)

GetMeterWithResponse request returning *GetMeterResponse

func (*ClientWithResponses) GetSubjectWithResponse

func (c *ClientWithResponses) GetSubjectWithResponse(ctx context.Context, subjectIdOrKey SubjectIdOrKey, reqEditors ...RequestEditorFn) (*GetSubjectResponse, error)

GetSubjectWithResponse request returning *GetSubjectResponse

func (*ClientWithResponses) IngestEventBatchWithResponse

func (c *ClientWithResponses) IngestEventBatchWithResponse(ctx context.Context, events []Event, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

IngestEventsWithResponse is a wrapper around generated client's IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse

func (*ClientWithResponses) IngestEventWithResponse

func (c *ClientWithResponses) IngestEventWithResponse(ctx context.Context, event Event, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

IngestEventsWithResponse is a wrapper around generated client's IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse

func (*ClientWithResponses) IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse

func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse(ctx context.Context, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

func (*ClientWithResponses) IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse

func (c *ClientWithResponses) IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse(ctx context.Context, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

func (*ClientWithResponses) IngestEventsWithBodyWithResponse

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

IngestEventsWithBodyWithResponse request with arbitrary body returning *IngestEventsResponse

func (*ClientWithResponses) InvalidatePortalTokensWithBodyWithResponse

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

InvalidatePortalTokensWithBodyWithResponse request with arbitrary body returning *InvalidatePortalTokensResponse

func (*ClientWithResponses) InvalidatePortalTokensWithResponse

func (c *ClientWithResponses) InvalidatePortalTokensWithResponse(ctx context.Context, body InvalidatePortalTokensJSONRequestBody, reqEditors ...RequestEditorFn) (*InvalidatePortalTokensResponse, error)

func (*ClientWithResponses) ListEventsWithResponse

func (c *ClientWithResponses) ListEventsWithResponse(ctx context.Context, params *ListEventsParams, reqEditors ...RequestEditorFn) (*ListEventsResponse, error)

ListEventsWithResponse request returning *ListEventsResponse

func (*ClientWithResponses) ListFeaturesWithResponse

func (c *ClientWithResponses) ListFeaturesWithResponse(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*ListFeaturesResponse, error)

ListFeaturesWithResponse request returning *ListFeaturesResponse

func (*ClientWithResponses) ListLedgerGrantsByLedgerWithResponse

func (c *ClientWithResponses) ListLedgerGrantsByLedgerWithResponse(ctx context.Context, ledgerID LedgerID, params *ListLedgerGrantsByLedgerParams, reqEditors ...RequestEditorFn) (*ListLedgerGrantsByLedgerResponse, error)

ListLedgerGrantsByLedgerWithResponse request returning *ListLedgerGrantsByLedgerResponse

func (*ClientWithResponses) ListLedgerGrantsWithResponse

func (c *ClientWithResponses) ListLedgerGrantsWithResponse(ctx context.Context, params *ListLedgerGrantsParams, reqEditors ...RequestEditorFn) (*ListLedgerGrantsResponse, error)

ListLedgerGrantsWithResponse request returning *ListLedgerGrantsResponse

func (*ClientWithResponses) ListLedgersWithResponse

func (c *ClientWithResponses) ListLedgersWithResponse(ctx context.Context, params *ListLedgersParams, reqEditors ...RequestEditorFn) (*ListLedgersResponse, error)

ListLedgersWithResponse request returning *ListLedgersResponse

func (*ClientWithResponses) ListMeterSubjectsWithResponse

func (c *ClientWithResponses) ListMeterSubjectsWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, reqEditors ...RequestEditorFn) (*ListMeterSubjectsResponse, error)

ListMeterSubjectsWithResponse request returning *ListMeterSubjectsResponse

func (*ClientWithResponses) ListMetersWithResponse

func (c *ClientWithResponses) ListMetersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)

ListMetersWithResponse request returning *ListMetersResponse

func (*ClientWithResponses) ListPortalTokensWithResponse

func (c *ClientWithResponses) ListPortalTokensWithResponse(ctx context.Context, params *ListPortalTokensParams, reqEditors ...RequestEditorFn) (*ListPortalTokensResponse, error)

ListPortalTokensWithResponse request returning *ListPortalTokensResponse

func (*ClientWithResponses) ListSubjectsWithResponse

func (c *ClientWithResponses) ListSubjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSubjectsResponse, error)

ListSubjectsWithResponse request returning *ListSubjectsResponse

func (*ClientWithResponses) QueryMeterWithResponse

func (c *ClientWithResponses) QueryMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, params *QueryMeterParams, reqEditors ...RequestEditorFn) (*QueryMeterResponse, error)

QueryMeterWithResponse request returning *QueryMeterResponse

func (*ClientWithResponses) QueryPortalMeterWithResponse

func (c *ClientWithResponses) QueryPortalMeterWithResponse(ctx context.Context, meterSlug string, params *QueryPortalMeterParams, reqEditors ...RequestEditorFn) (*QueryPortalMeterResponse, error)

QueryPortalMeterWithResponse request returning *QueryPortalMeterResponse

func (*ClientWithResponses) ResetLedgerWithBodyWithResponse

func (c *ClientWithResponses) ResetLedgerWithBodyWithResponse(ctx context.Context, ledgerID LedgerID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResetLedgerResponse, error)

ResetLedgerWithBodyWithResponse request with arbitrary body returning *ResetLedgerResponse

func (*ClientWithResponses) ResetLedgerWithResponse

func (c *ClientWithResponses) ResetLedgerWithResponse(ctx context.Context, ledgerID LedgerID, body ResetLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*ResetLedgerResponse, error)

func (*ClientWithResponses) UpsertSubjectWithBodyWithResponse

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

UpsertSubjectWithBodyWithResponse request with arbitrary body returning *UpsertSubjectResponse

func (*ClientWithResponses) UpsertSubjectWithResponse

func (c *ClientWithResponses) UpsertSubjectWithResponse(ctx context.Context, body UpsertSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*UpsertSubjectResponse, error)

func (*ClientWithResponses) VoidLedgerGrantWithResponse

func (c *ClientWithResponses) VoidLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*VoidLedgerGrantResponse, error)

VoidLedgerGrantWithResponse request returning *VoidLedgerGrantResponse

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, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

	IngestEventsWithApplicationCloudeventsPlusJSONBodyWithResponse(ctx context.Context, body IngestEventsApplicationCloudeventsPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

	IngestEventsWithApplicationCloudeventsBatchPlusJSONBodyWithResponse(ctx context.Context, body IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*IngestEventsResponse, error)

	// ListFeaturesWithResponse request
	ListFeaturesWithResponse(ctx context.Context, params *ListFeaturesParams, reqEditors ...RequestEditorFn) (*ListFeaturesResponse, error)

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

	CreateFeatureWithResponse(ctx context.Context, body CreateFeatureJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFeatureResponse, error)

	// DeleteFeatureWithResponse request
	DeleteFeatureWithResponse(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*DeleteFeatureResponse, error)

	// GetFeatureWithResponse request
	GetFeatureWithResponse(ctx context.Context, featureID FeatureID, reqEditors ...RequestEditorFn) (*GetFeatureResponse, error)

	// ListLedgersWithResponse request
	ListLedgersWithResponse(ctx context.Context, params *ListLedgersParams, reqEditors ...RequestEditorFn) (*ListLedgersResponse, error)

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

	CreateLedgerWithResponse(ctx context.Context, body CreateLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLedgerResponse, error)

	// ListLedgerGrantsWithResponse request
	ListLedgerGrantsWithResponse(ctx context.Context, params *ListLedgerGrantsParams, reqEditors ...RequestEditorFn) (*ListLedgerGrantsResponse, error)

	// GetLedgerBalanceWithResponse request
	GetLedgerBalanceWithResponse(ctx context.Context, ledgerID LedgerID, params *GetLedgerBalanceParams, reqEditors ...RequestEditorFn) (*GetLedgerBalanceResponse, error)

	// ListLedgerGrantsByLedgerWithResponse request
	ListLedgerGrantsByLedgerWithResponse(ctx context.Context, ledgerID LedgerID, params *ListLedgerGrantsByLedgerParams, reqEditors ...RequestEditorFn) (*ListLedgerGrantsByLedgerResponse, error)

	// CreateLedgerGrantWithBodyWithResponse request with any body
	CreateLedgerGrantWithBodyWithResponse(ctx context.Context, ledgerID LedgerID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLedgerGrantResponse, error)

	CreateLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, body CreateLedgerGrantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLedgerGrantResponse, error)

	// VoidLedgerGrantWithResponse request
	VoidLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*VoidLedgerGrantResponse, error)

	// GetLedgerGrantWithResponse request
	GetLedgerGrantWithResponse(ctx context.Context, ledgerID LedgerID, ledgerGrantID LedgerGrantID, reqEditors ...RequestEditorFn) (*GetLedgerGrantResponse, error)

	// GetLedgerHistoryWithResponse request
	GetLedgerHistoryWithResponse(ctx context.Context, ledgerID LedgerID, params *GetLedgerHistoryParams, reqEditors ...RequestEditorFn) (*GetLedgerHistoryResponse, error)

	// ResetLedgerWithBodyWithResponse request with any body
	ResetLedgerWithBodyWithResponse(ctx context.Context, ledgerID LedgerID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ResetLedgerResponse, error)

	ResetLedgerWithResponse(ctx context.Context, ledgerID LedgerID, body ResetLedgerJSONRequestBody, reqEditors ...RequestEditorFn) (*ResetLedgerResponse, error)

	// ListMetersWithResponse request
	ListMetersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMetersResponse, error)

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

	CreateMeterWithResponse(ctx context.Context, body CreateMeterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMeterResponse, error)

	// DeleteMeterWithResponse request
	DeleteMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, reqEditors ...RequestEditorFn) (*DeleteMeterResponse, error)

	// GetMeterWithResponse request
	GetMeterWithResponse(ctx context.Context, meterIdOrSlug MeterIdOrSlug, 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, reqEditors ...RequestEditorFn) (*ListMeterSubjectsResponse, error)

	// QueryPortalMeterWithResponse request
	QueryPortalMeterWithResponse(ctx context.Context, meterSlug string, params *QueryPortalMeterParams, reqEditors ...RequestEditorFn) (*QueryPortalMeterResponse, error)

	// ListPortalTokensWithResponse request
	ListPortalTokensWithResponse(ctx context.Context, params *ListPortalTokensParams, reqEditors ...RequestEditorFn) (*ListPortalTokensResponse, error)

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

	CreatePortalTokenWithResponse(ctx context.Context, body CreatePortalTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePortalTokenResponse, error)

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

	InvalidatePortalTokensWithResponse(ctx context.Context, body InvalidatePortalTokensJSONRequestBody, reqEditors ...RequestEditorFn) (*InvalidatePortalTokensResponse, error)

	// ListSubjectsWithResponse request
	ListSubjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSubjectsResponse, error)

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

	UpsertSubjectWithResponse(ctx context.Context, body UpsertSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*UpsertSubjectResponse, error)

	// DeleteSubjectWithResponse request
	DeleteSubjectWithResponse(ctx context.Context, subjectIdOrKey SubjectIdOrKey, reqEditors ...RequestEditorFn) (*DeleteSubjectResponse, error)

	// GetSubjectWithResponse request
	GetSubjectWithResponse(ctx context.Context, subjectIdOrKey SubjectIdOrKey, reqEditors ...RequestEditorFn) (*GetSubjectResponse, error)
}

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

type CreateFeatureJSONRequestBody

type CreateFeatureJSONRequestBody = CreateFeatureRequest

CreateFeatureJSONRequestBody defines body for CreateFeature for application/json ContentType.

type CreateFeatureRequest

type CreateFeatureRequest struct {
	// Archived If the feature is archived, it will not be used for grants or usage.
	Archived *bool `json:"archived,omitempty"`

	// MeterGroupByFilters Optional meter group by filters. Useful if the meter scope is broader than what feature tracks.
	MeterGroupByFilters *map[string]string `json:"meterGroupByFilters,omitempty"`

	// MeterSlug The meter that the feature is associated with and decreases grants by usage.
	MeterSlug string `json:"meterSlug"`

	// Name The name of the feature.
	Name string `json:"name"`
}

CreateFeatureRequest A feature is a feature or service offered to a customer. For example: CPU-Hours, Tokens, API Calls, etc.

type CreateFeatureResponse

type CreateFeatureResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON201                       *Feature
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON501     *NotImplementedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseCreateFeatureResponse

func ParseCreateFeatureResponse(rsp *http.Response) (*CreateFeatureResponse, error)

ParseCreateFeatureResponse parses an HTTP response from a CreateFeatureWithResponse call

func (CreateFeatureResponse) Status

func (r CreateFeatureResponse) Status() string

Status returns HTTPResponse.Status

func (CreateFeatureResponse) StatusCode

func (r CreateFeatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateLedger

type CreateLedger = credit.Ledger

CreateLedger A ledger represented in open meter. A ledger must be assigned to a single subject.

type CreateLedgerGrantJSONRequestBody

type CreateLedgerGrantJSONRequestBody = CreateLedgerGrantRequest

CreateLedgerGrantJSONRequestBody defines body for CreateLedgerGrant for application/json ContentType.

type CreateLedgerGrantRequest

type CreateLedgerGrantRequest struct {
	// Amount The amount to grant. Can be positive or negative number.
	Amount float64 `json:"amount"`

	// CreatedAt The time the grant was created.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// EffectiveAt The effective date.
	EffectiveAt time.Time                    `json:"effectiveAt"`
	Expiration  *LedgerGrantExpirationPeriod `json:"expiration,omitempty"`

	// FeatureID The unique feature ULID that the grant is associated with, if any.
	FeatureID string             `json:"featureID"`
	Metadata  *map[string]string `json:"metadata,omitempty"`

	// ParentId The parent grant ULID that the grant is associated with, if any.
	ParentId *string `json:"parentId,omitempty"`

	// Priority The priority of the grant. Grants with higher priority are applied first.
	// Priority is a positive decimal numbers. With lower numbers indicating higher importance.
	// For example, a priority of 1 is more urgent than a priority of 2.
	// When there are several grants available for the same subject, the system selects the grant with the highest priority.
	// In cases where grants share the same priority level, the grant closest to its expiration will be used first.
	// In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.
	Priority *int `json:"priority,omitempty"`

	// Rollover Grant rollover configuration.
	Rollover *LedgerGrantRollover `json:"rollover,omitempty"`

	// Type The grant type:
	// - `USAGE` - Increase balance by the amount in the unit of the associated meter.
	Type LedgerGrantType `json:"type"`

	// UpdatedAt The time the grant was last updated.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}

CreateLedgerGrantRequest Grants are used to increase balance of specific subjects.

type CreateLedgerGrantResponse

type CreateLedgerGrantResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON201                       *LedgerGrantResponse
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseCreateLedgerGrantResponse

func ParseCreateLedgerGrantResponse(rsp *http.Response) (*CreateLedgerGrantResponse, error)

ParseCreateLedgerGrantResponse parses an HTTP response from a CreateLedgerGrantWithResponse call

func (CreateLedgerGrantResponse) Status

func (r CreateLedgerGrantResponse) Status() string

Status returns HTTPResponse.Status

func (CreateLedgerGrantResponse) StatusCode

func (r CreateLedgerGrantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateLedgerJSONRequestBody

type CreateLedgerJSONRequestBody = CreateLedger

CreateLedgerJSONRequestBody defines body for CreateLedger for application/json ContentType.

type CreateLedgerResponse

type CreateLedgerResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON201                       *Ledger
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON409     *LedgerAlreadyExistsProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseCreateLedgerResponse

func ParseCreateLedgerResponse(rsp *http.Response) (*CreateLedgerResponse, error)

ParseCreateLedgerResponse parses an HTTP response from a CreateLedgerWithResponse call

func (CreateLedgerResponse) Status

func (r CreateLedgerResponse) Status() string

Status returns HTTPResponse.Status

func (CreateLedgerResponse) StatusCode

func (r CreateLedgerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateMeterJSONRequestBody

type CreateMeterJSONRequestBody = Meter

CreateMeterJSONRequestBody defines body for CreateMeter for application/json ContentType.

type CreateMeterResponse

type CreateMeterResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON201                       *Meter
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	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 CreatePortalTokenJSONRequestBody

type CreatePortalTokenJSONRequestBody = PortalToken

CreatePortalTokenJSONRequestBody defines body for CreatePortalToken for application/json ContentType.

type CreatePortalTokenResponse

type CreatePortalTokenResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *PortalToken
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseCreatePortalTokenResponse

func ParseCreatePortalTokenResponse(rsp *http.Response) (*CreatePortalTokenResponse, error)

ParseCreatePortalTokenResponse parses an HTTP response from a CreatePortalTokenWithResponse call

func (CreatePortalTokenResponse) Status

func (r CreatePortalTokenResponse) Status() string

Status returns HTTPResponse.Status

func (CreatePortalTokenResponse) StatusCode

func (r CreatePortalTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteFeatureResponse

type DeleteFeatureResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseDeleteFeatureResponse

func ParseDeleteFeatureResponse(rsp *http.Response) (*DeleteFeatureResponse, error)

ParseDeleteFeatureResponse parses an HTTP response from a DeleteFeatureWithResponse call

func (DeleteFeatureResponse) Status

func (r DeleteFeatureResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteFeatureResponse) StatusCode

func (r DeleteFeatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 DeleteSubjectResponse

type DeleteSubjectResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSON501     *NotImplementedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseDeleteSubjectResponse

func ParseDeleteSubjectResponse(rsp *http.Response) (*DeleteSubjectResponse, error)

ParseDeleteSubjectResponse parses an HTTP response from a DeleteSubjectWithResponse call

func (DeleteSubjectResponse) Status

func (r DeleteSubjectResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteSubjectResponse) StatusCode

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

type Event = event.Event

Event CloudEvents Specification JSON Schema

type Feature

type Feature struct {
	// Archived If the feature is archived, it will not be used for grants or usage.
	Archived *bool `json:"archived,omitempty"`

	// CreatedAt The time the feature was created.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// Id Readonly unique ULID identifier of the feature.
	Id *string `json:"id,omitempty"`

	// MeterGroupByFilters Optional meter group by filters. Useful if the meter scope is broader than what feature tracks.
	MeterGroupByFilters *map[string]string `json:"meterGroupByFilters,omitempty"`

	// MeterSlug The meter that the feature is associated with and decreases grants by usage.
	MeterSlug string `json:"meterSlug"`

	// Name The name of the feature.
	Name string `json:"name"`

	// UpdatedAt The time the feature was last updated.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}

Feature defines model for Feature.

type FeatureBalance

type FeatureBalance struct {
	// Archived If the feature is archived, it will not be used for grants or usage.
	Archived *bool `json:"archived,omitempty"`

	// Balance The balance of the feature.
	Balance float64 `json:"balance"`

	// CreatedAt The time the feature was created.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// Id Readonly unique ULID identifier of the feature.
	Id *string `json:"id,omitempty"`

	// MeterGroupByFilters Optional meter group by filters. Useful if the meter scope is broader than what feature tracks.
	MeterGroupByFilters *map[string]string `json:"meterGroupByFilters,omitempty"`

	// MeterSlug The meter that the feature is associated with and decreases grants by usage.
	MeterSlug string `json:"meterSlug"`

	// Name The name of the feature.
	Name string `json:"name"`

	// UpdatedAt The time the feature was last updated.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`

	// Usage The usage of the feature.
	Usage float64 `json:"usage"`
}

FeatureBalance defines model for FeatureBalance.

type FeatureID

type FeatureID = credit.FeatureID

FeatureID defines model for featureID.

type GetFeatureResponse

type GetFeatureResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *Feature
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseGetFeatureResponse

func ParseGetFeatureResponse(rsp *http.Response) (*GetFeatureResponse, error)

ParseGetFeatureResponse parses an HTTP response from a GetFeatureWithResponse call

func (GetFeatureResponse) Status

func (r GetFeatureResponse) Status() string

Status returns HTTPResponse.Status

func (GetFeatureResponse) StatusCode

func (r GetFeatureResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLedgerBalanceParams

type GetLedgerBalanceParams struct {
	// Time Point of time to query balances: date-time in RFC 3339 format. Defaults to now.
	Time *time.Time `form:"time,omitempty" json:"time,omitempty"`
}

GetLedgerBalanceParams defines parameters for GetLedgerBalance.

type GetLedgerBalanceResponse

type GetLedgerBalanceResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *LedgerBalance
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseGetLedgerBalanceResponse

func ParseGetLedgerBalanceResponse(rsp *http.Response) (*GetLedgerBalanceResponse, error)

ParseGetLedgerBalanceResponse parses an HTTP response from a GetLedgerBalanceWithResponse call

func (GetLedgerBalanceResponse) Status

func (r GetLedgerBalanceResponse) Status() string

Status returns HTTPResponse.Status

func (GetLedgerBalanceResponse) StatusCode

func (r GetLedgerBalanceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLedgerGrantResponse

type GetLedgerGrantResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *LedgerGrantResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseGetLedgerGrantResponse

func ParseGetLedgerGrantResponse(rsp *http.Response) (*GetLedgerGrantResponse, error)

ParseGetLedgerGrantResponse parses an HTTP response from a GetLedgerGrantWithResponse call

func (GetLedgerGrantResponse) Status

func (r GetLedgerGrantResponse) Status() string

Status returns HTTPResponse.Status

func (GetLedgerGrantResponse) StatusCode

func (r GetLedgerGrantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLedgerHistoryParams

type GetLedgerHistoryParams struct {
	// Limit Number of entries to return
	Limit *LedgerQueryLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Number of entries to skip
	Offset *LedgerQueryOffset `form:"offset,omitempty" json:"offset,omitempty"`

	// From Start of time range to query ledger: date-time in RFC 3339 format.
	From time.Time `form:"from" json:"from"`

	// To End of time range to query ledger: date-time in RFC 3339 format. Defaults to now.
	To *time.Time `form:"to,omitempty" json:"to,omitempty"`
}

GetLedgerHistoryParams defines parameters for GetLedgerHistory.

type GetLedgerHistoryResponse

type GetLedgerHistoryResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]LedgerEntry
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseGetLedgerHistoryResponse

func ParseGetLedgerHistoryResponse(rsp *http.Response) (*GetLedgerHistoryResponse, error)

ParseGetLedgerHistoryResponse parses an HTTP response from a GetLedgerHistoryWithResponse call

func (GetLedgerHistoryResponse) Status

func (r GetLedgerHistoryResponse) Status() string

Status returns HTTPResponse.Status

func (GetLedgerHistoryResponse) StatusCode

func (r GetLedgerHistoryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 GetSubjectResponse

type GetSubjectResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *Subject
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseGetSubjectResponse

func ParseGetSubjectResponse(rsp *http.Response) (*GetSubjectResponse, error)

ParseGetSubjectResponse parses an HTTP response from a GetSubjectWithResponse call

func (GetSubjectResponse) Status

func (r GetSubjectResponse) Status() string

Status returns HTTPResponse.Status

func (GetSubjectResponse) StatusCode

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

type IdOrSlug = string

IdOrSlug A unique identifier.

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 IngestEventsResponse

type IngestEventsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	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 IngestedEvent

type IngestedEvent struct {
	// Event CloudEvents Specification JSON Schema
	Event           Event   `json:"event"`
	ValidationError *string `json:"validationError,omitempty"`
}

IngestedEvent An ingested event with optional validation error.

type InvalidatePortalTokensJSONBody

type InvalidatePortalTokensJSONBody struct {
	// Id Invalidate a portal token by ID.
	Id *string `json:"id,omitempty"`

	// Subject Invalidate all portal tokens for a subject.
	Subject *string `json:"subject,omitempty"`
}

InvalidatePortalTokensJSONBody defines parameters for InvalidatePortalTokens.

type InvalidatePortalTokensJSONRequestBody

type InvalidatePortalTokensJSONRequestBody InvalidatePortalTokensJSONBody

InvalidatePortalTokensJSONRequestBody defines body for InvalidatePortalTokens for application/json ContentType.

type InvalidatePortalTokensResponse

type InvalidatePortalTokensResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON501     *NotImplementedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseInvalidatePortalTokensResponse

func ParseInvalidatePortalTokensResponse(rsp *http.Response) (*InvalidatePortalTokensResponse, error)

ParseInvalidatePortalTokensResponse parses an HTTP response from a InvalidatePortalTokensWithResponse call

func (InvalidatePortalTokensResponse) Status

Status returns HTTPResponse.Status

func (InvalidatePortalTokensResponse) StatusCode

func (r InvalidatePortalTokensResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Ledger

type Ledger = credit.Ledger

Ledger defines model for Ledger.

type LedgerAlreadyExistsProblem

type LedgerAlreadyExistsProblem = credit.LedgerAlreadyExistsProblemResponse

LedgerAlreadyExistsProblem Ledger Exists

type LedgerAlreadyExistsProblemResponse

type LedgerAlreadyExistsProblemResponse = LedgerAlreadyExistsProblem

LedgerAlreadyExistsProblemResponse Ledger Exists

type LedgerBalance

type LedgerBalance struct {
	// FeatureBalances Features with balances.
	FeatureBalances []FeatureBalance `json:"featureBalances"`

	// GrantBalances The grants applied to the subject.
	GrantBalances []LedgerGrantBalance `json:"grantBalances"`

	// LastReset The last reset of the ledger.
	LastReset *time.Time         `json:"lastReset,omitempty"`
	Metadata  *map[string]string `json:"metadata,omitempty"`

	// Subject The subject of the ledger.
	Subject string `json:"subject"`
}

LedgerBalance Balance of a subject.

type LedgerEntry

type LedgerEntry struct {
	// Amount The amount to apply. Can be positive or negative number. If applicable.
	Amount float64 `json:"amount"`

	// FeatureID The unique feature ULID that the entry is associated with, if any.
	FeatureID string `json:"featureID"`

	// Id Readonly unique ULID identifier of the ledger entry.
	Id *string `json:"id,omitempty"`

	// Period A time period
	Period *Period `json:"period,omitempty"`

	// Time The time the ledger entry was created.
	Time time.Time       `json:"time"`
	Type LedgerEntryType `json:"type"`
}

LedgerEntry A ledger entry.

type LedgerEntryType

type LedgerEntryType string

LedgerEntryType defines model for LedgerEntryType.

const (
	GRANT      LedgerEntryType = "GRANT"
	GRANTUSAGE LedgerEntryType = "GRANT_USAGE"
	RESET      LedgerEntryType = "RESET"
	VOID       LedgerEntryType = "VOID"
)

Defines values for LedgerEntryType.

type LedgerGrantBalance

type LedgerGrantBalance struct {
	// Amount The amount to grant. Can be positive or negative number.
	Amount float64 `json:"amount"`

	// Balance The balance of the grant.
	Balance float64 `json:"balance"`

	// CreatedAt The time the grant was created.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// EffectiveAt The effective date.
	EffectiveAt time.Time                    `json:"effectiveAt"`
	Expiration  *LedgerGrantExpirationPeriod `json:"expiration,omitempty"`

	// ExpiresAt The expiration date of the grant.
	ExpiresAt *time.Time `json:"expiresAt,omitempty"`

	// FeatureID The unique feature ULID that the grant is associated with, if any.
	FeatureID string `json:"featureID"`

	// Id Readonly unique ULID identifier of the grant.
	Id *string `json:"id,omitempty"`

	// LedgerID The ledger ID.
	LedgerID string             `json:"ledgerID"`
	Metadata *map[string]string `json:"metadata,omitempty"`

	// ParentId The parent grant ULID that the grant is associated with, if any.
	ParentId *string `json:"parentId,omitempty"`

	// Priority The priority of the grant. Grants with higher priority are applied first.
	// Priority is a positive decimal numbers. With lower numbers indicating higher importance.
	// For example, a priority of 1 is more urgent than a priority of 2.
	// When there are several grants available for the same subject, the system selects the grant with the highest priority.
	// In cases where grants share the same priority level, the grant closest to its expiration will be used first.
	// In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.
	Priority *int `json:"priority,omitempty"`

	// Rollover Grant rollover configuration.
	Rollover *LedgerGrantRollover `json:"rollover,omitempty"`

	// Type The grant type:
	// - `USAGE` - Increase balance by the amount in the unit of the associated meter.
	Type LedgerGrantType `json:"type"`

	// UpdatedAt The time the grant was last updated.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`

	// Void If the grant is voided, it will not be applied to the subject's balance anymore.
	Void *bool `json:"void,omitempty"`
}

LedgerGrantBalance defines model for LedgerGrantBalance.

type LedgerGrantExpirationPeriod

type LedgerGrantExpirationPeriod struct {
	// Count The expiration period count like 12 months.
	Count int `json:"count"`

	// Duration The expiration period duration like month.
	Duration LedgerGrantExpirationPeriodDuration `json:"duration"`
}

LedgerGrantExpirationPeriod Expiration period of a ledger grant.

type LedgerGrantExpirationPeriodDuration

type LedgerGrantExpirationPeriodDuration string

LedgerGrantExpirationPeriodDuration The expiration period duration like month.

Defines values for LedgerGrantExpirationPeriodDuration.

type LedgerGrantID

type LedgerGrantID = credit.GrantID

LedgerGrantID defines model for ledgerGrantID.

type LedgerGrantResponse

type LedgerGrantResponse struct {
	// Amount The amount to grant. Can be positive or negative number.
	Amount float64 `json:"amount"`

	// CreatedAt The time the grant was created.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// EffectiveAt The effective date.
	EffectiveAt time.Time                    `json:"effectiveAt"`
	Expiration  *LedgerGrantExpirationPeriod `json:"expiration,omitempty"`

	// ExpiresAt The expiration date of the grant.
	ExpiresAt *time.Time `json:"expiresAt,omitempty"`

	// FeatureID The unique feature ULID that the grant is associated with, if any.
	FeatureID string `json:"featureID"`

	// Id Readonly unique ULID identifier of the grant.
	Id *string `json:"id,omitempty"`

	// LedgerID The ledger ID.
	LedgerID string             `json:"ledgerID"`
	Metadata *map[string]string `json:"metadata,omitempty"`

	// ParentId The parent grant ULID that the grant is associated with, if any.
	ParentId *string `json:"parentId,omitempty"`

	// Priority The priority of the grant. Grants with higher priority are applied first.
	// Priority is a positive decimal numbers. With lower numbers indicating higher importance.
	// For example, a priority of 1 is more urgent than a priority of 2.
	// When there are several grants available for the same subject, the system selects the grant with the highest priority.
	// In cases where grants share the same priority level, the grant closest to its expiration will be used first.
	// In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.
	Priority *int `json:"priority,omitempty"`

	// Rollover Grant rollover configuration.
	Rollover *LedgerGrantRollover `json:"rollover,omitempty"`

	// Type The grant type:
	// - `USAGE` - Increase balance by the amount in the unit of the associated meter.
	Type LedgerGrantType `json:"type"`

	// UpdatedAt The time the grant was last updated.
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`

	// Void If the grant is voided, it will not be applied to the subject's balance anymore.
	Void *bool `json:"void,omitempty"`
}

LedgerGrantResponse defines model for LedgerGrantResponse.

type LedgerGrantRollover

type LedgerGrantRollover = credit.GrantRollover

LedgerGrantRollover Grant rollover configuration.

type LedgerGrantRolloverType

type LedgerGrantRolloverType = credit.GrantRolloverType

LedgerGrantRolloverType The rollover type to use: - `REMAINING_AMOUNT` - Rollover remaining amount. - `ORIGINAL_AMOUNT` - Rollover re-applies the full grant amount.

type LedgerGrantType

type LedgerGrantType string

LedgerGrantType The grant type: - `USAGE` - Increase balance by the amount in the unit of the associated meter.

const (
	LedgerGrantTypeUsage LedgerGrantType = "USAGE"
)

Defines values for LedgerGrantType.

type LedgerID

type LedgerID = credit.LedgerID

LedgerID defines model for ledgerID.

type LedgerIncludeVoids

type LedgerIncludeVoids = bool

LedgerIncludeVoids defines model for ledgerIncludeVoids.

type LedgerQueryLimit

type LedgerQueryLimit = int

LedgerQueryLimit defines model for ledgerQueryLimit.

type LedgerQueryOffset

type LedgerQueryOffset = int

LedgerQueryOffset defines model for ledgerQueryOffset.

type LedgerReset

type LedgerReset = credit.Reset

LedgerReset Ledger reset configuration.

type ListEventsParams

type ListEventsParams struct {
	// From Start date-time in RFC 3339 format.
	// Inclusive.
	From *QueryFrom `form:"from,omitempty" json:"from,omitempty"`

	// To End date-time in RFC 3339 format.
	// Inclusive.
	To *QueryTo `form:"to,omitempty" json:"to,omitempty"`

	// Limit Number of events to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}

ListEventsParams defines parameters for ListEvents.

type ListEventsResponse

type ListEventsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]IngestedEvent
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	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 ListFeaturesParams

type ListFeaturesParams struct {
	// Limit Number of entries to return
	Limit *LedgerQueryLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Number of entries to skip
	Offset *LedgerQueryOffset `form:"offset,omitempty" json:"offset,omitempty"`

	// OrderBy Order by field
	OrderBy *ListFeaturesParamsOrderBy `form:"orderBy,omitempty" json:"orderBy,omitempty"`

	// IncludeArchived Include archived features.
	IncludeArchived *bool `form:"includeArchived,omitempty" json:"includeArchived,omitempty"`
}

ListFeaturesParams defines parameters for ListFeatures.

type ListFeaturesParamsOrderBy

type ListFeaturesParamsOrderBy string

ListFeaturesParamsOrderBy defines parameters for ListFeatures.

const (
	ListFeaturesParamsOrderByCreatedAt ListFeaturesParamsOrderBy = "createdAt"
	ListFeaturesParamsOrderById        ListFeaturesParamsOrderBy = "id"
	ListFeaturesParamsOrderByUpdatedAt ListFeaturesParamsOrderBy = "updatedAt"
)

Defines values for ListFeaturesParamsOrderBy.

type ListFeaturesResponse

type ListFeaturesResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]Feature
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListFeaturesResponse

func ParseListFeaturesResponse(rsp *http.Response) (*ListFeaturesResponse, error)

ParseListFeaturesResponse parses an HTTP response from a ListFeaturesWithResponse call

func (ListFeaturesResponse) Status

func (r ListFeaturesResponse) Status() string

Status returns HTTPResponse.Status

func (ListFeaturesResponse) StatusCode

func (r ListFeaturesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListLedgerGrantsByLedgerParams

type ListLedgerGrantsByLedgerParams struct {
	// Limit Number of entries to return
	Limit *LedgerQueryLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// IncludeVoids Include void entries in the response.
	IncludeVoids *LedgerIncludeVoids `form:"includeVoids,omitempty" json:"includeVoids,omitempty"`
}

ListLedgerGrantsByLedgerParams defines parameters for ListLedgerGrantsByLedger.

type ListLedgerGrantsByLedgerResponse

type ListLedgerGrantsByLedgerResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]LedgerGrantResponse
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListLedgerGrantsByLedgerResponse

func ParseListLedgerGrantsByLedgerResponse(rsp *http.Response) (*ListLedgerGrantsByLedgerResponse, error)

ParseListLedgerGrantsByLedgerResponse parses an HTTP response from a ListLedgerGrantsByLedgerWithResponse call

func (ListLedgerGrantsByLedgerResponse) Status

Status returns HTTPResponse.Status

func (ListLedgerGrantsByLedgerResponse) StatusCode

func (r ListLedgerGrantsByLedgerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListLedgerGrantsParams

type ListLedgerGrantsParams struct {
	// LedgerID Filtering and group by multiple subjects.
	//
	// Usage: `?ledgerID=01HX6VK5C498B3ABY9PR1069PP`
	LedgerID *QueryFilterLedgerID `form:"ledgerID,omitempty" json:"ledgerID,omitempty"`

	// Limit Number of entries to return
	Limit *LedgerQueryLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// IncludeVoids Include void entries in the response.
	IncludeVoids *LedgerIncludeVoids `form:"includeVoids,omitempty" json:"includeVoids,omitempty"`
}

ListLedgerGrantsParams defines parameters for ListLedgerGrants.

type ListLedgerGrantsResponse

type ListLedgerGrantsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]LedgerGrantResponse
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListLedgerGrantsResponse

func ParseListLedgerGrantsResponse(rsp *http.Response) (*ListLedgerGrantsResponse, error)

ParseListLedgerGrantsResponse parses an HTTP response from a ListLedgerGrantsWithResponse call

func (ListLedgerGrantsResponse) Status

func (r ListLedgerGrantsResponse) Status() string

Status returns HTTPResponse.Status

func (ListLedgerGrantsResponse) StatusCode

func (r ListLedgerGrantsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListLedgersParams

type ListLedgersParams struct {
	// Subject Query ledgers specific to subjects.
	Subject *[]string `form:"subject,omitempty" json:"subject,omitempty"`

	// SubjectSimilarTo Query ledgers with subjects that are similar to the provided text.
	SubjectSimilarTo *string `form:"subjectSimilarTo,omitempty" json:"subjectSimilarTo,omitempty"`

	// Limit Number of entries to return
	Limit *LedgerQueryLimit `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Number of entries to skip
	Offset *LedgerQueryOffset `form:"offset,omitempty" json:"offset,omitempty"`

	// OrderBy Order by field
	OrderBy *ListLedgersParamsOrderBy `form:"orderBy,omitempty" json:"orderBy,omitempty"`
}

ListLedgersParams defines parameters for ListLedgers.

type ListLedgersParamsOrderBy

type ListLedgersParamsOrderBy string

ListLedgersParamsOrderBy defines parameters for ListLedgers.

const (
	ListLedgersParamsOrderByCreatedAt ListLedgersParamsOrderBy = "createdAt"
	ListLedgersParamsOrderById        ListLedgersParamsOrderBy = "id"
	ListLedgersParamsOrderBySubject   ListLedgersParamsOrderBy = "subject"
)

Defines values for ListLedgersParamsOrderBy.

type ListLedgersResponse

type ListLedgersResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]Ledger
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListLedgersResponse

func ParseListLedgersResponse(rsp *http.Response) (*ListLedgersResponse, error)

ParseListLedgersResponse parses an HTTP response from a ListLedgersWithResponse call

func (ListLedgersResponse) Status

func (r ListLedgersResponse) Status() string

Status returns HTTPResponse.Status

func (ListLedgersResponse) StatusCode

func (r ListLedgersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 ListMetersResponse

type ListMetersResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]Meter
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	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 ListPortalTokensParams

type ListPortalTokensParams struct {
	// Limit Number of portal tokens to return. Default is 25.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}

ListPortalTokensParams defines parameters for ListPortalTokens.

type ListPortalTokensResponse

type ListPortalTokensResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]PortalToken
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON501     *NotImplementedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListPortalTokensResponse

func ParseListPortalTokensResponse(rsp *http.Response) (*ListPortalTokensResponse, error)

ParseListPortalTokensResponse parses an HTTP response from a ListPortalTokensWithResponse call

func (ListPortalTokensResponse) Status

func (r ListPortalTokensResponse) Status() string

Status returns HTTPResponse.Status

func (ListPortalTokensResponse) StatusCode

func (r ListPortalTokensResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSubjectsResponse

type ListSubjectsResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]Subject
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseListSubjectsResponse

func ParseListSubjectsResponse(rsp *http.Response) (*ListSubjectsResponse, error)

ParseListSubjectsResponse parses an HTTP response from a ListSubjectsWithResponse call

func (ListSubjectsResponse) Status

func (r ListSubjectsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSubjectsResponse) StatusCode

func (r ListSubjectsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Meter

type Meter = models.Meter

Meter A meter is a configuration that defines how to match and aggregate events.

type MeterAggregation

type MeterAggregation = models.MeterAggregation

MeterAggregation The aggregation type to use for the meter.

type MeterIdOrSlug

type MeterIdOrSlug = IdOrSlug

MeterIdOrSlug A unique identifier.

type MeterQueryResult

type MeterQueryResult struct {
	Data []MeterQueryRow `json:"data"`
	From *time.Time      `json:"from,omitempty"`
	To   *time.Time      `json:"to,omitempty"`

	// WindowSize Aggregation window size.
	WindowSize *WindowSize `json:"windowSize,omitempty"`
}

MeterQueryResult The result of a meter query.

type MeterQueryRow

type MeterQueryRow = models.MeterQueryRow

MeterQueryRow A row in the result of a meter query.

type NotFoundProblemResponse

type NotFoundProblemResponse = Problem

NotFoundProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

type NotImplementedProblemResponse

type NotImplementedProblemResponse = Problem

NotImplementedProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

type Period

type Period struct {
	// From Period start time where the amount was applied. If applicable.
	From time.Time `json:"from"`

	// To Period end time where the amount was applied. If applicable.
	To time.Time `json:"to"`
}

Period A time period

type PortalToken

type PortalToken struct {
	// AllowedMeterSlugs Optional, if defined only the specified meters will be allowed
	AllowedMeterSlugs *[]string  `json:"allowedMeterSlugs,omitempty"`
	CreatedAt         *time.Time `json:"createdAt,omitempty"`
	Expired           *bool      `json:"expired,omitempty"`
	ExpiresAt         *time.Time `json:"expiresAt,omitempty"`
	Id                *string    `json:"id,omitempty"`
	Subject           string     `json:"subject"`

	// Token The token is only returned at creation.
	Token *string `json:"token,omitempty"`
}

PortalToken A consumer portal token.

type Problem

type Problem = models.StatusProblem

Problem A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

type QueryFilterGroupBy

type QueryFilterGroupBy map[string]string

QueryFilterGroupBy Simple filter for group bys with exact match.

Usage: `?filterGroupBy[type]=input&filterGroupBy[model]=gpt-4`

type QueryFilterLedgerID

type QueryFilterLedgerID = credit.LedgerID

QueryFilterLedgerID defines model for queryFilterLedgerID.

type QueryFilterSubject

type QueryFilterSubject = []string

QueryFilterSubject defines model for queryFilterSubject.

type QueryFrom

type QueryFrom = time.Time

QueryFrom defines model for queryFrom.

type QueryGroupBy

type QueryGroupBy = []string

QueryGroupBy defines model for queryGroupBy.

type QueryMeterParams

type QueryMeterParams struct {
	// From Start date-time in RFC 3339 format.
	// Inclusive.
	From *QueryFrom `form:"from,omitempty" json:"from,omitempty"`

	// To End date-time in RFC 3339 format.
	// Inclusive.
	To *QueryTo `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 *QueryWindowSize `form:"windowSize,omitempty" json:"windowSize,omitempty"`

	// WindowTimeZone The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones).
	// If not specified, the UTC timezone will be used.
	WindowTimeZone *QueryWindowTimeZone `form:"windowTimeZone,omitempty" json:"windowTimeZone,omitempty"`

	// Subject Filtering by multiple subjects.
	//
	// Usage: ?subject=customer-1&subject=customer-2
	Subject       *QueryFilterSubject `form:"subject,omitempty" json:"subject,omitempty"`
	FilterGroupBy *QueryFilterGroupBy `json:"filterGroupBy,omitempty"`

	// GroupBy If not specified a single aggregate will be returned for each subject and time window.
	// `subject` is a reserved group by value.
	GroupBy *QueryGroupBy `form:"groupBy,omitempty" json:"groupBy,omitempty"`
}

QueryMeterParams defines parameters for QueryMeter.

type QueryMeterResponse

type QueryMeterResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *MeterQueryResult
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	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 QueryPortalMeterParams

type QueryPortalMeterParams struct {
	// From Start date-time in RFC 3339 format.
	// Inclusive.
	From *QueryFrom `form:"from,omitempty" json:"from,omitempty"`

	// To End date-time in RFC 3339 format.
	// Inclusive.
	To *QueryTo `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 *QueryWindowSize `form:"windowSize,omitempty" json:"windowSize,omitempty"`

	// WindowTimeZone The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones).
	// If not specified, the UTC timezone will be used.
	WindowTimeZone *QueryWindowTimeZone `form:"windowTimeZone,omitempty" json:"windowTimeZone,omitempty"`
	FilterGroupBy  *QueryFilterGroupBy  `json:"filterGroupBy,omitempty"`

	// GroupBy If not specified a single aggregate will be returned for each subject and time window.
	// `subject` is a reserved group by value.
	GroupBy *QueryGroupBy `form:"groupBy,omitempty" json:"groupBy,omitempty"`
}

QueryPortalMeterParams defines parameters for QueryPortalMeter.

type QueryPortalMeterResponse

type QueryPortalMeterResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *MeterQueryResult
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseQueryPortalMeterResponse

func ParseQueryPortalMeterResponse(rsp *http.Response) (*QueryPortalMeterResponse, error)

ParseQueryPortalMeterResponse parses an HTTP response from a QueryPortalMeterWithResponse call

func (QueryPortalMeterResponse) Status

func (r QueryPortalMeterResponse) Status() string

Status returns HTTPResponse.Status

func (QueryPortalMeterResponse) StatusCode

func (r QueryPortalMeterResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type QueryTo

type QueryTo = time.Time

QueryTo defines model for queryTo.

type QueryWindowSize

type QueryWindowSize = WindowSize

QueryWindowSize Aggregation window size.

type QueryWindowTimeZone

type QueryWindowTimeZone = string

QueryWindowTimeZone defines model for queryWindowTimeZone.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResetLedgerJSONRequestBody

type ResetLedgerJSONRequestBody = LedgerReset

ResetLedgerJSONRequestBody defines body for ResetLedger for application/json ContentType.

type ResetLedgerResponse

type ResetLedgerResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON201                       *LedgerReset
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseResetLedgerResponse

func ParseResetLedgerResponse(rsp *http.Response) (*ResetLedgerResponse, error)

ParseResetLedgerResponse parses an HTTP response from a ResetLedgerWithResponse call

func (ResetLedgerResponse) Status

func (r ResetLedgerResponse) Status() string

Status returns HTTPResponse.Status

func (ResetLedgerResponse) StatusCode

func (r ResetLedgerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Subject

type Subject struct {
	CurrentPeriodEnd   *time.Time              `json:"currentPeriodEnd"`
	CurrentPeriodStart *time.Time              `json:"currentPeriodStart"`
	DisplayName        *string                 `json:"displayName"`
	Id                 *string                 `json:"id,omitempty"`
	Key                string                  `json:"key"`
	Metadata           *map[string]interface{} `json:"metadata"`
	StripeCustomerId   *string                 `json:"stripeCustomerId"`
}

Subject A subject is a unique identifier for a user or entity.

type SubjectIdOrKey

type SubjectIdOrKey = string

SubjectIdOrKey defines model for subjectIdOrKey.

type UnauthorizedProblemResponse

type UnauthorizedProblemResponse = Problem

UnauthorizedProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

type UnexpectedProblemResponse

type UnexpectedProblemResponse = Problem

UnexpectedProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.

type UpsertSubjectJSONBody

type UpsertSubjectJSONBody = []Subject

UpsertSubjectJSONBody defines parameters for UpsertSubject.

type UpsertSubjectJSONRequestBody

type UpsertSubjectJSONRequestBody = UpsertSubjectJSONBody

UpsertSubjectJSONRequestBody defines body for UpsertSubject for application/json ContentType.

type UpsertSubjectResponse

type UpsertSubjectResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	JSON200                       *[]Subject
	ApplicationproblemJSON400     *BadRequestProblemResponse
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON501     *NotImplementedProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseUpsertSubjectResponse

func ParseUpsertSubjectResponse(rsp *http.Response) (*UpsertSubjectResponse, error)

ParseUpsertSubjectResponse parses an HTTP response from a UpsertSubjectWithResponse call

func (UpsertSubjectResponse) Status

func (r UpsertSubjectResponse) Status() string

Status returns HTTPResponse.Status

func (UpsertSubjectResponse) StatusCode

func (r UpsertSubjectResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VoidLedgerGrantResponse

type VoidLedgerGrantResponse struct {
	Body                          []byte
	HTTPResponse                  *http.Response
	ApplicationproblemJSON401     *UnauthorizedProblemResponse
	ApplicationproblemJSON404     *NotFoundProblemResponse
	ApplicationproblemJSONDefault *UnexpectedProblemResponse
}

func ParseVoidLedgerGrantResponse

func ParseVoidLedgerGrantResponse(rsp *http.Response) (*VoidLedgerGrantResponse, error)

ParseVoidLedgerGrantResponse parses an HTTP response from a VoidLedgerGrantWithResponse call

func (VoidLedgerGrantResponse) Status

func (r VoidLedgerGrantResponse) Status() string

Status returns HTTPResponse.Status

func (VoidLedgerGrantResponse) StatusCode

func (r VoidLedgerGrantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type WindowSize

type WindowSize = models.WindowSize

WindowSize Aggregation window size.

Jump to

Keyboard shortcuts

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