mirror of
https://github.com/hanzoai/observability.git
synced 2026-10-30 20:22:53 +00:00
hanzoai/dashboards shipped as its own binary (msgType 206) serving five console
tRPC routers: dashboards, widgets, table batch-actions, view presets, monitors.
It is now this service's 200+ ordinal range and its dash_*.go files.
They were never two concerns. A dashboard is a saved QUERY over exactly the
traces, observations and scores this service owns, and both halves were blocked
on the SAME ClickHouse shim — kept apart, that shim had to be written twice
against two copies of one OLTP model, and chart/scoreHistogram could not reach
the scores they aggregate without a network hop. The duplication was already
visible in the capability bits: both services had independently minted a
PermAnalyticsRead. Merged, there is one.
Ordinals are the standalone binary's 0–29 offset by 200, not renumbered into the
gaps: the offset is mechanical and reversible, renumbering would silently
repoint a client built against the old ids.
Three conventions were doubled and are now single:
- TENANCY. authorize() answered both "may this caller invoke this method" and
"whose rows may it touch", returning a defaultOrg the handlers ignored while
each re-read projectId from its own params. Split: authorize() is the cap gate,
scope() is the ONE tenant resolver, and its project is passed to every handler.
A pipelined call now INHERITS its target's project instead of re-reading the
payload, so pipelining cannot be used to hop tenants. Server.defaultOrg was
dead once scope() existed and is deleted rather than left as unread state on a
security-relevant struct.
- NOT-IMPLEMENTED. Observability answered stubs 200 + Empty{Stubbed:true};
dashboards answered 501. Unified on 501 through one Server.stub helper. A
stubbed 200 carrying an empty result is indistinguishable at the call site from
a real query that matched nothing — the UI renders "no data" and the missing
backend never surfaces. The status is the one field a caller cannot skip
reading; a flag in the body is one it can, and eventually does.
- COLUMN NAMES. fDashDescription, fWidgetDescription and fDescription were three
constants for the column "description". One constant per column name now.
scope() reads the payload's field at text @0 without knowing its type, which is
silently wrong for any request struct that puts another text field first — and
wrong by reading ANOTHER TENANT'S rows, not by failing. That assumption is now
pinned by TestEveryRequestStructCarriesProjectIdAtZero over the schema itself
(43 declarations, 9 result structs exempted). Verified it fails when the
invariant is broken, not just that it passes.
Verified: 22 tests green (14 obs + 8 dashboards, bodies ported byte-identical so
they diff against the originals) plus the invariant; go vet clean; make zap-gen
byte-identical on regen; CGO_ENABLED=0 build ok.
go.sum carried the same moved-tag corruption fixed in hanzoai/dashboards
(age/pq/zap hashes restored to the checksum DB; threshold v1.9.4→v1.9.5 and
orm v0.6.14→v0.6.16, both unbuildable from a clean cache).
Co-authored-by: Hanzo Dev <[email protected]>
3195 lines
113 KiB
Go
3195 lines
113 KiB
Go
// Code generated by zapgen; DO NOT EDIT.
|
|
// source: observability.zap
|
|
|
|
package obs
|
|
|
|
import (
|
|
zap "github.com/zap-proto/go"
|
|
)
|
|
|
|
const (
|
|
projectScopeProjectIdOff = 0
|
|
projectScopeSize = 8
|
|
)
|
|
|
|
// ProjectScope is a zero-copy view into a ZAP-encoded ProjectScope message.
|
|
type ProjectScope struct{ o zap.Object }
|
|
|
|
// WrapProjectScope parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapProjectScope(b []byte) (ProjectScope, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ProjectScope{}, err
|
|
}
|
|
return ProjectScope{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ProjectScope) ProjectId() string { return t.o.Text(projectScopeProjectIdOff) }
|
|
|
|
// ProjectScopeInput collects the field values for NewProjectScope.
|
|
type ProjectScopeInput struct {
|
|
ProjectId string
|
|
}
|
|
|
|
// NewProjectScope builds a ZAP-encoded ProjectScope message from in and returns the bytes.
|
|
func NewProjectScope(in ProjectScopeInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(projectScopeSize)
|
|
ob.SetText(projectScopeProjectIdOff, in.ProjectId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
boolResultValueOff = 0
|
|
boolResultSize = 1
|
|
)
|
|
|
|
// BoolResult is a zero-copy view into a ZAP-encoded BoolResult message.
|
|
type BoolResult struct{ o zap.Object }
|
|
|
|
// WrapBoolResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapBoolResult(b []byte) (BoolResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return BoolResult{}, err
|
|
}
|
|
return BoolResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t BoolResult) Value() bool { return t.o.Bool(boolResultValueOff) }
|
|
|
|
// BoolResultInput collects the field values for NewBoolResult.
|
|
type BoolResultInput struct {
|
|
Value bool
|
|
}
|
|
|
|
// NewBoolResult builds a ZAP-encoded BoolResult message from in and returns the bytes.
|
|
func NewBoolResult(in BoolResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(boolResultSize)
|
|
ob.SetBool(boolResultValueOff, in.Value)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
mutationCountCountOff = 0
|
|
mutationCountSize = 8
|
|
)
|
|
|
|
// MutationCount is a zero-copy view into a ZAP-encoded MutationCount message.
|
|
type MutationCount struct{ o zap.Object }
|
|
|
|
// WrapMutationCount parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMutationCount(b []byte) (MutationCount, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return MutationCount{}, err
|
|
}
|
|
return MutationCount{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t MutationCount) Count() uint64 { return t.o.Uint64(mutationCountCountOff) }
|
|
|
|
// MutationCountInput collects the field values for NewMutationCount.
|
|
type MutationCountInput struct {
|
|
Count uint64
|
|
}
|
|
|
|
// NewMutationCount builds a ZAP-encoded MutationCount message from in and returns the bytes.
|
|
func NewMutationCount(in MutationCountInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(mutationCountSize)
|
|
ob.SetUint64(mutationCountCountOff, in.Count)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceByIdParamsProjectIdOff = 0
|
|
traceByIdParamsTraceIdOff = 8
|
|
traceByIdParamsTimestampOff = 16
|
|
traceByIdParamsFromTimestampOff = 24
|
|
traceByIdParamsSize = 32
|
|
)
|
|
|
|
// TraceByIdParams is a zero-copy view into a ZAP-encoded TraceByIdParams message.
|
|
type TraceByIdParams struct{ o zap.Object }
|
|
|
|
// WrapTraceByIdParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTraceByIdParams(b []byte) (TraceByIdParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TraceByIdParams{}, err
|
|
}
|
|
return TraceByIdParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TraceByIdParams) ProjectId() string { return t.o.Text(traceByIdParamsProjectIdOff) }
|
|
func (t TraceByIdParams) TraceId() string { return t.o.Text(traceByIdParamsTraceIdOff) }
|
|
func (t TraceByIdParams) Timestamp() int64 { return t.o.Int64(traceByIdParamsTimestampOff) }
|
|
func (t TraceByIdParams) FromTimestamp() int64 { return t.o.Int64(traceByIdParamsFromTimestampOff) }
|
|
|
|
// TraceByIdParamsInput collects the field values for NewTraceByIdParams.
|
|
type TraceByIdParamsInput struct {
|
|
ProjectId string
|
|
TraceId string
|
|
Timestamp int64
|
|
FromTimestamp int64
|
|
}
|
|
|
|
// NewTraceByIdParams builds a ZAP-encoded TraceByIdParams message from in and returns the bytes.
|
|
func NewTraceByIdParams(in TraceByIdParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceByIdParamsSize)
|
|
ob.SetText(traceByIdParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(traceByIdParamsTraceIdOff, in.TraceId)
|
|
ob.SetUint64(traceByIdParamsTimestampOff, uint64(in.Timestamp))
|
|
ob.SetUint64(traceByIdParamsFromTimestampOff, uint64(in.FromTimestamp))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceIdOff = 0
|
|
traceProjectIdOff = 8
|
|
traceNameOff = 16
|
|
traceUserIdOff = 24
|
|
traceSessionIdOff = 32
|
|
traceReleaseOff = 40
|
|
traceVersionOff = 48
|
|
traceInputOff = 56
|
|
traceOutputOff = 64
|
|
traceMetadataOff = 72
|
|
traceTagsOff = 80
|
|
traceBookmarkedOff = 88
|
|
tracePublicOff = 89
|
|
traceTimestampOff = 90
|
|
traceCreatedAtOff = 98
|
|
traceUpdatedAtOff = 106
|
|
tracePresentOff = 114
|
|
traceSize = 115
|
|
)
|
|
|
|
// Trace is a zero-copy view into a ZAP-encoded Trace message.
|
|
type Trace struct{ o zap.Object }
|
|
|
|
// WrapTrace parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTrace(b []byte) (Trace, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Trace{}, err
|
|
}
|
|
return Trace{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Trace) Id() string { return t.o.Text(traceIdOff) }
|
|
func (t Trace) ProjectId() string { return t.o.Text(traceProjectIdOff) }
|
|
func (t Trace) Name() string { return t.o.Text(traceNameOff) }
|
|
func (t Trace) UserId() string { return t.o.Text(traceUserIdOff) }
|
|
func (t Trace) SessionId() string { return t.o.Text(traceSessionIdOff) }
|
|
func (t Trace) Release() string { return t.o.Text(traceReleaseOff) }
|
|
func (t Trace) Version() string { return t.o.Text(traceVersionOff) }
|
|
func (t Trace) Input() string { return t.o.Text(traceInputOff) }
|
|
func (t Trace) Output() string { return t.o.Text(traceOutputOff) }
|
|
func (t Trace) Metadata() string { return t.o.Text(traceMetadataOff) }
|
|
func (t Trace) Tags() string { return t.o.Text(traceTagsOff) }
|
|
func (t Trace) Bookmarked() bool { return t.o.Bool(traceBookmarkedOff) }
|
|
func (t Trace) Public() bool { return t.o.Bool(tracePublicOff) }
|
|
func (t Trace) Timestamp() int64 { return t.o.Int64(traceTimestampOff) }
|
|
func (t Trace) CreatedAt() int64 { return t.o.Int64(traceCreatedAtOff) }
|
|
func (t Trace) UpdatedAt() int64 { return t.o.Int64(traceUpdatedAtOff) }
|
|
func (t Trace) Present() bool { return t.o.Bool(tracePresentOff) }
|
|
|
|
// TraceInput collects the field values for NewTrace.
|
|
type TraceInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
UserId string
|
|
SessionId string
|
|
Release string
|
|
Version string
|
|
Input string
|
|
Output string
|
|
Metadata string
|
|
Tags string
|
|
Bookmarked bool
|
|
Public bool
|
|
Timestamp int64
|
|
CreatedAt int64
|
|
UpdatedAt int64
|
|
Present bool
|
|
}
|
|
|
|
// NewTrace builds a ZAP-encoded Trace message from in and returns the bytes.
|
|
func NewTrace(in TraceInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceSize)
|
|
ob.SetText(traceIdOff, in.Id)
|
|
ob.SetText(traceProjectIdOff, in.ProjectId)
|
|
ob.SetText(traceNameOff, in.Name)
|
|
ob.SetText(traceUserIdOff, in.UserId)
|
|
ob.SetText(traceSessionIdOff, in.SessionId)
|
|
ob.SetText(traceReleaseOff, in.Release)
|
|
ob.SetText(traceVersionOff, in.Version)
|
|
ob.SetText(traceInputOff, in.Input)
|
|
ob.SetText(traceOutputOff, in.Output)
|
|
ob.SetText(traceMetadataOff, in.Metadata)
|
|
ob.SetText(traceTagsOff, in.Tags)
|
|
ob.SetBool(traceBookmarkedOff, in.Bookmarked)
|
|
ob.SetBool(tracePublicOff, in.Public)
|
|
ob.SetUint64(traceTimestampOff, uint64(in.Timestamp))
|
|
ob.SetUint64(traceCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(traceUpdatedAtOff, uint64(in.UpdatedAt))
|
|
ob.SetBool(tracePresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceWithDetailTraceOff = 0
|
|
traceWithDetailObservationsOff = 8
|
|
traceWithDetailScoresOff = 16
|
|
traceWithDetailLatencyOff = 24
|
|
traceWithDetailPresentOff = 32
|
|
traceWithDetailSize = 33
|
|
)
|
|
|
|
// TraceWithDetail is a zero-copy view into a ZAP-encoded TraceWithDetail message.
|
|
type TraceWithDetail struct{ o zap.Object }
|
|
|
|
// WrapTraceWithDetail parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTraceWithDetail(b []byte) (TraceWithDetail, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TraceWithDetail{}, err
|
|
}
|
|
return TraceWithDetail{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TraceWithDetail) Trace() []byte { return t.o.Bytes(traceWithDetailTraceOff) }
|
|
func (t TraceWithDetail) Observations() zap.List { return t.o.List(traceWithDetailObservationsOff) }
|
|
func (t TraceWithDetail) Scores() zap.List { return t.o.List(traceWithDetailScoresOff) }
|
|
func (t TraceWithDetail) Latency() float64 { return t.o.Float64(traceWithDetailLatencyOff) }
|
|
func (t TraceWithDetail) Present() bool { return t.o.Bool(traceWithDetailPresentOff) }
|
|
|
|
// TraceWithDetailInput collects the field values for NewTraceWithDetail.
|
|
type TraceWithDetailInput struct {
|
|
Trace []byte
|
|
Observations [][]byte
|
|
Scores [][]byte
|
|
Latency float64
|
|
Present bool
|
|
}
|
|
|
|
// NewTraceWithDetail builds a ZAP-encoded TraceWithDetail message from in and returns the bytes.
|
|
func NewTraceWithDetail(in TraceWithDetailInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceWithDetailSize)
|
|
ob.SetBytes(traceWithDetailTraceOff, in.Trace)
|
|
observationsLB := b.StartList(0)
|
|
for _, elem := range in.Observations {
|
|
observationsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(traceWithDetailObservationsOff, observationsLB.FinishOffset(), len(in.Observations))
|
|
scoresLB := b.StartList(0)
|
|
for _, elem := range in.Scores {
|
|
scoresLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(traceWithDetailScoresOff, scoresLB.FinishOffset(), len(in.Scores))
|
|
ob.SetFloat64(traceWithDetailLatencyOff, in.Latency)
|
|
ob.SetBool(traceWithDetailPresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceBookmarkParamsProjectIdOff = 0
|
|
traceBookmarkParamsTraceIdOff = 8
|
|
traceBookmarkParamsBookmarkedOff = 16
|
|
traceBookmarkParamsSize = 17
|
|
)
|
|
|
|
// TraceBookmarkParams is a zero-copy view into a ZAP-encoded TraceBookmarkParams message.
|
|
type TraceBookmarkParams struct{ o zap.Object }
|
|
|
|
// WrapTraceBookmarkParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTraceBookmarkParams(b []byte) (TraceBookmarkParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TraceBookmarkParams{}, err
|
|
}
|
|
return TraceBookmarkParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TraceBookmarkParams) ProjectId() string { return t.o.Text(traceBookmarkParamsProjectIdOff) }
|
|
func (t TraceBookmarkParams) TraceId() string { return t.o.Text(traceBookmarkParamsTraceIdOff) }
|
|
func (t TraceBookmarkParams) Bookmarked() bool { return t.o.Bool(traceBookmarkParamsBookmarkedOff) }
|
|
|
|
// TraceBookmarkParamsInput collects the field values for NewTraceBookmarkParams.
|
|
type TraceBookmarkParamsInput struct {
|
|
ProjectId string
|
|
TraceId string
|
|
Bookmarked bool
|
|
}
|
|
|
|
// NewTraceBookmarkParams builds a ZAP-encoded TraceBookmarkParams message from in and returns the bytes.
|
|
func NewTraceBookmarkParams(in TraceBookmarkParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceBookmarkParamsSize)
|
|
ob.SetText(traceBookmarkParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(traceBookmarkParamsTraceIdOff, in.TraceId)
|
|
ob.SetBool(traceBookmarkParamsBookmarkedOff, in.Bookmarked)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
tracePublishParamsProjectIdOff = 0
|
|
tracePublishParamsTraceIdOff = 8
|
|
tracePublishParamsPublicOff = 16
|
|
tracePublishParamsSize = 17
|
|
)
|
|
|
|
// TracePublishParams is a zero-copy view into a ZAP-encoded TracePublishParams message.
|
|
type TracePublishParams struct{ o zap.Object }
|
|
|
|
// WrapTracePublishParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTracePublishParams(b []byte) (TracePublishParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TracePublishParams{}, err
|
|
}
|
|
return TracePublishParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TracePublishParams) ProjectId() string { return t.o.Text(tracePublishParamsProjectIdOff) }
|
|
func (t TracePublishParams) TraceId() string { return t.o.Text(tracePublishParamsTraceIdOff) }
|
|
func (t TracePublishParams) Public() bool { return t.o.Bool(tracePublishParamsPublicOff) }
|
|
|
|
// TracePublishParamsInput collects the field values for NewTracePublishParams.
|
|
type TracePublishParamsInput struct {
|
|
ProjectId string
|
|
TraceId string
|
|
Public bool
|
|
}
|
|
|
|
// NewTracePublishParams builds a ZAP-encoded TracePublishParams message from in and returns the bytes.
|
|
func NewTracePublishParams(in TracePublishParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(tracePublishParamsSize)
|
|
ob.SetText(tracePublishParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(tracePublishParamsTraceIdOff, in.TraceId)
|
|
ob.SetBool(tracePublishParamsPublicOff, in.Public)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceUpdateTagsParamsProjectIdOff = 0
|
|
traceUpdateTagsParamsTraceIdOff = 8
|
|
traceUpdateTagsParamsTagsOff = 16
|
|
traceUpdateTagsParamsSize = 24
|
|
)
|
|
|
|
// TraceUpdateTagsParams is a zero-copy view into a ZAP-encoded TraceUpdateTagsParams message.
|
|
type TraceUpdateTagsParams struct{ o zap.Object }
|
|
|
|
// WrapTraceUpdateTagsParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTraceUpdateTagsParams(b []byte) (TraceUpdateTagsParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TraceUpdateTagsParams{}, err
|
|
}
|
|
return TraceUpdateTagsParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TraceUpdateTagsParams) ProjectId() string { return t.o.Text(traceUpdateTagsParamsProjectIdOff) }
|
|
func (t TraceUpdateTagsParams) TraceId() string { return t.o.Text(traceUpdateTagsParamsTraceIdOff) }
|
|
func (t TraceUpdateTagsParams) Tags() string { return t.o.Text(traceUpdateTagsParamsTagsOff) }
|
|
|
|
// TraceUpdateTagsParamsInput collects the field values for NewTraceUpdateTagsParams.
|
|
type TraceUpdateTagsParamsInput struct {
|
|
ProjectId string
|
|
TraceId string
|
|
Tags string
|
|
}
|
|
|
|
// NewTraceUpdateTagsParams builds a ZAP-encoded TraceUpdateTagsParams message from in and returns the bytes.
|
|
func NewTraceUpdateTagsParams(in TraceUpdateTagsParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceUpdateTagsParamsSize)
|
|
ob.SetText(traceUpdateTagsParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(traceUpdateTagsParamsTraceIdOff, in.TraceId)
|
|
ob.SetText(traceUpdateTagsParamsTagsOff, in.Tags)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
traceDeleteManyParamsProjectIdOff = 0
|
|
traceDeleteManyParamsTraceIdsOff = 8
|
|
traceDeleteManyParamsSize = 16
|
|
)
|
|
|
|
// TraceDeleteManyParams is a zero-copy view into a ZAP-encoded TraceDeleteManyParams message.
|
|
type TraceDeleteManyParams struct{ o zap.Object }
|
|
|
|
// WrapTraceDeleteManyParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTraceDeleteManyParams(b []byte) (TraceDeleteManyParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TraceDeleteManyParams{}, err
|
|
}
|
|
return TraceDeleteManyParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TraceDeleteManyParams) ProjectId() string { return t.o.Text(traceDeleteManyParamsProjectIdOff) }
|
|
func (t TraceDeleteManyParams) TraceIds() zap.List { return t.o.List(traceDeleteManyParamsTraceIdsOff) }
|
|
|
|
// TraceDeleteManyParamsInput collects the field values for NewTraceDeleteManyParams.
|
|
type TraceDeleteManyParamsInput struct {
|
|
ProjectId string
|
|
TraceIds [][]byte
|
|
}
|
|
|
|
// NewTraceDeleteManyParams builds a ZAP-encoded TraceDeleteManyParams message from in and returns the bytes.
|
|
func NewTraceDeleteManyParams(in TraceDeleteManyParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(traceDeleteManyParamsSize)
|
|
ob.SetText(traceDeleteManyParamsProjectIdOff, in.ProjectId)
|
|
traceIdsLB := b.StartList(0)
|
|
for _, elem := range in.TraceIds {
|
|
traceIdsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(traceDeleteManyParamsTraceIdsOff, traceIdsLB.FinishOffset(), len(in.TraceIds))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
observationByIdParamsProjectIdOff = 0
|
|
observationByIdParamsObservationIdOff = 8
|
|
observationByIdParamsTraceIdOff = 16
|
|
observationByIdParamsStartTimeOff = 24
|
|
observationByIdParamsVerbosityOff = 32
|
|
observationByIdParamsSize = 33
|
|
)
|
|
|
|
// ObservationByIdParams is a zero-copy view into a ZAP-encoded ObservationByIdParams message.
|
|
type ObservationByIdParams struct{ o zap.Object }
|
|
|
|
// WrapObservationByIdParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObservationByIdParams(b []byte) (ObservationByIdParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ObservationByIdParams{}, err
|
|
}
|
|
return ObservationByIdParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ObservationByIdParams) ProjectId() string { return t.o.Text(observationByIdParamsProjectIdOff) }
|
|
func (t ObservationByIdParams) ObservationId() string {
|
|
return t.o.Text(observationByIdParamsObservationIdOff)
|
|
}
|
|
func (t ObservationByIdParams) TraceId() string { return t.o.Text(observationByIdParamsTraceIdOff) }
|
|
func (t ObservationByIdParams) StartTime() int64 { return t.o.Int64(observationByIdParamsStartTimeOff) }
|
|
func (t ObservationByIdParams) Verbosity() uint8 { return t.o.Uint8(observationByIdParamsVerbosityOff) }
|
|
|
|
// ObservationByIdParamsInput collects the field values for NewObservationByIdParams.
|
|
type ObservationByIdParamsInput struct {
|
|
ProjectId string
|
|
ObservationId string
|
|
TraceId string
|
|
StartTime int64
|
|
Verbosity uint8
|
|
}
|
|
|
|
// NewObservationByIdParams builds a ZAP-encoded ObservationByIdParams message from in and returns the bytes.
|
|
func NewObservationByIdParams(in ObservationByIdParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(observationByIdParamsSize)
|
|
ob.SetText(observationByIdParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(observationByIdParamsObservationIdOff, in.ObservationId)
|
|
ob.SetText(observationByIdParamsTraceIdOff, in.TraceId)
|
|
ob.SetUint64(observationByIdParamsStartTimeOff, uint64(in.StartTime))
|
|
ob.SetUint8(observationByIdParamsVerbosityOff, in.Verbosity)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
observationIdOff = 0
|
|
observationTraceIdOff = 8
|
|
observationProjectIdOff = 16
|
|
observationTypeOff = 24
|
|
observationNameOff = 32
|
|
observationParentObservationIdOff = 40
|
|
observationStartTimeOff = 48
|
|
observationEndTimeOff = 56
|
|
observationInputOff = 64
|
|
observationOutputOff = 72
|
|
observationMetadataOff = 80
|
|
observationLevelOff = 88
|
|
observationStatusMessageOff = 96
|
|
observationModelOff = 104
|
|
observationInternalModelIdOff = 112
|
|
observationPromptTokensOff = 120
|
|
observationCompletionTokensOff = 128
|
|
observationTotalTokensOff = 136
|
|
observationPresentOff = 144
|
|
observationSize = 145
|
|
)
|
|
|
|
// Observation is a zero-copy view into a ZAP-encoded Observation message.
|
|
type Observation struct{ o zap.Object }
|
|
|
|
// WrapObservation parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObservation(b []byte) (Observation, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Observation{}, err
|
|
}
|
|
return Observation{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Observation) Id() string { return t.o.Text(observationIdOff) }
|
|
func (t Observation) TraceId() string { return t.o.Text(observationTraceIdOff) }
|
|
func (t Observation) ProjectId() string { return t.o.Text(observationProjectIdOff) }
|
|
func (t Observation) Type() string { return t.o.Text(observationTypeOff) }
|
|
func (t Observation) Name() string { return t.o.Text(observationNameOff) }
|
|
func (t Observation) ParentObservationId() string { return t.o.Text(observationParentObservationIdOff) }
|
|
func (t Observation) StartTime() int64 { return t.o.Int64(observationStartTimeOff) }
|
|
func (t Observation) EndTime() int64 { return t.o.Int64(observationEndTimeOff) }
|
|
func (t Observation) Input() string { return t.o.Text(observationInputOff) }
|
|
func (t Observation) Output() string { return t.o.Text(observationOutputOff) }
|
|
func (t Observation) Metadata() string { return t.o.Text(observationMetadataOff) }
|
|
func (t Observation) Level() string { return t.o.Text(observationLevelOff) }
|
|
func (t Observation) StatusMessage() string { return t.o.Text(observationStatusMessageOff) }
|
|
func (t Observation) Model() string { return t.o.Text(observationModelOff) }
|
|
func (t Observation) InternalModelId() string { return t.o.Text(observationInternalModelIdOff) }
|
|
func (t Observation) PromptTokens() int64 { return t.o.Int64(observationPromptTokensOff) }
|
|
func (t Observation) CompletionTokens() int64 { return t.o.Int64(observationCompletionTokensOff) }
|
|
func (t Observation) TotalTokens() int64 { return t.o.Int64(observationTotalTokensOff) }
|
|
func (t Observation) Present() bool { return t.o.Bool(observationPresentOff) }
|
|
|
|
// ObservationInput collects the field values for NewObservation.
|
|
type ObservationInput struct {
|
|
Id string
|
|
TraceId string
|
|
ProjectId string
|
|
Type string
|
|
Name string
|
|
ParentObservationId string
|
|
StartTime int64
|
|
EndTime int64
|
|
Input string
|
|
Output string
|
|
Metadata string
|
|
Level string
|
|
StatusMessage string
|
|
Model string
|
|
InternalModelId string
|
|
PromptTokens int64
|
|
CompletionTokens int64
|
|
TotalTokens int64
|
|
Present bool
|
|
}
|
|
|
|
// NewObservation builds a ZAP-encoded Observation message from in and returns the bytes.
|
|
func NewObservation(in ObservationInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(observationSize)
|
|
ob.SetText(observationIdOff, in.Id)
|
|
ob.SetText(observationTraceIdOff, in.TraceId)
|
|
ob.SetText(observationProjectIdOff, in.ProjectId)
|
|
ob.SetText(observationTypeOff, in.Type)
|
|
ob.SetText(observationNameOff, in.Name)
|
|
ob.SetText(observationParentObservationIdOff, in.ParentObservationId)
|
|
ob.SetUint64(observationStartTimeOff, uint64(in.StartTime))
|
|
ob.SetUint64(observationEndTimeOff, uint64(in.EndTime))
|
|
ob.SetText(observationInputOff, in.Input)
|
|
ob.SetText(observationOutputOff, in.Output)
|
|
ob.SetText(observationMetadataOff, in.Metadata)
|
|
ob.SetText(observationLevelOff, in.Level)
|
|
ob.SetText(observationStatusMessageOff, in.StatusMessage)
|
|
ob.SetText(observationModelOff, in.Model)
|
|
ob.SetText(observationInternalModelIdOff, in.InternalModelId)
|
|
ob.SetUint64(observationPromptTokensOff, uint64(in.PromptTokens))
|
|
ob.SetUint64(observationCompletionTokensOff, uint64(in.CompletionTokens))
|
|
ob.SetUint64(observationTotalTokensOff, uint64(in.TotalTokens))
|
|
ob.SetBool(observationPresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
observationIOIdOff = 0
|
|
observationIOInputOff = 8
|
|
observationIOOutputOff = 16
|
|
observationIOMetadataOff = 24
|
|
observationIOSize = 32
|
|
)
|
|
|
|
// ObservationIO is a zero-copy view into a ZAP-encoded ObservationIO message.
|
|
type ObservationIO struct{ o zap.Object }
|
|
|
|
// WrapObservationIO parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObservationIO(b []byte) (ObservationIO, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ObservationIO{}, err
|
|
}
|
|
return ObservationIO{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ObservationIO) Id() string { return t.o.Text(observationIOIdOff) }
|
|
func (t ObservationIO) Input() string { return t.o.Text(observationIOInputOff) }
|
|
func (t ObservationIO) Output() string { return t.o.Text(observationIOOutputOff) }
|
|
func (t ObservationIO) Metadata() string { return t.o.Text(observationIOMetadataOff) }
|
|
|
|
// ObservationIOInput collects the field values for NewObservationIO.
|
|
type ObservationIOInput struct {
|
|
Id string
|
|
Input string
|
|
Output string
|
|
Metadata string
|
|
}
|
|
|
|
// NewObservationIO builds a ZAP-encoded ObservationIO message from in and returns the bytes.
|
|
func NewObservationIO(in ObservationIOInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(observationIOSize)
|
|
ob.SetText(observationIOIdOff, in.Id)
|
|
ob.SetText(observationIOInputOff, in.Input)
|
|
ob.SetText(observationIOOutputOff, in.Output)
|
|
ob.SetText(observationIOMetadataOff, in.Metadata)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
observationIOListItemsOff = 0
|
|
observationIOListSize = 8
|
|
)
|
|
|
|
// ObservationIOList is a zero-copy view into a ZAP-encoded ObservationIOList message.
|
|
type ObservationIOList struct{ o zap.Object }
|
|
|
|
// WrapObservationIOList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObservationIOList(b []byte) (ObservationIOList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ObservationIOList{}, err
|
|
}
|
|
return ObservationIOList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ObservationIOList) Items() zap.List { return t.o.List(observationIOListItemsOff) }
|
|
|
|
// ObservationIOListInput collects the field values for NewObservationIOList.
|
|
type ObservationIOListInput struct {
|
|
Items [][]byte
|
|
}
|
|
|
|
// NewObservationIOList builds a ZAP-encoded ObservationIOList message from in and returns the bytes.
|
|
func NewObservationIOList(in ObservationIOListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(observationIOListSize)
|
|
itemsLB := b.StartList(0)
|
|
for _, elem := range in.Items {
|
|
itemsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(observationIOListItemsOff, itemsLB.FinishOffset(), len(in.Items))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
observationRefIdOff = 0
|
|
observationRefTraceIdOff = 8
|
|
observationRefSize = 16
|
|
)
|
|
|
|
// ObservationRef is a zero-copy view into a ZAP-encoded ObservationRef message.
|
|
type ObservationRef struct{ o zap.Object }
|
|
|
|
// WrapObservationRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapObservationRef(b []byte) (ObservationRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ObservationRef{}, err
|
|
}
|
|
return ObservationRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ObservationRef) Id() string { return t.o.Text(observationRefIdOff) }
|
|
func (t ObservationRef) TraceId() string { return t.o.Text(observationRefTraceIdOff) }
|
|
|
|
// ObservationRefInput collects the field values for NewObservationRef.
|
|
type ObservationRefInput struct {
|
|
Id string
|
|
TraceId string
|
|
}
|
|
|
|
// NewObservationRef builds a ZAP-encoded ObservationRef message from in and returns the bytes.
|
|
func NewObservationRef(in ObservationRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(observationRefSize)
|
|
ob.SetText(observationRefIdOff, in.Id)
|
|
ob.SetText(observationRefTraceIdOff, in.TraceId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
eventBatchIOParamsProjectIdOff = 0
|
|
eventBatchIOParamsObservationsOff = 8
|
|
eventBatchIOParamsMinStartTimeOff = 16
|
|
eventBatchIOParamsMaxStartTimeOff = 24
|
|
eventBatchIOParamsTruncatedOff = 32
|
|
eventBatchIOParamsSize = 33
|
|
)
|
|
|
|
// EventBatchIOParams is a zero-copy view into a ZAP-encoded EventBatchIOParams message.
|
|
type EventBatchIOParams struct{ o zap.Object }
|
|
|
|
// WrapEventBatchIOParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapEventBatchIOParams(b []byte) (EventBatchIOParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return EventBatchIOParams{}, err
|
|
}
|
|
return EventBatchIOParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t EventBatchIOParams) ProjectId() string { return t.o.Text(eventBatchIOParamsProjectIdOff) }
|
|
func (t EventBatchIOParams) Observations() zap.List {
|
|
return t.o.List(eventBatchIOParamsObservationsOff)
|
|
}
|
|
func (t EventBatchIOParams) MinStartTime() int64 { return t.o.Int64(eventBatchIOParamsMinStartTimeOff) }
|
|
func (t EventBatchIOParams) MaxStartTime() int64 { return t.o.Int64(eventBatchIOParamsMaxStartTimeOff) }
|
|
func (t EventBatchIOParams) Truncated() bool { return t.o.Bool(eventBatchIOParamsTruncatedOff) }
|
|
|
|
// EventBatchIOParamsInput collects the field values for NewEventBatchIOParams.
|
|
type EventBatchIOParamsInput struct {
|
|
ProjectId string
|
|
Observations [][]byte
|
|
MinStartTime int64
|
|
MaxStartTime int64
|
|
Truncated bool
|
|
}
|
|
|
|
// NewEventBatchIOParams builds a ZAP-encoded EventBatchIOParams message from in and returns the bytes.
|
|
func NewEventBatchIOParams(in EventBatchIOParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(eventBatchIOParamsSize)
|
|
ob.SetText(eventBatchIOParamsProjectIdOff, in.ProjectId)
|
|
observationsLB := b.StartList(0)
|
|
for _, elem := range in.Observations {
|
|
observationsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(eventBatchIOParamsObservationsOff, observationsLB.FinishOffset(), len(in.Observations))
|
|
ob.SetUint64(eventBatchIOParamsMinStartTimeOff, uint64(in.MinStartTime))
|
|
ob.SetUint64(eventBatchIOParamsMaxStartTimeOff, uint64(in.MaxStartTime))
|
|
ob.SetBool(eventBatchIOParamsTruncatedOff, in.Truncated)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
sessionByIdParamsProjectIdOff = 0
|
|
sessionByIdParamsSessionIdOff = 8
|
|
sessionByIdParamsSize = 16
|
|
)
|
|
|
|
// SessionByIdParams is a zero-copy view into a ZAP-encoded SessionByIdParams message.
|
|
type SessionByIdParams struct{ o zap.Object }
|
|
|
|
// WrapSessionByIdParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSessionByIdParams(b []byte) (SessionByIdParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return SessionByIdParams{}, err
|
|
}
|
|
return SessionByIdParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t SessionByIdParams) ProjectId() string { return t.o.Text(sessionByIdParamsProjectIdOff) }
|
|
func (t SessionByIdParams) SessionId() string { return t.o.Text(sessionByIdParamsSessionIdOff) }
|
|
|
|
// SessionByIdParamsInput collects the field values for NewSessionByIdParams.
|
|
type SessionByIdParamsInput struct {
|
|
ProjectId string
|
|
SessionId string
|
|
}
|
|
|
|
// NewSessionByIdParams builds a ZAP-encoded SessionByIdParams message from in and returns the bytes.
|
|
func NewSessionByIdParams(in SessionByIdParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(sessionByIdParamsSize)
|
|
ob.SetText(sessionByIdParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(sessionByIdParamsSessionIdOff, in.SessionId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
sessionIdOff = 0
|
|
sessionProjectIdOff = 8
|
|
sessionBookmarkedOff = 16
|
|
sessionPublicOff = 17
|
|
sessionCreatedAtOff = 18
|
|
sessionCountTracesOff = 26
|
|
sessionPresentOff = 34
|
|
sessionSize = 35
|
|
)
|
|
|
|
// Session is a zero-copy view into a ZAP-encoded Session message.
|
|
type Session struct{ o zap.Object }
|
|
|
|
// WrapSession parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSession(b []byte) (Session, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Session{}, err
|
|
}
|
|
return Session{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Session) Id() string { return t.o.Text(sessionIdOff) }
|
|
func (t Session) ProjectId() string { return t.o.Text(sessionProjectIdOff) }
|
|
func (t Session) Bookmarked() bool { return t.o.Bool(sessionBookmarkedOff) }
|
|
func (t Session) Public() bool { return t.o.Bool(sessionPublicOff) }
|
|
func (t Session) CreatedAt() int64 { return t.o.Int64(sessionCreatedAtOff) }
|
|
func (t Session) CountTraces() uint64 { return t.o.Uint64(sessionCountTracesOff) }
|
|
func (t Session) Present() bool { return t.o.Bool(sessionPresentOff) }
|
|
|
|
// SessionInput collects the field values for NewSession.
|
|
type SessionInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Bookmarked bool
|
|
Public bool
|
|
CreatedAt int64
|
|
CountTraces uint64
|
|
Present bool
|
|
}
|
|
|
|
// NewSession builds a ZAP-encoded Session message from in and returns the bytes.
|
|
func NewSession(in SessionInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(sessionSize)
|
|
ob.SetText(sessionIdOff, in.Id)
|
|
ob.SetText(sessionProjectIdOff, in.ProjectId)
|
|
ob.SetBool(sessionBookmarkedOff, in.Bookmarked)
|
|
ob.SetBool(sessionPublicOff, in.Public)
|
|
ob.SetUint64(sessionCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(sessionCountTracesOff, in.CountTraces)
|
|
ob.SetBool(sessionPresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
sessionWithScoresSessionOff = 0
|
|
sessionWithScoresScoresOff = 8
|
|
sessionWithScoresPresentOff = 16
|
|
sessionWithScoresSize = 17
|
|
)
|
|
|
|
// SessionWithScores is a zero-copy view into a ZAP-encoded SessionWithScores message.
|
|
type SessionWithScores struct{ o zap.Object }
|
|
|
|
// WrapSessionWithScores parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSessionWithScores(b []byte) (SessionWithScores, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return SessionWithScores{}, err
|
|
}
|
|
return SessionWithScores{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t SessionWithScores) Session() []byte { return t.o.Bytes(sessionWithScoresSessionOff) }
|
|
func (t SessionWithScores) Scores() zap.List { return t.o.List(sessionWithScoresScoresOff) }
|
|
func (t SessionWithScores) Present() bool { return t.o.Bool(sessionWithScoresPresentOff) }
|
|
|
|
// SessionWithScoresInput collects the field values for NewSessionWithScores.
|
|
type SessionWithScoresInput struct {
|
|
Session []byte
|
|
Scores [][]byte
|
|
Present bool
|
|
}
|
|
|
|
// NewSessionWithScores builds a ZAP-encoded SessionWithScores message from in and returns the bytes.
|
|
func NewSessionWithScores(in SessionWithScoresInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(sessionWithScoresSize)
|
|
ob.SetBytes(sessionWithScoresSessionOff, in.Session)
|
|
scoresLB := b.StartList(0)
|
|
for _, elem := range in.Scores {
|
|
scoresLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(sessionWithScoresScoresOff, scoresLB.FinishOffset(), len(in.Scores))
|
|
ob.SetBool(sessionWithScoresPresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
sessionBookmarkParamsProjectIdOff = 0
|
|
sessionBookmarkParamsSessionIdOff = 8
|
|
sessionBookmarkParamsBookmarkedOff = 16
|
|
sessionBookmarkParamsSize = 17
|
|
)
|
|
|
|
// SessionBookmarkParams is a zero-copy view into a ZAP-encoded SessionBookmarkParams message.
|
|
type SessionBookmarkParams struct{ o zap.Object }
|
|
|
|
// WrapSessionBookmarkParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSessionBookmarkParams(b []byte) (SessionBookmarkParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return SessionBookmarkParams{}, err
|
|
}
|
|
return SessionBookmarkParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t SessionBookmarkParams) ProjectId() string { return t.o.Text(sessionBookmarkParamsProjectIdOff) }
|
|
func (t SessionBookmarkParams) SessionId() string { return t.o.Text(sessionBookmarkParamsSessionIdOff) }
|
|
func (t SessionBookmarkParams) Bookmarked() bool { return t.o.Bool(sessionBookmarkParamsBookmarkedOff) }
|
|
|
|
// SessionBookmarkParamsInput collects the field values for NewSessionBookmarkParams.
|
|
type SessionBookmarkParamsInput struct {
|
|
ProjectId string
|
|
SessionId string
|
|
Bookmarked bool
|
|
}
|
|
|
|
// NewSessionBookmarkParams builds a ZAP-encoded SessionBookmarkParams message from in and returns the bytes.
|
|
func NewSessionBookmarkParams(in SessionBookmarkParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(sessionBookmarkParamsSize)
|
|
ob.SetText(sessionBookmarkParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(sessionBookmarkParamsSessionIdOff, in.SessionId)
|
|
ob.SetBool(sessionBookmarkParamsBookmarkedOff, in.Bookmarked)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
sessionPublishParamsProjectIdOff = 0
|
|
sessionPublishParamsSessionIdOff = 8
|
|
sessionPublishParamsPublicOff = 16
|
|
sessionPublishParamsSize = 17
|
|
)
|
|
|
|
// SessionPublishParams is a zero-copy view into a ZAP-encoded SessionPublishParams message.
|
|
type SessionPublishParams struct{ o zap.Object }
|
|
|
|
// WrapSessionPublishParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapSessionPublishParams(b []byte) (SessionPublishParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return SessionPublishParams{}, err
|
|
}
|
|
return SessionPublishParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t SessionPublishParams) ProjectId() string { return t.o.Text(sessionPublishParamsProjectIdOff) }
|
|
func (t SessionPublishParams) SessionId() string { return t.o.Text(sessionPublishParamsSessionIdOff) }
|
|
func (t SessionPublishParams) Public() bool { return t.o.Bool(sessionPublishParamsPublicOff) }
|
|
|
|
// SessionPublishParamsInput collects the field values for NewSessionPublishParams.
|
|
type SessionPublishParamsInput struct {
|
|
ProjectId string
|
|
SessionId string
|
|
Public bool
|
|
}
|
|
|
|
// NewSessionPublishParams builds a ZAP-encoded SessionPublishParams message from in and returns the bytes.
|
|
func NewSessionPublishParams(in SessionPublishParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(sessionPublishParamsSize)
|
|
ob.SetText(sessionPublishParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(sessionPublishParamsSessionIdOff, in.SessionId)
|
|
ob.SetBool(sessionPublishParamsPublicOff, in.Public)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreByIdParamsProjectIdOff = 0
|
|
scoreByIdParamsScoreIdOff = 8
|
|
scoreByIdParamsSize = 16
|
|
)
|
|
|
|
// ScoreByIdParams is a zero-copy view into a ZAP-encoded ScoreByIdParams message.
|
|
type ScoreByIdParams struct{ o zap.Object }
|
|
|
|
// WrapScoreByIdParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreByIdParams(b []byte) (ScoreByIdParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreByIdParams{}, err
|
|
}
|
|
return ScoreByIdParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreByIdParams) ProjectId() string { return t.o.Text(scoreByIdParamsProjectIdOff) }
|
|
func (t ScoreByIdParams) ScoreId() string { return t.o.Text(scoreByIdParamsScoreIdOff) }
|
|
|
|
// ScoreByIdParamsInput collects the field values for NewScoreByIdParams.
|
|
type ScoreByIdParamsInput struct {
|
|
ProjectId string
|
|
ScoreId string
|
|
}
|
|
|
|
// NewScoreByIdParams builds a ZAP-encoded ScoreByIdParams message from in and returns the bytes.
|
|
func NewScoreByIdParams(in ScoreByIdParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreByIdParamsSize)
|
|
ob.SetText(scoreByIdParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(scoreByIdParamsScoreIdOff, in.ScoreId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreIdOff = 0
|
|
scoreProjectIdOff = 8
|
|
scoreNameOff = 16
|
|
scoreValueOff = 24
|
|
scoreStringValueOff = 32
|
|
scoreDataTypeOff = 40
|
|
scoreSourceOff = 48
|
|
scoreCommentOff = 56
|
|
scoreTraceIdOff = 64
|
|
scoreObservationIdOff = 72
|
|
scoreSessionIdOff = 80
|
|
scoreScoreConfigIdOff = 88
|
|
scoreQueueIdOff = 96
|
|
scoreAuthorUserIdOff = 104
|
|
scoreEnvironmentOff = 112
|
|
scoreMetadataOff = 120
|
|
scoreTimestampOff = 128
|
|
scoreCreatedAtOff = 136
|
|
scoreUpdatedAtOff = 144
|
|
scorePresentOff = 152
|
|
scoreSize = 153
|
|
)
|
|
|
|
// Score is a zero-copy view into a ZAP-encoded Score message.
|
|
type Score struct{ o zap.Object }
|
|
|
|
// WrapScore parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScore(b []byte) (Score, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Score{}, err
|
|
}
|
|
return Score{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Score) Id() string { return t.o.Text(scoreIdOff) }
|
|
func (t Score) ProjectId() string { return t.o.Text(scoreProjectIdOff) }
|
|
func (t Score) Name() string { return t.o.Text(scoreNameOff) }
|
|
func (t Score) Value() float64 { return t.o.Float64(scoreValueOff) }
|
|
func (t Score) StringValue() string { return t.o.Text(scoreStringValueOff) }
|
|
func (t Score) DataType() string { return t.o.Text(scoreDataTypeOff) }
|
|
func (t Score) Source() string { return t.o.Text(scoreSourceOff) }
|
|
func (t Score) Comment() string { return t.o.Text(scoreCommentOff) }
|
|
func (t Score) TraceId() string { return t.o.Text(scoreTraceIdOff) }
|
|
func (t Score) ObservationId() string { return t.o.Text(scoreObservationIdOff) }
|
|
func (t Score) SessionId() string { return t.o.Text(scoreSessionIdOff) }
|
|
func (t Score) ScoreConfigId() string { return t.o.Text(scoreScoreConfigIdOff) }
|
|
func (t Score) QueueId() string { return t.o.Text(scoreQueueIdOff) }
|
|
func (t Score) AuthorUserId() string { return t.o.Text(scoreAuthorUserIdOff) }
|
|
func (t Score) Environment() string { return t.o.Text(scoreEnvironmentOff) }
|
|
func (t Score) Metadata() string { return t.o.Text(scoreMetadataOff) }
|
|
func (t Score) Timestamp() int64 { return t.o.Int64(scoreTimestampOff) }
|
|
func (t Score) CreatedAt() int64 { return t.o.Int64(scoreCreatedAtOff) }
|
|
func (t Score) UpdatedAt() int64 { return t.o.Int64(scoreUpdatedAtOff) }
|
|
func (t Score) Present() bool { return t.o.Bool(scorePresentOff) }
|
|
|
|
// ScoreInput collects the field values for NewScore.
|
|
type ScoreInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
Value float64
|
|
StringValue string
|
|
DataType string
|
|
Source string
|
|
Comment string
|
|
TraceId string
|
|
ObservationId string
|
|
SessionId string
|
|
ScoreConfigId string
|
|
QueueId string
|
|
AuthorUserId string
|
|
Environment string
|
|
Metadata string
|
|
Timestamp int64
|
|
CreatedAt int64
|
|
UpdatedAt int64
|
|
Present bool
|
|
}
|
|
|
|
// NewScore builds a ZAP-encoded Score message from in and returns the bytes.
|
|
func NewScore(in ScoreInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreSize)
|
|
ob.SetText(scoreIdOff, in.Id)
|
|
ob.SetText(scoreProjectIdOff, in.ProjectId)
|
|
ob.SetText(scoreNameOff, in.Name)
|
|
ob.SetFloat64(scoreValueOff, in.Value)
|
|
ob.SetText(scoreStringValueOff, in.StringValue)
|
|
ob.SetText(scoreDataTypeOff, in.DataType)
|
|
ob.SetText(scoreSourceOff, in.Source)
|
|
ob.SetText(scoreCommentOff, in.Comment)
|
|
ob.SetText(scoreTraceIdOff, in.TraceId)
|
|
ob.SetText(scoreObservationIdOff, in.ObservationId)
|
|
ob.SetText(scoreSessionIdOff, in.SessionId)
|
|
ob.SetText(scoreScoreConfigIdOff, in.ScoreConfigId)
|
|
ob.SetText(scoreQueueIdOff, in.QueueId)
|
|
ob.SetText(scoreAuthorUserIdOff, in.AuthorUserId)
|
|
ob.SetText(scoreEnvironmentOff, in.Environment)
|
|
ob.SetText(scoreMetadataOff, in.Metadata)
|
|
ob.SetUint64(scoreTimestampOff, uint64(in.Timestamp))
|
|
ob.SetUint64(scoreCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(scoreUpdatedAtOff, uint64(in.UpdatedAt))
|
|
ob.SetBool(scorePresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreListItemsOff = 0
|
|
scoreListSize = 8
|
|
)
|
|
|
|
// ScoreList is a zero-copy view into a ZAP-encoded ScoreList message.
|
|
type ScoreList struct{ o zap.Object }
|
|
|
|
// WrapScoreList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreList(b []byte) (ScoreList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreList{}, err
|
|
}
|
|
return ScoreList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreList) Items() zap.List { return t.o.List(scoreListItemsOff) }
|
|
|
|
// ScoreListInput collects the field values for NewScoreList.
|
|
type ScoreListInput struct {
|
|
Items [][]byte
|
|
}
|
|
|
|
// NewScoreList builds a ZAP-encoded ScoreList message from in and returns the bytes.
|
|
func NewScoreList(in ScoreListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreListSize)
|
|
itemsLB := b.StartList(0)
|
|
for _, elem := range in.Items {
|
|
itemsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(scoreListItemsOff, itemsLB.FinishOffset(), len(in.Items))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
annotationScoreParamsProjectIdOff = 0
|
|
annotationScoreParamsIdOff = 8
|
|
annotationScoreParamsNameOff = 16
|
|
annotationScoreParamsValueOff = 24
|
|
annotationScoreParamsStringValueOff = 32
|
|
annotationScoreParamsDataTypeOff = 40
|
|
annotationScoreParamsCommentOff = 48
|
|
annotationScoreParamsConfigIdOff = 56
|
|
annotationScoreParamsQueueIdOff = 64
|
|
annotationScoreParamsEnvironmentOff = 72
|
|
annotationScoreParamsScoreTargetTypeOff = 80
|
|
annotationScoreParamsTraceIdOff = 88
|
|
annotationScoreParamsObservationIdOff = 96
|
|
annotationScoreParamsSessionIdOff = 104
|
|
annotationScoreParamsTimestampOff = 112
|
|
annotationScoreParamsAuthorUserIdOff = 120
|
|
annotationScoreParamsSize = 128
|
|
)
|
|
|
|
// AnnotationScoreParams is a zero-copy view into a ZAP-encoded AnnotationScoreParams message.
|
|
type AnnotationScoreParams struct{ o zap.Object }
|
|
|
|
// WrapAnnotationScoreParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAnnotationScoreParams(b []byte) (AnnotationScoreParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AnnotationScoreParams{}, err
|
|
}
|
|
return AnnotationScoreParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AnnotationScoreParams) ProjectId() string { return t.o.Text(annotationScoreParamsProjectIdOff) }
|
|
func (t AnnotationScoreParams) Id() string { return t.o.Text(annotationScoreParamsIdOff) }
|
|
func (t AnnotationScoreParams) Name() string { return t.o.Text(annotationScoreParamsNameOff) }
|
|
func (t AnnotationScoreParams) Value() float64 { return t.o.Float64(annotationScoreParamsValueOff) }
|
|
func (t AnnotationScoreParams) StringValue() string {
|
|
return t.o.Text(annotationScoreParamsStringValueOff)
|
|
}
|
|
func (t AnnotationScoreParams) DataType() string { return t.o.Text(annotationScoreParamsDataTypeOff) }
|
|
func (t AnnotationScoreParams) Comment() string { return t.o.Text(annotationScoreParamsCommentOff) }
|
|
func (t AnnotationScoreParams) ConfigId() string { return t.o.Text(annotationScoreParamsConfigIdOff) }
|
|
func (t AnnotationScoreParams) QueueId() string { return t.o.Text(annotationScoreParamsQueueIdOff) }
|
|
func (t AnnotationScoreParams) Environment() string {
|
|
return t.o.Text(annotationScoreParamsEnvironmentOff)
|
|
}
|
|
func (t AnnotationScoreParams) ScoreTargetType() string {
|
|
return t.o.Text(annotationScoreParamsScoreTargetTypeOff)
|
|
}
|
|
func (t AnnotationScoreParams) TraceId() string { return t.o.Text(annotationScoreParamsTraceIdOff) }
|
|
func (t AnnotationScoreParams) ObservationId() string {
|
|
return t.o.Text(annotationScoreParamsObservationIdOff)
|
|
}
|
|
func (t AnnotationScoreParams) SessionId() string { return t.o.Text(annotationScoreParamsSessionIdOff) }
|
|
func (t AnnotationScoreParams) Timestamp() int64 { return t.o.Int64(annotationScoreParamsTimestampOff) }
|
|
func (t AnnotationScoreParams) AuthorUserId() string {
|
|
return t.o.Text(annotationScoreParamsAuthorUserIdOff)
|
|
}
|
|
|
|
// AnnotationScoreParamsInput collects the field values for NewAnnotationScoreParams.
|
|
type AnnotationScoreParamsInput struct {
|
|
ProjectId string
|
|
Id string
|
|
Name string
|
|
Value float64
|
|
StringValue string
|
|
DataType string
|
|
Comment string
|
|
ConfigId string
|
|
QueueId string
|
|
Environment string
|
|
ScoreTargetType string
|
|
TraceId string
|
|
ObservationId string
|
|
SessionId string
|
|
Timestamp int64
|
|
AuthorUserId string
|
|
}
|
|
|
|
// NewAnnotationScoreParams builds a ZAP-encoded AnnotationScoreParams message from in and returns the bytes.
|
|
func NewAnnotationScoreParams(in AnnotationScoreParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(annotationScoreParamsSize)
|
|
ob.SetText(annotationScoreParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(annotationScoreParamsIdOff, in.Id)
|
|
ob.SetText(annotationScoreParamsNameOff, in.Name)
|
|
ob.SetFloat64(annotationScoreParamsValueOff, in.Value)
|
|
ob.SetText(annotationScoreParamsStringValueOff, in.StringValue)
|
|
ob.SetText(annotationScoreParamsDataTypeOff, in.DataType)
|
|
ob.SetText(annotationScoreParamsCommentOff, in.Comment)
|
|
ob.SetText(annotationScoreParamsConfigIdOff, in.ConfigId)
|
|
ob.SetText(annotationScoreParamsQueueIdOff, in.QueueId)
|
|
ob.SetText(annotationScoreParamsEnvironmentOff, in.Environment)
|
|
ob.SetText(annotationScoreParamsScoreTargetTypeOff, in.ScoreTargetType)
|
|
ob.SetText(annotationScoreParamsTraceIdOff, in.TraceId)
|
|
ob.SetText(annotationScoreParamsObservationIdOff, in.ObservationId)
|
|
ob.SetText(annotationScoreParamsSessionIdOff, in.SessionId)
|
|
ob.SetUint64(annotationScoreParamsTimestampOff, uint64(in.Timestamp))
|
|
ob.SetText(annotationScoreParamsAuthorUserIdOff, in.AuthorUserId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
eventScoresParamsProjectIdOff = 0
|
|
eventScoresParamsTraceIdOff = 8
|
|
eventScoresParamsTimestampOff = 16
|
|
eventScoresParamsSize = 24
|
|
)
|
|
|
|
// EventScoresParams is a zero-copy view into a ZAP-encoded EventScoresParams message.
|
|
type EventScoresParams struct{ o zap.Object }
|
|
|
|
// WrapEventScoresParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapEventScoresParams(b []byte) (EventScoresParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return EventScoresParams{}, err
|
|
}
|
|
return EventScoresParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t EventScoresParams) ProjectId() string { return t.o.Text(eventScoresParamsProjectIdOff) }
|
|
func (t EventScoresParams) TraceId() string { return t.o.Text(eventScoresParamsTraceIdOff) }
|
|
func (t EventScoresParams) Timestamp() int64 { return t.o.Int64(eventScoresParamsTimestampOff) }
|
|
|
|
// EventScoresParamsInput collects the field values for NewEventScoresParams.
|
|
type EventScoresParamsInput struct {
|
|
ProjectId string
|
|
TraceId string
|
|
Timestamp int64
|
|
}
|
|
|
|
// NewEventScoresParams builds a ZAP-encoded EventScoresParams message from in and returns the bytes.
|
|
func NewEventScoresParams(in EventScoresParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(eventScoresParamsSize)
|
|
ob.SetText(eventScoresParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(eventScoresParamsTraceIdOff, in.TraceId)
|
|
ob.SetUint64(eventScoresParamsTimestampOff, uint64(in.Timestamp))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreConfigByIdParamsProjectIdOff = 0
|
|
scoreConfigByIdParamsIdOff = 8
|
|
scoreConfigByIdParamsSize = 16
|
|
)
|
|
|
|
// ScoreConfigByIdParams is a zero-copy view into a ZAP-encoded ScoreConfigByIdParams message.
|
|
type ScoreConfigByIdParams struct{ o zap.Object }
|
|
|
|
// WrapScoreConfigByIdParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreConfigByIdParams(b []byte) (ScoreConfigByIdParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreConfigByIdParams{}, err
|
|
}
|
|
return ScoreConfigByIdParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreConfigByIdParams) ProjectId() string { return t.o.Text(scoreConfigByIdParamsProjectIdOff) }
|
|
func (t ScoreConfigByIdParams) Id() string { return t.o.Text(scoreConfigByIdParamsIdOff) }
|
|
|
|
// ScoreConfigByIdParamsInput collects the field values for NewScoreConfigByIdParams.
|
|
type ScoreConfigByIdParamsInput struct {
|
|
ProjectId string
|
|
Id string
|
|
}
|
|
|
|
// NewScoreConfigByIdParams builds a ZAP-encoded ScoreConfigByIdParams message from in and returns the bytes.
|
|
func NewScoreConfigByIdParams(in ScoreConfigByIdParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreConfigByIdParamsSize)
|
|
ob.SetText(scoreConfigByIdParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(scoreConfigByIdParamsIdOff, in.Id)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreConfigAllParamsProjectIdOff = 0
|
|
scoreConfigAllParamsLimitOff = 8
|
|
scoreConfigAllParamsPageOff = 12
|
|
scoreConfigAllParamsSize = 16
|
|
)
|
|
|
|
// ScoreConfigAllParams is a zero-copy view into a ZAP-encoded ScoreConfigAllParams message.
|
|
type ScoreConfigAllParams struct{ o zap.Object }
|
|
|
|
// WrapScoreConfigAllParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreConfigAllParams(b []byte) (ScoreConfigAllParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreConfigAllParams{}, err
|
|
}
|
|
return ScoreConfigAllParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreConfigAllParams) ProjectId() string { return t.o.Text(scoreConfigAllParamsProjectIdOff) }
|
|
func (t ScoreConfigAllParams) Limit() uint32 { return t.o.Uint32(scoreConfigAllParamsLimitOff) }
|
|
func (t ScoreConfigAllParams) Page() uint32 { return t.o.Uint32(scoreConfigAllParamsPageOff) }
|
|
|
|
// ScoreConfigAllParamsInput collects the field values for NewScoreConfigAllParams.
|
|
type ScoreConfigAllParamsInput struct {
|
|
ProjectId string
|
|
Limit uint32
|
|
Page uint32
|
|
}
|
|
|
|
// NewScoreConfigAllParams builds a ZAP-encoded ScoreConfigAllParams message from in and returns the bytes.
|
|
func NewScoreConfigAllParams(in ScoreConfigAllParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreConfigAllParamsSize)
|
|
ob.SetText(scoreConfigAllParamsProjectIdOff, in.ProjectId)
|
|
ob.SetUint32(scoreConfigAllParamsLimitOff, in.Limit)
|
|
ob.SetUint32(scoreConfigAllParamsPageOff, in.Page)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreConfigIdOff = 0
|
|
scoreConfigProjectIdOff = 8
|
|
scoreConfigNameOff = 16
|
|
scoreConfigDataTypeOff = 24
|
|
scoreConfigMinValueOff = 32
|
|
scoreConfigMaxValueOff = 40
|
|
scoreConfigHasMinOff = 48
|
|
scoreConfigHasMaxOff = 49
|
|
scoreConfigCategoriesOff = 50
|
|
scoreConfigDescriptionOff = 58
|
|
scoreConfigIsArchivedOff = 66
|
|
scoreConfigCreatedAtOff = 74
|
|
scoreConfigUpdatedAtOff = 82
|
|
scoreConfigPresentOff = 90
|
|
scoreConfigSize = 91
|
|
)
|
|
|
|
// ScoreConfig is a zero-copy view into a ZAP-encoded ScoreConfig message.
|
|
type ScoreConfig struct{ o zap.Object }
|
|
|
|
// WrapScoreConfig parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreConfig(b []byte) (ScoreConfig, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreConfig{}, err
|
|
}
|
|
return ScoreConfig{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreConfig) Id() string { return t.o.Text(scoreConfigIdOff) }
|
|
func (t ScoreConfig) ProjectId() string { return t.o.Text(scoreConfigProjectIdOff) }
|
|
func (t ScoreConfig) Name() string { return t.o.Text(scoreConfigNameOff) }
|
|
func (t ScoreConfig) DataType() string { return t.o.Text(scoreConfigDataTypeOff) }
|
|
func (t ScoreConfig) MinValue() float64 { return t.o.Float64(scoreConfigMinValueOff) }
|
|
func (t ScoreConfig) MaxValue() float64 { return t.o.Float64(scoreConfigMaxValueOff) }
|
|
func (t ScoreConfig) HasMin() bool { return t.o.Bool(scoreConfigHasMinOff) }
|
|
func (t ScoreConfig) HasMax() bool { return t.o.Bool(scoreConfigHasMaxOff) }
|
|
func (t ScoreConfig) Categories() string { return t.o.Text(scoreConfigCategoriesOff) }
|
|
func (t ScoreConfig) Description() string { return t.o.Text(scoreConfigDescriptionOff) }
|
|
func (t ScoreConfig) IsArchived() bool { return t.o.Bool(scoreConfigIsArchivedOff) }
|
|
func (t ScoreConfig) CreatedAt() int64 { return t.o.Int64(scoreConfigCreatedAtOff) }
|
|
func (t ScoreConfig) UpdatedAt() int64 { return t.o.Int64(scoreConfigUpdatedAtOff) }
|
|
func (t ScoreConfig) Present() bool { return t.o.Bool(scoreConfigPresentOff) }
|
|
|
|
// ScoreConfigInput collects the field values for NewScoreConfig.
|
|
type ScoreConfigInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
DataType string
|
|
MinValue float64
|
|
MaxValue float64
|
|
HasMin bool
|
|
HasMax bool
|
|
Categories string
|
|
Description string
|
|
IsArchived bool
|
|
CreatedAt int64
|
|
UpdatedAt int64
|
|
Present bool
|
|
}
|
|
|
|
// NewScoreConfig builds a ZAP-encoded ScoreConfig message from in and returns the bytes.
|
|
func NewScoreConfig(in ScoreConfigInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreConfigSize)
|
|
ob.SetText(scoreConfigIdOff, in.Id)
|
|
ob.SetText(scoreConfigProjectIdOff, in.ProjectId)
|
|
ob.SetText(scoreConfigNameOff, in.Name)
|
|
ob.SetText(scoreConfigDataTypeOff, in.DataType)
|
|
ob.SetFloat64(scoreConfigMinValueOff, in.MinValue)
|
|
ob.SetFloat64(scoreConfigMaxValueOff, in.MaxValue)
|
|
ob.SetBool(scoreConfigHasMinOff, in.HasMin)
|
|
ob.SetBool(scoreConfigHasMaxOff, in.HasMax)
|
|
ob.SetText(scoreConfigCategoriesOff, in.Categories)
|
|
ob.SetText(scoreConfigDescriptionOff, in.Description)
|
|
ob.SetBool(scoreConfigIsArchivedOff, in.IsArchived)
|
|
ob.SetUint64(scoreConfigCreatedAtOff, uint64(in.CreatedAt))
|
|
ob.SetUint64(scoreConfigUpdatedAtOff, uint64(in.UpdatedAt))
|
|
ob.SetBool(scoreConfigPresentOff, in.Present)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreConfigListItemsOff = 0
|
|
scoreConfigListTotalCountOff = 8
|
|
scoreConfigListSize = 16
|
|
)
|
|
|
|
// ScoreConfigList is a zero-copy view into a ZAP-encoded ScoreConfigList message.
|
|
type ScoreConfigList struct{ o zap.Object }
|
|
|
|
// WrapScoreConfigList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreConfigList(b []byte) (ScoreConfigList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreConfigList{}, err
|
|
}
|
|
return ScoreConfigList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreConfigList) Items() zap.List { return t.o.List(scoreConfigListItemsOff) }
|
|
func (t ScoreConfigList) TotalCount() uint64 { return t.o.Uint64(scoreConfigListTotalCountOff) }
|
|
|
|
// ScoreConfigListInput collects the field values for NewScoreConfigList.
|
|
type ScoreConfigListInput struct {
|
|
Items [][]byte
|
|
TotalCount uint64
|
|
}
|
|
|
|
// NewScoreConfigList builds a ZAP-encoded ScoreConfigList message from in and returns the bytes.
|
|
func NewScoreConfigList(in ScoreConfigListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreConfigListSize)
|
|
itemsLB := b.StartList(0)
|
|
for _, elem := range in.Items {
|
|
itemsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(scoreConfigListItemsOff, itemsLB.FinishOffset(), len(in.Items))
|
|
ob.SetUint64(scoreConfigListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
scoreConfigWriteParamsProjectIdOff = 0
|
|
scoreConfigWriteParamsIdOff = 8
|
|
scoreConfigWriteParamsNameOff = 16
|
|
scoreConfigWriteParamsDataTypeOff = 24
|
|
scoreConfigWriteParamsMinValueOff = 32
|
|
scoreConfigWriteParamsMaxValueOff = 40
|
|
scoreConfigWriteParamsHasMinOff = 48
|
|
scoreConfigWriteParamsHasMaxOff = 49
|
|
scoreConfigWriteParamsCategoriesOff = 50
|
|
scoreConfigWriteParamsDescriptionOff = 58
|
|
scoreConfigWriteParamsIsArchivedOff = 66
|
|
scoreConfigWriteParamsSetIsArchivedOff = 67
|
|
scoreConfigWriteParamsSetNameOff = 68
|
|
scoreConfigWriteParamsSetCategoriesOff = 69
|
|
scoreConfigWriteParamsSize = 70
|
|
)
|
|
|
|
// ScoreConfigWriteParams is a zero-copy view into a ZAP-encoded ScoreConfigWriteParams message.
|
|
type ScoreConfigWriteParams struct{ o zap.Object }
|
|
|
|
// WrapScoreConfigWriteParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapScoreConfigWriteParams(b []byte) (ScoreConfigWriteParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ScoreConfigWriteParams{}, err
|
|
}
|
|
return ScoreConfigWriteParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ScoreConfigWriteParams) ProjectId() string {
|
|
return t.o.Text(scoreConfigWriteParamsProjectIdOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) Id() string { return t.o.Text(scoreConfigWriteParamsIdOff) }
|
|
func (t ScoreConfigWriteParams) Name() string { return t.o.Text(scoreConfigWriteParamsNameOff) }
|
|
func (t ScoreConfigWriteParams) DataType() string { return t.o.Text(scoreConfigWriteParamsDataTypeOff) }
|
|
func (t ScoreConfigWriteParams) MinValue() float64 {
|
|
return t.o.Float64(scoreConfigWriteParamsMinValueOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) MaxValue() float64 {
|
|
return t.o.Float64(scoreConfigWriteParamsMaxValueOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) HasMin() bool { return t.o.Bool(scoreConfigWriteParamsHasMinOff) }
|
|
func (t ScoreConfigWriteParams) HasMax() bool { return t.o.Bool(scoreConfigWriteParamsHasMaxOff) }
|
|
func (t ScoreConfigWriteParams) Categories() string {
|
|
return t.o.Text(scoreConfigWriteParamsCategoriesOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) Description() string {
|
|
return t.o.Text(scoreConfigWriteParamsDescriptionOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) IsArchived() bool {
|
|
return t.o.Bool(scoreConfigWriteParamsIsArchivedOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) SetIsArchived() bool {
|
|
return t.o.Bool(scoreConfigWriteParamsSetIsArchivedOff)
|
|
}
|
|
func (t ScoreConfigWriteParams) SetName() bool { return t.o.Bool(scoreConfigWriteParamsSetNameOff) }
|
|
func (t ScoreConfigWriteParams) SetCategories() bool {
|
|
return t.o.Bool(scoreConfigWriteParamsSetCategoriesOff)
|
|
}
|
|
|
|
// ScoreConfigWriteParamsInput collects the field values for NewScoreConfigWriteParams.
|
|
type ScoreConfigWriteParamsInput struct {
|
|
ProjectId string
|
|
Id string
|
|
Name string
|
|
DataType string
|
|
MinValue float64
|
|
MaxValue float64
|
|
HasMin bool
|
|
HasMax bool
|
|
Categories string
|
|
Description string
|
|
IsArchived bool
|
|
SetIsArchived bool
|
|
SetName bool
|
|
SetCategories bool
|
|
}
|
|
|
|
// NewScoreConfigWriteParams builds a ZAP-encoded ScoreConfigWriteParams message from in and returns the bytes.
|
|
func NewScoreConfigWriteParams(in ScoreConfigWriteParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(scoreConfigWriteParamsSize)
|
|
ob.SetText(scoreConfigWriteParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(scoreConfigWriteParamsIdOff, in.Id)
|
|
ob.SetText(scoreConfigWriteParamsNameOff, in.Name)
|
|
ob.SetText(scoreConfigWriteParamsDataTypeOff, in.DataType)
|
|
ob.SetFloat64(scoreConfigWriteParamsMinValueOff, in.MinValue)
|
|
ob.SetFloat64(scoreConfigWriteParamsMaxValueOff, in.MaxValue)
|
|
ob.SetBool(scoreConfigWriteParamsHasMinOff, in.HasMin)
|
|
ob.SetBool(scoreConfigWriteParamsHasMaxOff, in.HasMax)
|
|
ob.SetText(scoreConfigWriteParamsCategoriesOff, in.Categories)
|
|
ob.SetText(scoreConfigWriteParamsDescriptionOff, in.Description)
|
|
ob.SetBool(scoreConfigWriteParamsIsArchivedOff, in.IsArchived)
|
|
ob.SetBool(scoreConfigWriteParamsSetIsArchivedOff, in.SetIsArchived)
|
|
ob.SetBool(scoreConfigWriteParamsSetNameOff, in.SetName)
|
|
ob.SetBool(scoreConfigWriteParamsSetCategoriesOff, in.SetCategories)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
tableQueryParamsProjectIdOff = 0
|
|
tableQueryParamsFilterOff = 8
|
|
tableQueryParamsOrderByOff = 16
|
|
tableQueryParamsSearchQueryOff = 24
|
|
tableQueryParamsLimitOff = 32
|
|
tableQueryParamsPageOff = 36
|
|
tableQueryParamsSize = 40
|
|
)
|
|
|
|
// TableQueryParams is a zero-copy view into a ZAP-encoded TableQueryParams message.
|
|
type TableQueryParams struct{ o zap.Object }
|
|
|
|
// WrapTableQueryParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTableQueryParams(b []byte) (TableQueryParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TableQueryParams{}, err
|
|
}
|
|
return TableQueryParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TableQueryParams) ProjectId() string { return t.o.Text(tableQueryParamsProjectIdOff) }
|
|
func (t TableQueryParams) Filter() string { return t.o.Text(tableQueryParamsFilterOff) }
|
|
func (t TableQueryParams) OrderBy() string { return t.o.Text(tableQueryParamsOrderByOff) }
|
|
func (t TableQueryParams) SearchQuery() string { return t.o.Text(tableQueryParamsSearchQueryOff) }
|
|
func (t TableQueryParams) Limit() uint32 { return t.o.Uint32(tableQueryParamsLimitOff) }
|
|
func (t TableQueryParams) Page() uint32 { return t.o.Uint32(tableQueryParamsPageOff) }
|
|
|
|
// TableQueryParamsInput collects the field values for NewTableQueryParams.
|
|
type TableQueryParamsInput struct {
|
|
ProjectId string
|
|
Filter string
|
|
OrderBy string
|
|
SearchQuery string
|
|
Limit uint32
|
|
Page uint32
|
|
}
|
|
|
|
// NewTableQueryParams builds a ZAP-encoded TableQueryParams message from in and returns the bytes.
|
|
func NewTableQueryParams(in TableQueryParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(tableQueryParamsSize)
|
|
ob.SetText(tableQueryParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(tableQueryParamsFilterOff, in.Filter)
|
|
ob.SetText(tableQueryParamsOrderByOff, in.OrderBy)
|
|
ob.SetText(tableQueryParamsSearchQueryOff, in.SearchQuery)
|
|
ob.SetUint32(tableQueryParamsLimitOff, in.Limit)
|
|
ob.SetUint32(tableQueryParamsPageOff, in.Page)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
analyticsParamsProjectIdOff = 0
|
|
analyticsParamsScoreNamesOff = 8
|
|
analyticsParamsFilterOff = 16
|
|
analyticsParamsFromTimeOff = 24
|
|
analyticsParamsToTimeOff = 32
|
|
analyticsParamsSize = 40
|
|
)
|
|
|
|
// AnalyticsParams is a zero-copy view into a ZAP-encoded AnalyticsParams message.
|
|
type AnalyticsParams struct{ o zap.Object }
|
|
|
|
// WrapAnalyticsParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAnalyticsParams(b []byte) (AnalyticsParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AnalyticsParams{}, err
|
|
}
|
|
return AnalyticsParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AnalyticsParams) ProjectId() string { return t.o.Text(analyticsParamsProjectIdOff) }
|
|
func (t AnalyticsParams) ScoreNames() string { return t.o.Text(analyticsParamsScoreNamesOff) }
|
|
func (t AnalyticsParams) Filter() string { return t.o.Text(analyticsParamsFilterOff) }
|
|
func (t AnalyticsParams) FromTime() int64 { return t.o.Int64(analyticsParamsFromTimeOff) }
|
|
func (t AnalyticsParams) ToTime() int64 { return t.o.Int64(analyticsParamsToTimeOff) }
|
|
|
|
// AnalyticsParamsInput collects the field values for NewAnalyticsParams.
|
|
type AnalyticsParamsInput struct {
|
|
ProjectId string
|
|
ScoreNames string
|
|
Filter string
|
|
FromTime int64
|
|
ToTime int64
|
|
}
|
|
|
|
// NewAnalyticsParams builds a ZAP-encoded AnalyticsParams message from in and returns the bytes.
|
|
func NewAnalyticsParams(in AnalyticsParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(analyticsParamsSize)
|
|
ob.SetText(analyticsParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(analyticsParamsScoreNamesOff, in.ScoreNames)
|
|
ob.SetText(analyticsParamsFilterOff, in.Filter)
|
|
ob.SetUint64(analyticsParamsFromTimeOff, uint64(in.FromTime))
|
|
ob.SetUint64(analyticsParamsToTimeOff, uint64(in.ToTime))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
emptyStubbedOff = 0
|
|
emptySize = 1
|
|
)
|
|
|
|
// Empty is a zero-copy view into a ZAP-encoded Empty message.
|
|
type Empty struct{ o zap.Object }
|
|
|
|
// WrapEmpty parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapEmpty(b []byte) (Empty, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Empty{}, err
|
|
}
|
|
return Empty{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Empty) Stubbed() bool { return t.o.Bool(emptyStubbedOff) }
|
|
|
|
// EmptyInput collects the field values for NewEmpty.
|
|
type EmptyInput struct {
|
|
Stubbed bool
|
|
}
|
|
|
|
// NewEmpty builds a ZAP-encoded Empty message from in and returns the bytes.
|
|
func NewEmpty(in EmptyInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(emptySize)
|
|
ob.SetBool(emptyStubbedOff, in.Stubbed)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
idReqProjectIdOff = 0
|
|
idReqIdOff = 8
|
|
idReqSize = 16
|
|
)
|
|
|
|
// IdReq is a zero-copy view into a ZAP-encoded IdReq message.
|
|
type IdReq struct{ o zap.Object }
|
|
|
|
// WrapIdReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapIdReq(b []byte) (IdReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return IdReq{}, err
|
|
}
|
|
return IdReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t IdReq) ProjectId() string { return t.o.Text(idReqProjectIdOff) }
|
|
func (t IdReq) Id() string { return t.o.Text(idReqIdOff) }
|
|
|
|
// IdReqInput collects the field values for NewIdReq.
|
|
type IdReqInput struct {
|
|
ProjectId string
|
|
Id string
|
|
}
|
|
|
|
// NewIdReq builds a ZAP-encoded IdReq message from in and returns the bytes.
|
|
func NewIdReq(in IdReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(idReqSize)
|
|
ob.SetText(idReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(idReqIdOff, in.Id)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
listReqProjectIdOff = 0
|
|
listReqPageOff = 8
|
|
listReqLimitOff = 12
|
|
listReqOrderByColumnOff = 16
|
|
listReqOrderByOrderOff = 24
|
|
listReqSize = 32
|
|
)
|
|
|
|
// ListReq is a zero-copy view into a ZAP-encoded ListReq message.
|
|
type ListReq struct{ o zap.Object }
|
|
|
|
// WrapListReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapListReq(b []byte) (ListReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ListReq{}, err
|
|
}
|
|
return ListReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ListReq) ProjectId() string { return t.o.Text(listReqProjectIdOff) }
|
|
func (t ListReq) Page() uint32 { return t.o.Uint32(listReqPageOff) }
|
|
func (t ListReq) Limit() uint32 { return t.o.Uint32(listReqLimitOff) }
|
|
func (t ListReq) OrderByColumn() string { return t.o.Text(listReqOrderByColumnOff) }
|
|
func (t ListReq) OrderByOrder() string { return t.o.Text(listReqOrderByOrderOff) }
|
|
|
|
// ListReqInput collects the field values for NewListReq.
|
|
type ListReqInput struct {
|
|
ProjectId string
|
|
Page uint32
|
|
Limit uint32
|
|
OrderByColumn string
|
|
OrderByOrder string
|
|
}
|
|
|
|
// NewListReq builds a ZAP-encoded ListReq message from in and returns the bytes.
|
|
func NewListReq(in ListReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(listReqSize)
|
|
ob.SetText(listReqProjectIdOff, in.ProjectId)
|
|
ob.SetUint32(listReqPageOff, in.Page)
|
|
ob.SetUint32(listReqLimitOff, in.Limit)
|
|
ob.SetText(listReqOrderByColumnOff, in.OrderByColumn)
|
|
ob.SetText(listReqOrderByOrderOff, in.OrderByOrder)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
dashboardIdOff = 0
|
|
dashboardProjectIdOff = 8
|
|
dashboardNameOff = 16
|
|
dashboardDescriptionOff = 24
|
|
dashboardOwnerOff = 32
|
|
dashboardDefinitionOff = 40
|
|
dashboardFiltersOff = 48
|
|
dashboardCreatedByOff = 56
|
|
dashboardCreatedAtOff = 64
|
|
dashboardUpdatedAtOff = 72
|
|
dashboardSize = 80
|
|
)
|
|
|
|
// Dashboard is a zero-copy view into a ZAP-encoded Dashboard message.
|
|
type Dashboard struct{ o zap.Object }
|
|
|
|
// WrapDashboard parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapDashboard(b []byte) (Dashboard, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Dashboard{}, err
|
|
}
|
|
return Dashboard{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Dashboard) Id() string { return t.o.Text(dashboardIdOff) }
|
|
func (t Dashboard) ProjectId() string { return t.o.Text(dashboardProjectIdOff) }
|
|
func (t Dashboard) Name() string { return t.o.Text(dashboardNameOff) }
|
|
func (t Dashboard) Description() string { return t.o.Text(dashboardDescriptionOff) }
|
|
func (t Dashboard) Owner() string { return t.o.Text(dashboardOwnerOff) }
|
|
func (t Dashboard) Definition() string { return t.o.Text(dashboardDefinitionOff) }
|
|
func (t Dashboard) Filters() string { return t.o.Text(dashboardFiltersOff) }
|
|
func (t Dashboard) CreatedBy() string { return t.o.Text(dashboardCreatedByOff) }
|
|
func (t Dashboard) CreatedAt() string { return t.o.Text(dashboardCreatedAtOff) }
|
|
func (t Dashboard) UpdatedAt() string { return t.o.Text(dashboardUpdatedAtOff) }
|
|
|
|
// DashboardInput collects the field values for NewDashboard.
|
|
type DashboardInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
Description string
|
|
Owner string
|
|
Definition string
|
|
Filters string
|
|
CreatedBy string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewDashboard builds a ZAP-encoded Dashboard message from in and returns the bytes.
|
|
func NewDashboard(in DashboardInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(dashboardSize)
|
|
ob.SetText(dashboardIdOff, in.Id)
|
|
ob.SetText(dashboardProjectIdOff, in.ProjectId)
|
|
ob.SetText(dashboardNameOff, in.Name)
|
|
ob.SetText(dashboardDescriptionOff, in.Description)
|
|
ob.SetText(dashboardOwnerOff, in.Owner)
|
|
ob.SetText(dashboardDefinitionOff, in.Definition)
|
|
ob.SetText(dashboardFiltersOff, in.Filters)
|
|
ob.SetText(dashboardCreatedByOff, in.CreatedBy)
|
|
ob.SetText(dashboardCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(dashboardUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
dashboardListDashboardsOff = 0
|
|
dashboardListTotalCountOff = 8
|
|
dashboardListSize = 12
|
|
)
|
|
|
|
// DashboardList is a zero-copy view into a ZAP-encoded DashboardList message.
|
|
type DashboardList struct{ o zap.Object }
|
|
|
|
// WrapDashboardList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapDashboardList(b []byte) (DashboardList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return DashboardList{}, err
|
|
}
|
|
return DashboardList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t DashboardList) Dashboards() zap.List { return t.o.List(dashboardListDashboardsOff) }
|
|
func (t DashboardList) TotalCount() uint32 { return t.o.Uint32(dashboardListTotalCountOff) }
|
|
|
|
// DashboardListInput collects the field values for NewDashboardList.
|
|
type DashboardListInput struct {
|
|
Dashboards [][]byte
|
|
TotalCount uint32
|
|
}
|
|
|
|
// NewDashboardList builds a ZAP-encoded DashboardList message from in and returns the bytes.
|
|
func NewDashboardList(in DashboardListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(dashboardListSize)
|
|
dashboardsLB := b.StartList(0)
|
|
for _, elem := range in.Dashboards {
|
|
dashboardsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(dashboardListDashboardsOff, dashboardsLB.FinishOffset(), len(in.Dashboards))
|
|
ob.SetUint32(dashboardListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
createDashReqProjectIdOff = 0
|
|
createDashReqNameOff = 8
|
|
createDashReqDescriptionOff = 16
|
|
createDashReqSize = 24
|
|
)
|
|
|
|
// CreateDashReq is a zero-copy view into a ZAP-encoded CreateDashReq message.
|
|
type CreateDashReq struct{ o zap.Object }
|
|
|
|
// WrapCreateDashReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCreateDashReq(b []byte) (CreateDashReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CreateDashReq{}, err
|
|
}
|
|
return CreateDashReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CreateDashReq) ProjectId() string { return t.o.Text(createDashReqProjectIdOff) }
|
|
func (t CreateDashReq) Name() string { return t.o.Text(createDashReqNameOff) }
|
|
func (t CreateDashReq) Description() string { return t.o.Text(createDashReqDescriptionOff) }
|
|
|
|
// CreateDashReqInput collects the field values for NewCreateDashReq.
|
|
type CreateDashReqInput struct {
|
|
ProjectId string
|
|
Name string
|
|
Description string
|
|
}
|
|
|
|
// NewCreateDashReq builds a ZAP-encoded CreateDashReq message from in and returns the bytes.
|
|
func NewCreateDashReq(in CreateDashReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(createDashReqSize)
|
|
ob.SetText(createDashReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(createDashReqNameOff, in.Name)
|
|
ob.SetText(createDashReqDescriptionOff, in.Description)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
updateDashReqProjectIdOff = 0
|
|
updateDashReqDashboardIdOff = 8
|
|
updateDashReqNameOff = 16
|
|
updateDashReqDescriptionOff = 24
|
|
updateDashReqSize = 32
|
|
)
|
|
|
|
// UpdateDashReq is a zero-copy view into a ZAP-encoded UpdateDashReq message.
|
|
type UpdateDashReq struct{ o zap.Object }
|
|
|
|
// WrapUpdateDashReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapUpdateDashReq(b []byte) (UpdateDashReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return UpdateDashReq{}, err
|
|
}
|
|
return UpdateDashReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t UpdateDashReq) ProjectId() string { return t.o.Text(updateDashReqProjectIdOff) }
|
|
func (t UpdateDashReq) DashboardId() string { return t.o.Text(updateDashReqDashboardIdOff) }
|
|
func (t UpdateDashReq) Name() string { return t.o.Text(updateDashReqNameOff) }
|
|
func (t UpdateDashReq) Description() string { return t.o.Text(updateDashReqDescriptionOff) }
|
|
|
|
// UpdateDashReqInput collects the field values for NewUpdateDashReq.
|
|
type UpdateDashReqInput struct {
|
|
ProjectId string
|
|
DashboardId string
|
|
Name string
|
|
Description string
|
|
}
|
|
|
|
// NewUpdateDashReq builds a ZAP-encoded UpdateDashReq message from in and returns the bytes.
|
|
func NewUpdateDashReq(in UpdateDashReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(updateDashReqSize)
|
|
ob.SetText(updateDashReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(updateDashReqDashboardIdOff, in.DashboardId)
|
|
ob.SetText(updateDashReqNameOff, in.Name)
|
|
ob.SetText(updateDashReqDescriptionOff, in.Description)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
dashDefReqProjectIdOff = 0
|
|
dashDefReqDashboardIdOff = 8
|
|
dashDefReqDefinitionOff = 16
|
|
dashDefReqSize = 24
|
|
)
|
|
|
|
// DashDefReq is a zero-copy view into a ZAP-encoded DashDefReq message.
|
|
type DashDefReq struct{ o zap.Object }
|
|
|
|
// WrapDashDefReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapDashDefReq(b []byte) (DashDefReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return DashDefReq{}, err
|
|
}
|
|
return DashDefReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t DashDefReq) ProjectId() string { return t.o.Text(dashDefReqProjectIdOff) }
|
|
func (t DashDefReq) DashboardId() string { return t.o.Text(dashDefReqDashboardIdOff) }
|
|
func (t DashDefReq) Definition() string { return t.o.Text(dashDefReqDefinitionOff) }
|
|
|
|
// DashDefReqInput collects the field values for NewDashDefReq.
|
|
type DashDefReqInput struct {
|
|
ProjectId string
|
|
DashboardId string
|
|
Definition string
|
|
}
|
|
|
|
// NewDashDefReq builds a ZAP-encoded DashDefReq message from in and returns the bytes.
|
|
func NewDashDefReq(in DashDefReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(dashDefReqSize)
|
|
ob.SetText(dashDefReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(dashDefReqDashboardIdOff, in.DashboardId)
|
|
ob.SetText(dashDefReqDefinitionOff, in.Definition)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
dashFiltersReqProjectIdOff = 0
|
|
dashFiltersReqDashboardIdOff = 8
|
|
dashFiltersReqFiltersOff = 16
|
|
dashFiltersReqSize = 24
|
|
)
|
|
|
|
// DashFiltersReq is a zero-copy view into a ZAP-encoded DashFiltersReq message.
|
|
type DashFiltersReq struct{ o zap.Object }
|
|
|
|
// WrapDashFiltersReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapDashFiltersReq(b []byte) (DashFiltersReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return DashFiltersReq{}, err
|
|
}
|
|
return DashFiltersReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t DashFiltersReq) ProjectId() string { return t.o.Text(dashFiltersReqProjectIdOff) }
|
|
func (t DashFiltersReq) DashboardId() string { return t.o.Text(dashFiltersReqDashboardIdOff) }
|
|
func (t DashFiltersReq) Filters() string { return t.o.Text(dashFiltersReqFiltersOff) }
|
|
|
|
// DashFiltersReqInput collects the field values for NewDashFiltersReq.
|
|
type DashFiltersReqInput struct {
|
|
ProjectId string
|
|
DashboardId string
|
|
Filters string
|
|
}
|
|
|
|
// NewDashFiltersReq builds a ZAP-encoded DashFiltersReq message from in and returns the bytes.
|
|
func NewDashFiltersReq(in DashFiltersReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(dashFiltersReqSize)
|
|
ob.SetText(dashFiltersReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(dashFiltersReqDashboardIdOff, in.DashboardId)
|
|
ob.SetText(dashFiltersReqFiltersOff, in.Filters)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
widgetIdOff = 0
|
|
widgetProjectIdOff = 8
|
|
widgetNameOff = 16
|
|
widgetDescriptionOff = 24
|
|
widgetViewOff = 32
|
|
widgetOwnerOff = 40
|
|
widgetDimensionsOff = 48
|
|
widgetMetricsOff = 56
|
|
widgetFiltersOff = 64
|
|
widgetChartTypeOff = 72
|
|
widgetChartConfigOff = 80
|
|
widgetCreatedAtOff = 88
|
|
widgetUpdatedAtOff = 96
|
|
widgetSize = 104
|
|
)
|
|
|
|
// Widget is a zero-copy view into a ZAP-encoded Widget message.
|
|
type Widget struct{ o zap.Object }
|
|
|
|
// WrapWidget parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapWidget(b []byte) (Widget, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Widget{}, err
|
|
}
|
|
return Widget{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Widget) Id() string { return t.o.Text(widgetIdOff) }
|
|
func (t Widget) ProjectId() string { return t.o.Text(widgetProjectIdOff) }
|
|
func (t Widget) Name() string { return t.o.Text(widgetNameOff) }
|
|
func (t Widget) Description() string { return t.o.Text(widgetDescriptionOff) }
|
|
func (t Widget) View() string { return t.o.Text(widgetViewOff) }
|
|
func (t Widget) Owner() string { return t.o.Text(widgetOwnerOff) }
|
|
func (t Widget) Dimensions() string { return t.o.Text(widgetDimensionsOff) }
|
|
func (t Widget) Metrics() string { return t.o.Text(widgetMetricsOff) }
|
|
func (t Widget) Filters() string { return t.o.Text(widgetFiltersOff) }
|
|
func (t Widget) ChartType() string { return t.o.Text(widgetChartTypeOff) }
|
|
func (t Widget) ChartConfig() string { return t.o.Text(widgetChartConfigOff) }
|
|
func (t Widget) CreatedAt() string { return t.o.Text(widgetCreatedAtOff) }
|
|
func (t Widget) UpdatedAt() string { return t.o.Text(widgetUpdatedAtOff) }
|
|
|
|
// WidgetInput collects the field values for NewWidget.
|
|
type WidgetInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
Description string
|
|
View string
|
|
Owner string
|
|
Dimensions string
|
|
Metrics string
|
|
Filters string
|
|
ChartType string
|
|
ChartConfig string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewWidget builds a ZAP-encoded Widget message from in and returns the bytes.
|
|
func NewWidget(in WidgetInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(widgetSize)
|
|
ob.SetText(widgetIdOff, in.Id)
|
|
ob.SetText(widgetProjectIdOff, in.ProjectId)
|
|
ob.SetText(widgetNameOff, in.Name)
|
|
ob.SetText(widgetDescriptionOff, in.Description)
|
|
ob.SetText(widgetViewOff, in.View)
|
|
ob.SetText(widgetOwnerOff, in.Owner)
|
|
ob.SetText(widgetDimensionsOff, in.Dimensions)
|
|
ob.SetText(widgetMetricsOff, in.Metrics)
|
|
ob.SetText(widgetFiltersOff, in.Filters)
|
|
ob.SetText(widgetChartTypeOff, in.ChartType)
|
|
ob.SetText(widgetChartConfigOff, in.ChartConfig)
|
|
ob.SetText(widgetCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(widgetUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
widgetListWidgetsOff = 0
|
|
widgetListTotalCountOff = 8
|
|
widgetListSize = 12
|
|
)
|
|
|
|
// WidgetList is a zero-copy view into a ZAP-encoded WidgetList message.
|
|
type WidgetList struct{ o zap.Object }
|
|
|
|
// WrapWidgetList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapWidgetList(b []byte) (WidgetList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return WidgetList{}, err
|
|
}
|
|
return WidgetList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t WidgetList) Widgets() zap.List { return t.o.List(widgetListWidgetsOff) }
|
|
func (t WidgetList) TotalCount() uint32 { return t.o.Uint32(widgetListTotalCountOff) }
|
|
|
|
// WidgetListInput collects the field values for NewWidgetList.
|
|
type WidgetListInput struct {
|
|
Widgets [][]byte
|
|
TotalCount uint32
|
|
}
|
|
|
|
// NewWidgetList builds a ZAP-encoded WidgetList message from in and returns the bytes.
|
|
func NewWidgetList(in WidgetListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(widgetListSize)
|
|
widgetsLB := b.StartList(0)
|
|
for _, elem := range in.Widgets {
|
|
widgetsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(widgetListWidgetsOff, widgetsLB.FinishOffset(), len(in.Widgets))
|
|
ob.SetUint32(widgetListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
widgetReqProjectIdOff = 0
|
|
widgetReqWidgetIdOff = 8
|
|
widgetReqNameOff = 16
|
|
widgetReqDescriptionOff = 24
|
|
widgetReqViewOff = 32
|
|
widgetReqDimensionsOff = 40
|
|
widgetReqMetricsOff = 48
|
|
widgetReqFiltersOff = 56
|
|
widgetReqChartTypeOff = 64
|
|
widgetReqChartConfigOff = 72
|
|
widgetReqSize = 80
|
|
)
|
|
|
|
// WidgetReq is a zero-copy view into a ZAP-encoded WidgetReq message.
|
|
type WidgetReq struct{ o zap.Object }
|
|
|
|
// WrapWidgetReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapWidgetReq(b []byte) (WidgetReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return WidgetReq{}, err
|
|
}
|
|
return WidgetReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t WidgetReq) ProjectId() string { return t.o.Text(widgetReqProjectIdOff) }
|
|
func (t WidgetReq) WidgetId() string { return t.o.Text(widgetReqWidgetIdOff) }
|
|
func (t WidgetReq) Name() string { return t.o.Text(widgetReqNameOff) }
|
|
func (t WidgetReq) Description() string { return t.o.Text(widgetReqDescriptionOff) }
|
|
func (t WidgetReq) View() string { return t.o.Text(widgetReqViewOff) }
|
|
func (t WidgetReq) Dimensions() string { return t.o.Text(widgetReqDimensionsOff) }
|
|
func (t WidgetReq) Metrics() string { return t.o.Text(widgetReqMetricsOff) }
|
|
func (t WidgetReq) Filters() string { return t.o.Text(widgetReqFiltersOff) }
|
|
func (t WidgetReq) ChartType() string { return t.o.Text(widgetReqChartTypeOff) }
|
|
func (t WidgetReq) ChartConfig() string { return t.o.Text(widgetReqChartConfigOff) }
|
|
|
|
// WidgetReqInput collects the field values for NewWidgetReq.
|
|
type WidgetReqInput struct {
|
|
ProjectId string
|
|
WidgetId string
|
|
Name string
|
|
Description string
|
|
View string
|
|
Dimensions string
|
|
Metrics string
|
|
Filters string
|
|
ChartType string
|
|
ChartConfig string
|
|
}
|
|
|
|
// NewWidgetReq builds a ZAP-encoded WidgetReq message from in and returns the bytes.
|
|
func NewWidgetReq(in WidgetReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(widgetReqSize)
|
|
ob.SetText(widgetReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(widgetReqWidgetIdOff, in.WidgetId)
|
|
ob.SetText(widgetReqNameOff, in.Name)
|
|
ob.SetText(widgetReqDescriptionOff, in.Description)
|
|
ob.SetText(widgetReqViewOff, in.View)
|
|
ob.SetText(widgetReqDimensionsOff, in.Dimensions)
|
|
ob.SetText(widgetReqMetricsOff, in.Metrics)
|
|
ob.SetText(widgetReqFiltersOff, in.Filters)
|
|
ob.SetText(widgetReqChartTypeOff, in.ChartType)
|
|
ob.SetText(widgetReqChartConfigOff, in.ChartConfig)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
copyWidgetReqProjectIdOff = 0
|
|
copyWidgetReqWidgetIdOff = 8
|
|
copyWidgetReqDashboardIdOff = 16
|
|
copyWidgetReqPlacementIdOff = 24
|
|
copyWidgetReqSize = 32
|
|
)
|
|
|
|
// CopyWidgetReq is a zero-copy view into a ZAP-encoded CopyWidgetReq message.
|
|
type CopyWidgetReq struct{ o zap.Object }
|
|
|
|
// WrapCopyWidgetReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCopyWidgetReq(b []byte) (CopyWidgetReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CopyWidgetReq{}, err
|
|
}
|
|
return CopyWidgetReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CopyWidgetReq) ProjectId() string { return t.o.Text(copyWidgetReqProjectIdOff) }
|
|
func (t CopyWidgetReq) WidgetId() string { return t.o.Text(copyWidgetReqWidgetIdOff) }
|
|
func (t CopyWidgetReq) DashboardId() string { return t.o.Text(copyWidgetReqDashboardIdOff) }
|
|
func (t CopyWidgetReq) PlacementId() string { return t.o.Text(copyWidgetReqPlacementIdOff) }
|
|
|
|
// CopyWidgetReqInput collects the field values for NewCopyWidgetReq.
|
|
type CopyWidgetReqInput struct {
|
|
ProjectId string
|
|
WidgetId string
|
|
DashboardId string
|
|
PlacementId string
|
|
}
|
|
|
|
// NewCopyWidgetReq builds a ZAP-encoded CopyWidgetReq message from in and returns the bytes.
|
|
func NewCopyWidgetReq(in CopyWidgetReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(copyWidgetReqSize)
|
|
ob.SetText(copyWidgetReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(copyWidgetReqWidgetIdOff, in.WidgetId)
|
|
ob.SetText(copyWidgetReqDashboardIdOff, in.DashboardId)
|
|
ob.SetText(copyWidgetReqPlacementIdOff, in.PlacementId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
batchActionReqProjectIdOff = 0
|
|
batchActionReqTableNameOff = 8
|
|
batchActionReqActionIdOff = 16
|
|
batchActionReqSize = 24
|
|
)
|
|
|
|
// BatchActionReq is a zero-copy view into a ZAP-encoded BatchActionReq message.
|
|
type BatchActionReq struct{ o zap.Object }
|
|
|
|
// WrapBatchActionReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapBatchActionReq(b []byte) (BatchActionReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return BatchActionReq{}, err
|
|
}
|
|
return BatchActionReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t BatchActionReq) ProjectId() string { return t.o.Text(batchActionReqProjectIdOff) }
|
|
func (t BatchActionReq) TableName() string { return t.o.Text(batchActionReqTableNameOff) }
|
|
func (t BatchActionReq) ActionId() string { return t.o.Text(batchActionReqActionIdOff) }
|
|
|
|
// BatchActionReqInput collects the field values for NewBatchActionReq.
|
|
type BatchActionReqInput struct {
|
|
ProjectId string
|
|
TableName string
|
|
ActionId string
|
|
}
|
|
|
|
// NewBatchActionReq builds a ZAP-encoded BatchActionReq message from in and returns the bytes.
|
|
func NewBatchActionReq(in BatchActionReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(batchActionReqSize)
|
|
ob.SetText(batchActionReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(batchActionReqTableNameOff, in.TableName)
|
|
ob.SetText(batchActionReqActionIdOff, in.ActionId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
presetIdOff = 0
|
|
presetProjectIdOff = 8
|
|
presetNameOff = 16
|
|
presetTableNameOff = 24
|
|
presetFiltersOff = 32
|
|
presetColumnOrderOff = 40
|
|
presetColumnVisibilityOff = 48
|
|
presetSearchQueryOff = 56
|
|
presetOrderByColumnOff = 64
|
|
presetOrderByOrderOff = 72
|
|
presetCreatedByOff = 80
|
|
presetCreatedAtOff = 88
|
|
presetUpdatedAtOff = 96
|
|
presetSize = 104
|
|
)
|
|
|
|
// Preset is a zero-copy view into a ZAP-encoded Preset message.
|
|
type Preset struct{ o zap.Object }
|
|
|
|
// WrapPreset parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPreset(b []byte) (Preset, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Preset{}, err
|
|
}
|
|
return Preset{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Preset) Id() string { return t.o.Text(presetIdOff) }
|
|
func (t Preset) ProjectId() string { return t.o.Text(presetProjectIdOff) }
|
|
func (t Preset) Name() string { return t.o.Text(presetNameOff) }
|
|
func (t Preset) TableName() string { return t.o.Text(presetTableNameOff) }
|
|
func (t Preset) Filters() string { return t.o.Text(presetFiltersOff) }
|
|
func (t Preset) ColumnOrder() string { return t.o.Text(presetColumnOrderOff) }
|
|
func (t Preset) ColumnVisibility() string { return t.o.Text(presetColumnVisibilityOff) }
|
|
func (t Preset) SearchQuery() string { return t.o.Text(presetSearchQueryOff) }
|
|
func (t Preset) OrderByColumn() string { return t.o.Text(presetOrderByColumnOff) }
|
|
func (t Preset) OrderByOrder() string { return t.o.Text(presetOrderByOrderOff) }
|
|
func (t Preset) CreatedBy() string { return t.o.Text(presetCreatedByOff) }
|
|
func (t Preset) CreatedAt() string { return t.o.Text(presetCreatedAtOff) }
|
|
func (t Preset) UpdatedAt() string { return t.o.Text(presetUpdatedAtOff) }
|
|
|
|
// PresetInput collects the field values for NewPreset.
|
|
type PresetInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
TableName string
|
|
Filters string
|
|
ColumnOrder string
|
|
ColumnVisibility string
|
|
SearchQuery string
|
|
OrderByColumn string
|
|
OrderByOrder string
|
|
CreatedBy string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewPreset builds a ZAP-encoded Preset message from in and returns the bytes.
|
|
func NewPreset(in PresetInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(presetSize)
|
|
ob.SetText(presetIdOff, in.Id)
|
|
ob.SetText(presetProjectIdOff, in.ProjectId)
|
|
ob.SetText(presetNameOff, in.Name)
|
|
ob.SetText(presetTableNameOff, in.TableName)
|
|
ob.SetText(presetFiltersOff, in.Filters)
|
|
ob.SetText(presetColumnOrderOff, in.ColumnOrder)
|
|
ob.SetText(presetColumnVisibilityOff, in.ColumnVisibility)
|
|
ob.SetText(presetSearchQueryOff, in.SearchQuery)
|
|
ob.SetText(presetOrderByColumnOff, in.OrderByColumn)
|
|
ob.SetText(presetOrderByOrderOff, in.OrderByOrder)
|
|
ob.SetText(presetCreatedByOff, in.CreatedBy)
|
|
ob.SetText(presetCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(presetUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
presetListPresetsOff = 0
|
|
presetListSize = 8
|
|
)
|
|
|
|
// PresetList is a zero-copy view into a ZAP-encoded PresetList message.
|
|
type PresetList struct{ o zap.Object }
|
|
|
|
// WrapPresetList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPresetList(b []byte) (PresetList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return PresetList{}, err
|
|
}
|
|
return PresetList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t PresetList) Presets() zap.List { return t.o.List(presetListPresetsOff) }
|
|
|
|
// PresetListInput collects the field values for NewPresetList.
|
|
type PresetListInput struct {
|
|
Presets [][]byte
|
|
}
|
|
|
|
// NewPresetList builds a ZAP-encoded PresetList message from in and returns the bytes.
|
|
func NewPresetList(in PresetListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(presetListSize)
|
|
presetsLB := b.StartList(0)
|
|
for _, elem := range in.Presets {
|
|
presetsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(presetListPresetsOff, presetsLB.FinishOffset(), len(in.Presets))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
presetListReqProjectIdOff = 0
|
|
presetListReqTableNameOff = 8
|
|
presetListReqSize = 16
|
|
)
|
|
|
|
// PresetListReq is a zero-copy view into a ZAP-encoded PresetListReq message.
|
|
type PresetListReq struct{ o zap.Object }
|
|
|
|
// WrapPresetListReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPresetListReq(b []byte) (PresetListReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return PresetListReq{}, err
|
|
}
|
|
return PresetListReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t PresetListReq) ProjectId() string { return t.o.Text(presetListReqProjectIdOff) }
|
|
func (t PresetListReq) TableName() string { return t.o.Text(presetListReqTableNameOff) }
|
|
|
|
// PresetListReqInput collects the field values for NewPresetListReq.
|
|
type PresetListReqInput struct {
|
|
ProjectId string
|
|
TableName string
|
|
}
|
|
|
|
// NewPresetListReq builds a ZAP-encoded PresetListReq message from in and returns the bytes.
|
|
func NewPresetListReq(in PresetListReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(presetListReqSize)
|
|
ob.SetText(presetListReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(presetListReqTableNameOff, in.TableName)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
presetReqProjectIdOff = 0
|
|
presetReqPresetIdOff = 8
|
|
presetReqNameOff = 16
|
|
presetReqTableNameOff = 24
|
|
presetReqFiltersOff = 32
|
|
presetReqColumnOrderOff = 40
|
|
presetReqColumnVisibilityOff = 48
|
|
presetReqSearchQueryOff = 56
|
|
presetReqOrderByColumnOff = 64
|
|
presetReqOrderByOrderOff = 72
|
|
presetReqSize = 80
|
|
)
|
|
|
|
// PresetReq is a zero-copy view into a ZAP-encoded PresetReq message.
|
|
type PresetReq struct{ o zap.Object }
|
|
|
|
// WrapPresetReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPresetReq(b []byte) (PresetReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return PresetReq{}, err
|
|
}
|
|
return PresetReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t PresetReq) ProjectId() string { return t.o.Text(presetReqProjectIdOff) }
|
|
func (t PresetReq) PresetId() string { return t.o.Text(presetReqPresetIdOff) }
|
|
func (t PresetReq) Name() string { return t.o.Text(presetReqNameOff) }
|
|
func (t PresetReq) TableName() string { return t.o.Text(presetReqTableNameOff) }
|
|
func (t PresetReq) Filters() string { return t.o.Text(presetReqFiltersOff) }
|
|
func (t PresetReq) ColumnOrder() string { return t.o.Text(presetReqColumnOrderOff) }
|
|
func (t PresetReq) ColumnVisibility() string { return t.o.Text(presetReqColumnVisibilityOff) }
|
|
func (t PresetReq) SearchQuery() string { return t.o.Text(presetReqSearchQueryOff) }
|
|
func (t PresetReq) OrderByColumn() string { return t.o.Text(presetReqOrderByColumnOff) }
|
|
func (t PresetReq) OrderByOrder() string { return t.o.Text(presetReqOrderByOrderOff) }
|
|
|
|
// PresetReqInput collects the field values for NewPresetReq.
|
|
type PresetReqInput struct {
|
|
ProjectId string
|
|
PresetId string
|
|
Name string
|
|
TableName string
|
|
Filters string
|
|
ColumnOrder string
|
|
ColumnVisibility string
|
|
SearchQuery string
|
|
OrderByColumn string
|
|
OrderByOrder string
|
|
}
|
|
|
|
// NewPresetReq builds a ZAP-encoded PresetReq message from in and returns the bytes.
|
|
func NewPresetReq(in PresetReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(presetReqSize)
|
|
ob.SetText(presetReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(presetReqPresetIdOff, in.PresetId)
|
|
ob.SetText(presetReqNameOff, in.Name)
|
|
ob.SetText(presetReqTableNameOff, in.TableName)
|
|
ob.SetText(presetReqFiltersOff, in.Filters)
|
|
ob.SetText(presetReqColumnOrderOff, in.ColumnOrder)
|
|
ob.SetText(presetReqColumnVisibilityOff, in.ColumnVisibility)
|
|
ob.SetText(presetReqSearchQueryOff, in.SearchQuery)
|
|
ob.SetText(presetReqOrderByColumnOff, in.OrderByColumn)
|
|
ob.SetText(presetReqOrderByOrderOff, in.OrderByOrder)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
presetNameReqProjectIdOff = 0
|
|
presetNameReqPresetIdOff = 8
|
|
presetNameReqNameOff = 16
|
|
presetNameReqTableNameOff = 24
|
|
presetNameReqSize = 32
|
|
)
|
|
|
|
// PresetNameReq is a zero-copy view into a ZAP-encoded PresetNameReq message.
|
|
type PresetNameReq struct{ o zap.Object }
|
|
|
|
// WrapPresetNameReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPresetNameReq(b []byte) (PresetNameReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return PresetNameReq{}, err
|
|
}
|
|
return PresetNameReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t PresetNameReq) ProjectId() string { return t.o.Text(presetNameReqProjectIdOff) }
|
|
func (t PresetNameReq) PresetId() string { return t.o.Text(presetNameReqPresetIdOff) }
|
|
func (t PresetNameReq) Name() string { return t.o.Text(presetNameReqNameOff) }
|
|
func (t PresetNameReq) TableName() string { return t.o.Text(presetNameReqTableNameOff) }
|
|
|
|
// PresetNameReqInput collects the field values for NewPresetNameReq.
|
|
type PresetNameReqInput struct {
|
|
ProjectId string
|
|
PresetId string
|
|
Name string
|
|
TableName string
|
|
}
|
|
|
|
// NewPresetNameReq builds a ZAP-encoded PresetNameReq message from in and returns the bytes.
|
|
func NewPresetNameReq(in PresetNameReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(presetNameReqSize)
|
|
ob.SetText(presetNameReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(presetNameReqPresetIdOff, in.PresetId)
|
|
ob.SetText(presetNameReqNameOff, in.Name)
|
|
ob.SetText(presetNameReqTableNameOff, in.TableName)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
permalinkReqProjectIdOff = 0
|
|
permalinkReqPresetIdOff = 8
|
|
permalinkReqTableNameOff = 16
|
|
permalinkReqBaseUrlOff = 24
|
|
permalinkReqSize = 32
|
|
)
|
|
|
|
// PermalinkReq is a zero-copy view into a ZAP-encoded PermalinkReq message.
|
|
type PermalinkReq struct{ o zap.Object }
|
|
|
|
// WrapPermalinkReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapPermalinkReq(b []byte) (PermalinkReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return PermalinkReq{}, err
|
|
}
|
|
return PermalinkReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t PermalinkReq) ProjectId() string { return t.o.Text(permalinkReqProjectIdOff) }
|
|
func (t PermalinkReq) PresetId() string { return t.o.Text(permalinkReqPresetIdOff) }
|
|
func (t PermalinkReq) TableName() string { return t.o.Text(permalinkReqTableNameOff) }
|
|
func (t PermalinkReq) BaseUrl() string { return t.o.Text(permalinkReqBaseUrlOff) }
|
|
|
|
// PermalinkReqInput collects the field values for NewPermalinkReq.
|
|
type PermalinkReqInput struct {
|
|
ProjectId string
|
|
PresetId string
|
|
TableName string
|
|
BaseUrl string
|
|
}
|
|
|
|
// NewPermalinkReq builds a ZAP-encoded PermalinkReq message from in and returns the bytes.
|
|
func NewPermalinkReq(in PermalinkReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(permalinkReqSize)
|
|
ob.SetText(permalinkReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(permalinkReqPresetIdOff, in.PresetId)
|
|
ob.SetText(permalinkReqTableNameOff, in.TableName)
|
|
ob.SetText(permalinkReqBaseUrlOff, in.BaseUrl)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
monitorIdOff = 0
|
|
monitorProjectIdOff = 8
|
|
monitorNameOff = 16
|
|
monitorViewOff = 24
|
|
monitorFiltersOff = 32
|
|
monitorMetricOff = 40
|
|
monitorWindowOff = 48
|
|
monitorThresholdOperatorOff = 56
|
|
monitorAlertThresholdOff = 64
|
|
monitorWarningThresholdOff = 72
|
|
monitorNoDataOff = 80
|
|
monitorRenotifyOff = 88
|
|
monitorTagsOff = 96
|
|
monitorStatusOff = 104
|
|
monitorSeverityOff = 112
|
|
monitorSeverityChangedAtOff = 120
|
|
monitorAlertedAtOff = 128
|
|
monitorNextRunAtOff = 136
|
|
monitorCreatedByOff = 144
|
|
monitorCreatedAtOff = 152
|
|
monitorUpdatedAtOff = 160
|
|
monitorSize = 168
|
|
)
|
|
|
|
// Monitor is a zero-copy view into a ZAP-encoded Monitor message.
|
|
type Monitor struct{ o zap.Object }
|
|
|
|
// WrapMonitor parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMonitor(b []byte) (Monitor, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Monitor{}, err
|
|
}
|
|
return Monitor{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Monitor) Id() string { return t.o.Text(monitorIdOff) }
|
|
func (t Monitor) ProjectId() string { return t.o.Text(monitorProjectIdOff) }
|
|
func (t Monitor) Name() string { return t.o.Text(monitorNameOff) }
|
|
func (t Monitor) View() string { return t.o.Text(monitorViewOff) }
|
|
func (t Monitor) Filters() string { return t.o.Text(monitorFiltersOff) }
|
|
func (t Monitor) Metric() string { return t.o.Text(monitorMetricOff) }
|
|
func (t Monitor) Window() string { return t.o.Text(monitorWindowOff) }
|
|
func (t Monitor) ThresholdOperator() string { return t.o.Text(monitorThresholdOperatorOff) }
|
|
func (t Monitor) AlertThreshold() float64 { return t.o.Float64(monitorAlertThresholdOff) }
|
|
func (t Monitor) WarningThreshold() float64 { return t.o.Float64(monitorWarningThresholdOff) }
|
|
func (t Monitor) NoData() string { return t.o.Text(monitorNoDataOff) }
|
|
func (t Monitor) Renotify() string { return t.o.Text(monitorRenotifyOff) }
|
|
func (t Monitor) Tags() string { return t.o.Text(monitorTagsOff) }
|
|
func (t Monitor) Status() string { return t.o.Text(monitorStatusOff) }
|
|
func (t Monitor) Severity() string { return t.o.Text(monitorSeverityOff) }
|
|
func (t Monitor) SeverityChangedAt() string { return t.o.Text(monitorSeverityChangedAtOff) }
|
|
func (t Monitor) AlertedAt() string { return t.o.Text(monitorAlertedAtOff) }
|
|
func (t Monitor) NextRunAt() string { return t.o.Text(monitorNextRunAtOff) }
|
|
func (t Monitor) CreatedBy() string { return t.o.Text(monitorCreatedByOff) }
|
|
func (t Monitor) CreatedAt() string { return t.o.Text(monitorCreatedAtOff) }
|
|
func (t Monitor) UpdatedAt() string { return t.o.Text(monitorUpdatedAtOff) }
|
|
|
|
// MonitorInput collects the field values for NewMonitor.
|
|
type MonitorInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
View string
|
|
Filters string
|
|
Metric string
|
|
Window string
|
|
ThresholdOperator string
|
|
AlertThreshold float64
|
|
WarningThreshold float64
|
|
NoData string
|
|
Renotify string
|
|
Tags string
|
|
Status string
|
|
Severity string
|
|
SeverityChangedAt string
|
|
AlertedAt string
|
|
NextRunAt string
|
|
CreatedBy string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewMonitor builds a ZAP-encoded Monitor message from in and returns the bytes.
|
|
func NewMonitor(in MonitorInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(monitorSize)
|
|
ob.SetText(monitorIdOff, in.Id)
|
|
ob.SetText(monitorProjectIdOff, in.ProjectId)
|
|
ob.SetText(monitorNameOff, in.Name)
|
|
ob.SetText(monitorViewOff, in.View)
|
|
ob.SetText(monitorFiltersOff, in.Filters)
|
|
ob.SetText(monitorMetricOff, in.Metric)
|
|
ob.SetText(monitorWindowOff, in.Window)
|
|
ob.SetText(monitorThresholdOperatorOff, in.ThresholdOperator)
|
|
ob.SetFloat64(monitorAlertThresholdOff, in.AlertThreshold)
|
|
ob.SetFloat64(monitorWarningThresholdOff, in.WarningThreshold)
|
|
ob.SetText(monitorNoDataOff, in.NoData)
|
|
ob.SetText(monitorRenotifyOff, in.Renotify)
|
|
ob.SetText(monitorTagsOff, in.Tags)
|
|
ob.SetText(monitorStatusOff, in.Status)
|
|
ob.SetText(monitorSeverityOff, in.Severity)
|
|
ob.SetText(monitorSeverityChangedAtOff, in.SeverityChangedAt)
|
|
ob.SetText(monitorAlertedAtOff, in.AlertedAt)
|
|
ob.SetText(monitorNextRunAtOff, in.NextRunAt)
|
|
ob.SetText(monitorCreatedByOff, in.CreatedBy)
|
|
ob.SetText(monitorCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(monitorUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
monitorListMonitorsOff = 0
|
|
monitorListTotalCountOff = 8
|
|
monitorListSize = 12
|
|
)
|
|
|
|
// MonitorList is a zero-copy view into a ZAP-encoded MonitorList message.
|
|
type MonitorList struct{ o zap.Object }
|
|
|
|
// WrapMonitorList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMonitorList(b []byte) (MonitorList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return MonitorList{}, err
|
|
}
|
|
return MonitorList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t MonitorList) Monitors() zap.List { return t.o.List(monitorListMonitorsOff) }
|
|
func (t MonitorList) TotalCount() uint32 { return t.o.Uint32(monitorListTotalCountOff) }
|
|
|
|
// MonitorListInput collects the field values for NewMonitorList.
|
|
type MonitorListInput struct {
|
|
Monitors [][]byte
|
|
TotalCount uint32
|
|
}
|
|
|
|
// NewMonitorList builds a ZAP-encoded MonitorList message from in and returns the bytes.
|
|
func NewMonitorList(in MonitorListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(monitorListSize)
|
|
monitorsLB := b.StartList(0)
|
|
for _, elem := range in.Monitors {
|
|
monitorsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(monitorListMonitorsOff, monitorsLB.FinishOffset(), len(in.Monitors))
|
|
ob.SetUint32(monitorListTotalCountOff, in.TotalCount)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
monitorReqProjectIdOff = 0
|
|
monitorReqMonitorIdOff = 8
|
|
monitorReqNameOff = 16
|
|
monitorReqViewOff = 24
|
|
monitorReqFiltersOff = 32
|
|
monitorReqMetricOff = 40
|
|
monitorReqWindowOff = 48
|
|
monitorReqThresholdOperatorOff = 56
|
|
monitorReqAlertThresholdOff = 64
|
|
monitorReqWarningThresholdOff = 72
|
|
monitorReqNoDataOff = 80
|
|
monitorReqRenotifyOff = 88
|
|
monitorReqTagsOff = 96
|
|
monitorReqStatusOff = 104
|
|
monitorReqSize = 112
|
|
)
|
|
|
|
// MonitorReq is a zero-copy view into a ZAP-encoded MonitorReq message.
|
|
type MonitorReq struct{ o zap.Object }
|
|
|
|
// WrapMonitorReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMonitorReq(b []byte) (MonitorReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return MonitorReq{}, err
|
|
}
|
|
return MonitorReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t MonitorReq) ProjectId() string { return t.o.Text(monitorReqProjectIdOff) }
|
|
func (t MonitorReq) MonitorId() string { return t.o.Text(monitorReqMonitorIdOff) }
|
|
func (t MonitorReq) Name() string { return t.o.Text(monitorReqNameOff) }
|
|
func (t MonitorReq) View() string { return t.o.Text(monitorReqViewOff) }
|
|
func (t MonitorReq) Filters() string { return t.o.Text(monitorReqFiltersOff) }
|
|
func (t MonitorReq) Metric() string { return t.o.Text(monitorReqMetricOff) }
|
|
func (t MonitorReq) Window() string { return t.o.Text(monitorReqWindowOff) }
|
|
func (t MonitorReq) ThresholdOperator() string { return t.o.Text(monitorReqThresholdOperatorOff) }
|
|
func (t MonitorReq) AlertThreshold() float64 { return t.o.Float64(monitorReqAlertThresholdOff) }
|
|
func (t MonitorReq) WarningThreshold() float64 { return t.o.Float64(monitorReqWarningThresholdOff) }
|
|
func (t MonitorReq) NoData() string { return t.o.Text(monitorReqNoDataOff) }
|
|
func (t MonitorReq) Renotify() string { return t.o.Text(monitorReqRenotifyOff) }
|
|
func (t MonitorReq) Tags() string { return t.o.Text(monitorReqTagsOff) }
|
|
func (t MonitorReq) Status() string { return t.o.Text(monitorReqStatusOff) }
|
|
|
|
// MonitorReqInput collects the field values for NewMonitorReq.
|
|
type MonitorReqInput struct {
|
|
ProjectId string
|
|
MonitorId string
|
|
Name string
|
|
View string
|
|
Filters string
|
|
Metric string
|
|
Window string
|
|
ThresholdOperator string
|
|
AlertThreshold float64
|
|
WarningThreshold float64
|
|
NoData string
|
|
Renotify string
|
|
Tags string
|
|
Status string
|
|
}
|
|
|
|
// NewMonitorReq builds a ZAP-encoded MonitorReq message from in and returns the bytes.
|
|
func NewMonitorReq(in MonitorReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(monitorReqSize)
|
|
ob.SetText(monitorReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(monitorReqMonitorIdOff, in.MonitorId)
|
|
ob.SetText(monitorReqNameOff, in.Name)
|
|
ob.SetText(monitorReqViewOff, in.View)
|
|
ob.SetText(monitorReqFiltersOff, in.Filters)
|
|
ob.SetText(monitorReqMetricOff, in.Metric)
|
|
ob.SetText(monitorReqWindowOff, in.Window)
|
|
ob.SetText(monitorReqThresholdOperatorOff, in.ThresholdOperator)
|
|
ob.SetFloat64(monitorReqAlertThresholdOff, in.AlertThreshold)
|
|
ob.SetFloat64(monitorReqWarningThresholdOff, in.WarningThreshold)
|
|
ob.SetText(monitorReqNoDataOff, in.NoData)
|
|
ob.SetText(monitorReqRenotifyOff, in.Renotify)
|
|
ob.SetText(monitorReqTagsOff, in.Tags)
|
|
ob.SetText(monitorReqStatusOff, in.Status)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
mutationSuccessOff = 0
|
|
mutationIdOff = 8
|
|
mutationSize = 16
|
|
)
|
|
|
|
// Mutation is a zero-copy view into a ZAP-encoded Mutation message.
|
|
type Mutation struct{ o zap.Object }
|
|
|
|
// WrapMutation parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMutation(b []byte) (Mutation, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return Mutation{}, err
|
|
}
|
|
return Mutation{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t Mutation) Success() bool { return t.o.Bool(mutationSuccessOff) }
|
|
func (t Mutation) Id() string { return t.o.Text(mutationIdOff) }
|
|
|
|
// MutationInput collects the field values for NewMutation.
|
|
type MutationInput struct {
|
|
Success bool
|
|
Id string
|
|
}
|
|
|
|
// NewMutation builds a ZAP-encoded Mutation message from in and returns the bytes.
|
|
func NewMutation(in MutationInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(mutationSize)
|
|
ob.SetBool(mutationSuccessOff, in.Success)
|
|
ob.SetText(mutationIdOff, in.Id)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
stringResultValueOff = 0
|
|
stringResultSize = 8
|
|
)
|
|
|
|
// StringResult is a zero-copy view into a ZAP-encoded StringResult message.
|
|
type StringResult struct{ o zap.Object }
|
|
|
|
// WrapStringResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapStringResult(b []byte) (StringResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return StringResult{}, err
|
|
}
|
|
return StringResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t StringResult) Value() string { return t.o.Text(stringResultValueOff) }
|
|
|
|
// StringResultInput collects the field values for NewStringResult.
|
|
type StringResultInput struct {
|
|
Value string
|
|
}
|
|
|
|
// NewStringResult builds a ZAP-encoded StringResult message from in and returns the bytes.
|
|
func NewStringResult(in StringResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(stringResultSize)
|
|
ob.SetText(stringResultValueOff, in.Value)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
analyticsResultRowsOff = 0
|
|
analyticsResultSize = 8
|
|
)
|
|
|
|
// AnalyticsResult is a zero-copy view into a ZAP-encoded AnalyticsResult message.
|
|
type AnalyticsResult struct{ o zap.Object }
|
|
|
|
// WrapAnalyticsResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAnalyticsResult(b []byte) (AnalyticsResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AnalyticsResult{}, err
|
|
}
|
|
return AnalyticsResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AnalyticsResult) Rows() string { return t.o.Text(analyticsResultRowsOff) }
|
|
|
|
// AnalyticsResultInput collects the field values for NewAnalyticsResult.
|
|
type AnalyticsResultInput struct {
|
|
Rows string
|
|
}
|
|
|
|
// NewAnalyticsResult builds a ZAP-encoded AnalyticsResult message from in and returns the bytes.
|
|
func NewAnalyticsResult(in AnalyticsResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(analyticsResultSize)
|
|
ob.SetText(analyticsResultRowsOff, in.Rows)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
analyticsReqProjectIdOff = 0
|
|
analyticsReqQueryNameOff = 8
|
|
analyticsReqFilterOff = 16
|
|
analyticsReqQueryOff = 24
|
|
analyticsReqLimitOff = 32
|
|
analyticsReqSize = 36
|
|
)
|
|
|
|
// AnalyticsReq is a zero-copy view into a ZAP-encoded AnalyticsReq message.
|
|
type AnalyticsReq struct{ o zap.Object }
|
|
|
|
// WrapAnalyticsReq parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapAnalyticsReq(b []byte) (AnalyticsReq, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return AnalyticsReq{}, err
|
|
}
|
|
return AnalyticsReq{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t AnalyticsReq) ProjectId() string { return t.o.Text(analyticsReqProjectIdOff) }
|
|
func (t AnalyticsReq) QueryName() string { return t.o.Text(analyticsReqQueryNameOff) }
|
|
func (t AnalyticsReq) Filter() string { return t.o.Text(analyticsReqFilterOff) }
|
|
func (t AnalyticsReq) Query() string { return t.o.Text(analyticsReqQueryOff) }
|
|
func (t AnalyticsReq) Limit() uint32 { return t.o.Uint32(analyticsReqLimitOff) }
|
|
|
|
// AnalyticsReqInput collects the field values for NewAnalyticsReq.
|
|
type AnalyticsReqInput struct {
|
|
ProjectId string
|
|
QueryName string
|
|
Filter string
|
|
Query string
|
|
Limit uint32
|
|
}
|
|
|
|
// NewAnalyticsReq builds a ZAP-encoded AnalyticsReq message from in and returns the bytes.
|
|
func NewAnalyticsReq(in AnalyticsReqInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(analyticsReqSize)
|
|
ob.SetText(analyticsReqProjectIdOff, in.ProjectId)
|
|
ob.SetText(analyticsReqQueryNameOff, in.QueryName)
|
|
ob.SetText(analyticsReqFilterOff, in.Filter)
|
|
ob.SetText(analyticsReqQueryOff, in.Query)
|
|
ob.SetUint32(analyticsReqLimitOff, in.Limit)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|