Documentation
¶
Overview ¶
Package api 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
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type BadRequestProblemResponse
- type ChiServerOptions
- type CreateFeatureJSONRequestBody
- type CreateFeatureRequest
- type CreateLedger
- type CreateLedgerGrantJSONRequestBody
- type CreateLedgerGrantRequest
- type CreateLedgerJSONRequestBody
- type CreateMeterJSONRequestBody
- type CreatePortalTokenJSONRequestBody
- type Event
- type Feature
- type FeatureBalance
- type FeatureID
- type GetLedgerBalanceParams
- type GetLedgerHistoryParams
- type IdOrSlug
- type IngestEventsApplicationCloudeventsBatchPlusJSONBody
- type IngestEventsApplicationCloudeventsBatchPlusJSONRequestBody
- type IngestEventsApplicationCloudeventsPlusJSONRequestBody
- type IngestedEvent
- type InvalidParamFormatError
- type InvalidatePortalTokensJSONBody
- type InvalidatePortalTokensJSONRequestBody
- type Ledger
- type LedgerAlreadyExistsProblem
- type LedgerAlreadyExistsProblemResponse
- type LedgerBalance
- type LedgerEntry
- type LedgerEntryType
- type LedgerGrantBalance
- type LedgerGrantExpirationPeriod
- type LedgerGrantExpirationPeriodDuration
- type LedgerGrantID
- type LedgerGrantResponse
- type LedgerGrantRollover
- type LedgerGrantRolloverType
- type LedgerGrantType
- type LedgerID
- type LedgerIncludeVoids
- type LedgerQueryLimit
- type LedgerQueryOffset
- type LedgerReset
- type ListEventsParams
- type ListFeaturesParams
- type ListFeaturesParamsOrderBy
- type ListLedgerGrantsByLedgerParams
- type ListLedgerGrantsParams
- type ListLedgersParams
- type ListLedgersParamsOrderBy
- type ListPortalTokensParams
- type Meter
- type MeterAggregation
- type MeterIdOrSlug
- type MeterQueryResult
- type MeterQueryRow
- type MiddlewareFunc
- type NotFoundProblemResponse
- type NotImplementedProblemResponse
- type Period
- type PortalToken
- type Problem
- type QueryFilterGroupBy
- type QueryFilterLedgerID
- type QueryFilterSubject
- type QueryFrom
- type QueryGroupBy
- type QueryMeterParams
- type QueryPortalMeterParams
- type QueryTo
- type QueryWindowSize
- type QueryWindowTimeZone
- type RequiredHeaderError
- type RequiredParamError
- type ResetLedgerJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateFeature(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateLedger(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateLedgerGrant(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateMeter(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreatePortalToken(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteFeature(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteMeter(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteSubject(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetFeature(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLedgerBalance(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLedgerGrant(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLedgerHistory(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetMeter(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSubject(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) IngestEvents(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) InvalidatePortalTokens(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListEvents(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListFeatures(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListLedgerGrants(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListLedgerGrantsByLedger(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListLedgers(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListMeterSubjects(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListMeters(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListPortalTokens(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListSubjects(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) QueryMeter(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) QueryPortalMeter(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ResetLedger(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpsertSubject(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) VoidLedgerGrant(w http.ResponseWriter, r *http.Request)
- type Subject
- type SubjectIdOrKey
- type TooManyValuesForParamError
- type UnauthorizedProblemResponse
- type UnescapedCookieParamError
- type UnexpectedProblemResponse
- type Unimplemented
- func (_ Unimplemented) CreateFeature(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) CreateLedger(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) CreateLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
- func (_ Unimplemented) CreateMeter(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) CreatePortalToken(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
- func (_ Unimplemented) DeleteMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
- func (_ Unimplemented) DeleteSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
- func (_ Unimplemented) GetFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
- func (_ Unimplemented) GetLedgerBalance(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ...)
- func (_ Unimplemented) GetLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ...)
- func (_ Unimplemented) GetLedgerHistory(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ...)
- func (_ Unimplemented) GetMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
- func (_ Unimplemented) GetSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
- func (_ Unimplemented) IngestEvents(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) InvalidatePortalTokens(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)
- func (_ Unimplemented) ListFeatures(w http.ResponseWriter, r *http.Request, params ListFeaturesParams)
- func (_ Unimplemented) ListLedgerGrants(w http.ResponseWriter, r *http.Request, params ListLedgerGrantsParams)
- func (_ Unimplemented) ListLedgerGrantsByLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ...)
- func (_ Unimplemented) ListLedgers(w http.ResponseWriter, r *http.Request, params ListLedgersParams)
- func (_ Unimplemented) ListMeterSubjects(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
- func (_ Unimplemented) ListMeters(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListPortalTokens(w http.ResponseWriter, r *http.Request, params ListPortalTokensParams)
- func (_ Unimplemented) ListSubjects(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) QueryMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug, ...)
- func (_ Unimplemented) QueryPortalMeter(w http.ResponseWriter, r *http.Request, meterSlug string, ...)
- func (_ Unimplemented) ResetLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
- func (_ Unimplemented) UpsertSubject(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) VoidLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ...)
- type UnmarshalingParamError
- type UpsertSubjectJSONBody
- type UpsertSubjectJSONRequestBody
- type WindowSize
Constants ¶
const ( CloudCookieAuthScopes = "CloudCookieAuth.Scopes" CloudPortalTokenAuthScopes = "CloudPortalTokenAuth.Scopes" CloudTokenAuthScopes = "CloudTokenAuth.Scopes" PortalTokenAuthScopes = "PortalTokenAuth.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type BadRequestProblemResponse ¶
type BadRequestProblemResponse = Problem
BadRequestProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
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 CreateLedger ¶
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 CreateLedgerJSONRequestBody ¶
type CreateLedgerJSONRequestBody = CreateLedger
CreateLedgerJSONRequestBody defines body for CreateLedger for application/json ContentType.
type CreateMeterJSONRequestBody ¶
type CreateMeterJSONRequestBody = Meter
CreateMeterJSONRequestBody defines body for CreateMeter for application/json ContentType.
type CreatePortalTokenJSONRequestBody ¶
type CreatePortalTokenJSONRequestBody = PortalToken
CreatePortalTokenJSONRequestBody defines body for CreatePortalToken for application/json ContentType.
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 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 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 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 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 InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() 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 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.
const ( DAY LedgerGrantExpirationPeriodDuration = "DAY" HOUR LedgerGrantExpirationPeriodDuration = "HOUR" MONTH LedgerGrantExpirationPeriodDuration = "MONTH" WEEK LedgerGrantExpirationPeriodDuration = "WEEK" YEAR LedgerGrantExpirationPeriodDuration = "YEAR" )
Defines values for LedgerGrantExpirationPeriodDuration.
type LedgerGrantID ¶
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 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 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 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 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 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 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 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 MeterAggregation ¶
type MeterAggregation = models.MeterAggregation
MeterAggregation The aggregation type to use for the meter.
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 ¶
QueryFilterGroupBy Simple filter for group bys with exact match.
Usage: `?filterGroupBy[type]=input&filterGroupBy[model]=gpt-4`
type QueryFilterLedgerID ¶
QueryFilterLedgerID defines model for queryFilterLedgerID.
type QueryFilterSubject ¶
type QueryFilterSubject = []string
QueryFilterSubject defines model for queryFilterSubject.
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 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 QueryWindowTimeZone ¶
type QueryWindowTimeZone = string
QueryWindowTimeZone defines model for queryWindowTimeZone.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ResetLedgerJSONRequestBody ¶
type ResetLedgerJSONRequestBody = LedgerReset
ResetLedgerJSONRequestBody defines body for ResetLedger for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface {
// List ingested events
// (GET /api/v1/events)
ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)
// Ingest events
// (POST /api/v1/events)
IngestEvents(w http.ResponseWriter, r *http.Request)
// List features
// (GET /api/v1/features)
ListFeatures(w http.ResponseWriter, r *http.Request, params ListFeaturesParams)
// Create feature
// (POST /api/v1/features)
CreateFeature(w http.ResponseWriter, r *http.Request)
// Delete feature
// (DELETE /api/v1/features/{featureID})
DeleteFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
// Get feature
// (GET /api/v1/features/{featureID})
GetFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
// List the already defined ledgers.
// (GET /api/v1/ledgers)
ListLedgers(w http.ResponseWriter, r *http.Request, params ListLedgersParams)
// Creates the specified ledger
// (POST /api/v1/ledgers)
CreateLedger(w http.ResponseWriter, r *http.Request)
// List grants for multiple ledgers.
// (GET /api/v1/ledgers/grants)
ListLedgerGrants(w http.ResponseWriter, r *http.Request, params ListLedgerGrantsParams)
// Get the balance of a specific subject.
// (GET /api/v1/ledgers/{ledgerID}/balance)
GetLedgerBalance(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params GetLedgerBalanceParams)
// List ledger grants
// (GET /api/v1/ledgers/{ledgerID}/grants)
ListLedgerGrantsByLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params ListLedgerGrantsByLedgerParams)
// Create a grant on a specific ledger.
// (POST /api/v1/ledgers/{ledgerID}/grants)
CreateLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
// Void ledger grant
// (DELETE /api/v1/ledgers/{ledgerID}/grants/{ledgerGrantID})
VoidLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ledgerGrantID LedgerGrantID)
// Get a single grant.
// (GET /api/v1/ledgers/{ledgerID}/grants/{ledgerGrantID})
GetLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ledgerGrantID LedgerGrantID)
// Get the history of a ledger
// (GET /api/v1/ledgers/{ledgerID}/history)
GetLedgerHistory(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params GetLedgerHistoryParams)
// Reset the ledger's balance
// (POST /api/v1/ledgers/{ledgerID}/reset)
ResetLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
// List meters
// (GET /api/v1/meters)
ListMeters(w http.ResponseWriter, r *http.Request)
// ☁ Create meter
// (POST /api/v1/meters)
CreateMeter(w http.ResponseWriter, r *http.Request)
// ☁ Delete meter
// (DELETE /api/v1/meters/{meterIdOrSlug})
DeleteMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
// Get meter
// (GET /api/v1/meters/{meterIdOrSlug})
GetMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
// Query meter
// (GET /api/v1/meters/{meterIdOrSlug}/query)
QueryMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug, params QueryMeterParams)
// List meter subjects
// (GET /api/v1/meters/{meterIdOrSlug}/subjects)
ListMeterSubjects(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
// Query portal meter
// (GET /api/v1/portal/meters/{meterSlug}/query)
QueryPortalMeter(w http.ResponseWriter, r *http.Request, meterSlug string, params QueryPortalMeterParams)
// ☁ List portal tokens
// (GET /api/v1/portal/tokens)
ListPortalTokens(w http.ResponseWriter, r *http.Request, params ListPortalTokensParams)
// Create portal token
// (POST /api/v1/portal/tokens)
CreatePortalToken(w http.ResponseWriter, r *http.Request)
// ☁ Invalidate portal tokens
// (POST /api/v1/portal/tokens/invalidate)
InvalidatePortalTokens(w http.ResponseWriter, r *http.Request)
// ☁ List subjects
// (GET /api/v1/subjects)
ListSubjects(w http.ResponseWriter, r *http.Request)
// ☁ Upsert subject
// (POST /api/v1/subjects)
UpsertSubject(w http.ResponseWriter, r *http.Request)
// ☁ Delete subject
// (DELETE /api/v1/subjects/{subjectIdOrKey})
DeleteSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
// ☁ Get subject
// (GET /api/v1/subjects/{subjectIdOrKey})
GetSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateFeature ¶
func (siw *ServerInterfaceWrapper) CreateFeature(w http.ResponseWriter, r *http.Request)
CreateFeature operation middleware
func (*ServerInterfaceWrapper) CreateLedger ¶
func (siw *ServerInterfaceWrapper) CreateLedger(w http.ResponseWriter, r *http.Request)
CreateLedger operation middleware
func (*ServerInterfaceWrapper) CreateLedgerGrant ¶
func (siw *ServerInterfaceWrapper) CreateLedgerGrant(w http.ResponseWriter, r *http.Request)
CreateLedgerGrant operation middleware
func (*ServerInterfaceWrapper) CreateMeter ¶
func (siw *ServerInterfaceWrapper) CreateMeter(w http.ResponseWriter, r *http.Request)
CreateMeter operation middleware
func (*ServerInterfaceWrapper) CreatePortalToken ¶
func (siw *ServerInterfaceWrapper) CreatePortalToken(w http.ResponseWriter, r *http.Request)
CreatePortalToken operation middleware
func (*ServerInterfaceWrapper) DeleteFeature ¶
func (siw *ServerInterfaceWrapper) DeleteFeature(w http.ResponseWriter, r *http.Request)
DeleteFeature operation middleware
func (*ServerInterfaceWrapper) DeleteMeter ¶
func (siw *ServerInterfaceWrapper) DeleteMeter(w http.ResponseWriter, r *http.Request)
DeleteMeter operation middleware
func (*ServerInterfaceWrapper) DeleteSubject ¶
func (siw *ServerInterfaceWrapper) DeleteSubject(w http.ResponseWriter, r *http.Request)
DeleteSubject operation middleware
func (*ServerInterfaceWrapper) GetFeature ¶
func (siw *ServerInterfaceWrapper) GetFeature(w http.ResponseWriter, r *http.Request)
GetFeature operation middleware
func (*ServerInterfaceWrapper) GetLedgerBalance ¶
func (siw *ServerInterfaceWrapper) GetLedgerBalance(w http.ResponseWriter, r *http.Request)
GetLedgerBalance operation middleware
func (*ServerInterfaceWrapper) GetLedgerGrant ¶
func (siw *ServerInterfaceWrapper) GetLedgerGrant(w http.ResponseWriter, r *http.Request)
GetLedgerGrant operation middleware
func (*ServerInterfaceWrapper) GetLedgerHistory ¶
func (siw *ServerInterfaceWrapper) GetLedgerHistory(w http.ResponseWriter, r *http.Request)
GetLedgerHistory operation middleware
func (*ServerInterfaceWrapper) GetMeter ¶
func (siw *ServerInterfaceWrapper) GetMeter(w http.ResponseWriter, r *http.Request)
GetMeter operation middleware
func (*ServerInterfaceWrapper) GetSubject ¶
func (siw *ServerInterfaceWrapper) GetSubject(w http.ResponseWriter, r *http.Request)
GetSubject operation middleware
func (*ServerInterfaceWrapper) IngestEvents ¶
func (siw *ServerInterfaceWrapper) IngestEvents(w http.ResponseWriter, r *http.Request)
IngestEvents operation middleware
func (*ServerInterfaceWrapper) InvalidatePortalTokens ¶
func (siw *ServerInterfaceWrapper) InvalidatePortalTokens(w http.ResponseWriter, r *http.Request)
InvalidatePortalTokens operation middleware
func (*ServerInterfaceWrapper) ListEvents ¶
func (siw *ServerInterfaceWrapper) ListEvents(w http.ResponseWriter, r *http.Request)
ListEvents operation middleware
func (*ServerInterfaceWrapper) ListFeatures ¶
func (siw *ServerInterfaceWrapper) ListFeatures(w http.ResponseWriter, r *http.Request)
ListFeatures operation middleware
func (*ServerInterfaceWrapper) ListLedgerGrants ¶
func (siw *ServerInterfaceWrapper) ListLedgerGrants(w http.ResponseWriter, r *http.Request)
ListLedgerGrants operation middleware
func (*ServerInterfaceWrapper) ListLedgerGrantsByLedger ¶
func (siw *ServerInterfaceWrapper) ListLedgerGrantsByLedger(w http.ResponseWriter, r *http.Request)
ListLedgerGrantsByLedger operation middleware
func (*ServerInterfaceWrapper) ListLedgers ¶
func (siw *ServerInterfaceWrapper) ListLedgers(w http.ResponseWriter, r *http.Request)
ListLedgers operation middleware
func (*ServerInterfaceWrapper) ListMeterSubjects ¶
func (siw *ServerInterfaceWrapper) ListMeterSubjects(w http.ResponseWriter, r *http.Request)
ListMeterSubjects operation middleware
func (*ServerInterfaceWrapper) ListMeters ¶
func (siw *ServerInterfaceWrapper) ListMeters(w http.ResponseWriter, r *http.Request)
ListMeters operation middleware
func (*ServerInterfaceWrapper) ListPortalTokens ¶
func (siw *ServerInterfaceWrapper) ListPortalTokens(w http.ResponseWriter, r *http.Request)
ListPortalTokens operation middleware
func (*ServerInterfaceWrapper) ListSubjects ¶
func (siw *ServerInterfaceWrapper) ListSubjects(w http.ResponseWriter, r *http.Request)
ListSubjects operation middleware
func (*ServerInterfaceWrapper) QueryMeter ¶
func (siw *ServerInterfaceWrapper) QueryMeter(w http.ResponseWriter, r *http.Request)
QueryMeter operation middleware
func (*ServerInterfaceWrapper) QueryPortalMeter ¶
func (siw *ServerInterfaceWrapper) QueryPortalMeter(w http.ResponseWriter, r *http.Request)
QueryPortalMeter operation middleware
func (*ServerInterfaceWrapper) ResetLedger ¶
func (siw *ServerInterfaceWrapper) ResetLedger(w http.ResponseWriter, r *http.Request)
ResetLedger operation middleware
func (*ServerInterfaceWrapper) UpsertSubject ¶
func (siw *ServerInterfaceWrapper) UpsertSubject(w http.ResponseWriter, r *http.Request)
UpsertSubject operation middleware
func (*ServerInterfaceWrapper) VoidLedgerGrant ¶
func (siw *ServerInterfaceWrapper) VoidLedgerGrant(w http.ResponseWriter, r *http.Request)
VoidLedgerGrant operation middleware
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 TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnauthorizedProblemResponse ¶
type UnauthorizedProblemResponse = Problem
UnauthorizedProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnexpectedProblemResponse ¶
type UnexpectedProblemResponse = Problem
UnexpectedProblemResponse A Problem Details object (RFC 7807). Additional properties specific to the problem type may be present.
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateFeature ¶
func (_ Unimplemented) CreateFeature(w http.ResponseWriter, r *http.Request)
Create feature (POST /api/v1/features)
func (Unimplemented) CreateLedger ¶
func (_ Unimplemented) CreateLedger(w http.ResponseWriter, r *http.Request)
Creates the specified ledger (POST /api/v1/ledgers)
func (Unimplemented) CreateLedgerGrant ¶
func (_ Unimplemented) CreateLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
Create a grant on a specific ledger. (POST /api/v1/ledgers/{ledgerID}/grants)
func (Unimplemented) CreateMeter ¶
func (_ Unimplemented) CreateMeter(w http.ResponseWriter, r *http.Request)
☁ Create meter (POST /api/v1/meters)
func (Unimplemented) CreatePortalToken ¶
func (_ Unimplemented) CreatePortalToken(w http.ResponseWriter, r *http.Request)
Create portal token (POST /api/v1/portal/tokens)
func (Unimplemented) DeleteFeature ¶
func (_ Unimplemented) DeleteFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
Delete feature (DELETE /api/v1/features/{featureID})
func (Unimplemented) DeleteMeter ¶
func (_ Unimplemented) DeleteMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
☁ Delete meter (DELETE /api/v1/meters/{meterIdOrSlug})
func (Unimplemented) DeleteSubject ¶
func (_ Unimplemented) DeleteSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
☁ Delete subject (DELETE /api/v1/subjects/{subjectIdOrKey})
func (Unimplemented) GetFeature ¶
func (_ Unimplemented) GetFeature(w http.ResponseWriter, r *http.Request, featureID FeatureID)
Get feature (GET /api/v1/features/{featureID})
func (Unimplemented) GetLedgerBalance ¶
func (_ Unimplemented) GetLedgerBalance(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params GetLedgerBalanceParams)
Get the balance of a specific subject. (GET /api/v1/ledgers/{ledgerID}/balance)
func (Unimplemented) GetLedgerGrant ¶
func (_ Unimplemented) GetLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ledgerGrantID LedgerGrantID)
Get a single grant. (GET /api/v1/ledgers/{ledgerID}/grants/{ledgerGrantID})
func (Unimplemented) GetLedgerHistory ¶
func (_ Unimplemented) GetLedgerHistory(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params GetLedgerHistoryParams)
Get the history of a ledger (GET /api/v1/ledgers/{ledgerID}/history)
func (Unimplemented) GetMeter ¶
func (_ Unimplemented) GetMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
Get meter (GET /api/v1/meters/{meterIdOrSlug})
func (Unimplemented) GetSubject ¶
func (_ Unimplemented) GetSubject(w http.ResponseWriter, r *http.Request, subjectIdOrKey SubjectIdOrKey)
☁ Get subject (GET /api/v1/subjects/{subjectIdOrKey})
func (Unimplemented) IngestEvents ¶
func (_ Unimplemented) IngestEvents(w http.ResponseWriter, r *http.Request)
Ingest events (POST /api/v1/events)
func (Unimplemented) InvalidatePortalTokens ¶
func (_ Unimplemented) InvalidatePortalTokens(w http.ResponseWriter, r *http.Request)
☁ Invalidate portal tokens (POST /api/v1/portal/tokens/invalidate)
func (Unimplemented) ListEvents ¶
func (_ Unimplemented) ListEvents(w http.ResponseWriter, r *http.Request, params ListEventsParams)
List ingested events (GET /api/v1/events)
func (Unimplemented) ListFeatures ¶
func (_ Unimplemented) ListFeatures(w http.ResponseWriter, r *http.Request, params ListFeaturesParams)
List features (GET /api/v1/features)
func (Unimplemented) ListLedgerGrants ¶
func (_ Unimplemented) ListLedgerGrants(w http.ResponseWriter, r *http.Request, params ListLedgerGrantsParams)
List grants for multiple ledgers. (GET /api/v1/ledgers/grants)
func (Unimplemented) ListLedgerGrantsByLedger ¶
func (_ Unimplemented) ListLedgerGrantsByLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, params ListLedgerGrantsByLedgerParams)
List ledger grants (GET /api/v1/ledgers/{ledgerID}/grants)
func (Unimplemented) ListLedgers ¶
func (_ Unimplemented) ListLedgers(w http.ResponseWriter, r *http.Request, params ListLedgersParams)
List the already defined ledgers. (GET /api/v1/ledgers)
func (Unimplemented) ListMeterSubjects ¶
func (_ Unimplemented) ListMeterSubjects(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug)
List meter subjects (GET /api/v1/meters/{meterIdOrSlug}/subjects)
func (Unimplemented) ListMeters ¶
func (_ Unimplemented) ListMeters(w http.ResponseWriter, r *http.Request)
List meters (GET /api/v1/meters)
func (Unimplemented) ListPortalTokens ¶
func (_ Unimplemented) ListPortalTokens(w http.ResponseWriter, r *http.Request, params ListPortalTokensParams)
☁ List portal tokens (GET /api/v1/portal/tokens)
func (Unimplemented) ListSubjects ¶
func (_ Unimplemented) ListSubjects(w http.ResponseWriter, r *http.Request)
☁ List subjects (GET /api/v1/subjects)
func (Unimplemented) QueryMeter ¶
func (_ Unimplemented) QueryMeter(w http.ResponseWriter, r *http.Request, meterIdOrSlug MeterIdOrSlug, params QueryMeterParams)
Query meter (GET /api/v1/meters/{meterIdOrSlug}/query)
func (Unimplemented) QueryPortalMeter ¶
func (_ Unimplemented) QueryPortalMeter(w http.ResponseWriter, r *http.Request, meterSlug string, params QueryPortalMeterParams)
Query portal meter (GET /api/v1/portal/meters/{meterSlug}/query)
func (Unimplemented) ResetLedger ¶
func (_ Unimplemented) ResetLedger(w http.ResponseWriter, r *http.Request, ledgerID LedgerID)
Reset the ledger's balance (POST /api/v1/ledgers/{ledgerID}/reset)
func (Unimplemented) UpsertSubject ¶
func (_ Unimplemented) UpsertSubject(w http.ResponseWriter, r *http.Request)
☁ Upsert subject (POST /api/v1/subjects)
func (Unimplemented) VoidLedgerGrant ¶
func (_ Unimplemented) VoidLedgerGrant(w http.ResponseWriter, r *http.Request, ledgerID LedgerID, ledgerGrantID LedgerGrantID)
Void ledger grant (DELETE /api/v1/ledgers/{ledgerID}/grants/{ledgerGrantID})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpsertSubjectJSONBody ¶
type UpsertSubjectJSONBody = []Subject
UpsertSubjectJSONBody defines parameters for UpsertSubject.
type UpsertSubjectJSONRequestBody ¶
type UpsertSubjectJSONRequestBody = UpsertSubjectJSONBody
UpsertSubjectJSONRequestBody defines body for UpsertSubject for application/json ContentType.