mirror of https://github.com/vernonkeenan/lib
feat(members): add governed TrackEvent client (#24)
parent
d53ad0d601
commit
8aac9faacd
|
|
@ -23,7 +23,7 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
const membersProviderSpecSHA256 = "707dcee4b2078d431ba7f6c6a81105fb1c94c4b0b9298fa04567e63343af9a9d"
|
||||
const membersProviderSpecSHA256 = "631ed1313bf3a2fee7d7f1cd053c09b058bf8acb6117d3100af24e340c57291e"
|
||||
|
||||
var learningTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
||||
return nil
|
||||
|
|
@ -517,7 +517,7 @@ func TestMembersSpecIsPinnedToProviderSource(t *testing.T) {
|
|||
}
|
||||
sum := sha256.Sum256(mainSpec)
|
||||
if got := hex.EncodeToString(sum[:]); got != membersProviderSpecSHA256 {
|
||||
t.Fatalf("Members spec drifted from integrated Cluster provider commit a7cedc5: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
|
||||
t.Fatalf("Members spec drifted from the governed TrackEvent provider source: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
|
||||
}
|
||||
|
||||
externalSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "external", "members-vernonkeenan.yaml"))
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import (
|
|||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/sessions"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/templates"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tenants"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_events"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/tracks"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/transactions"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/users"
|
||||
|
|
@ -110,6 +111,7 @@ func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Member
|
|||
cli.Sessions = sessions.New(transport, formats)
|
||||
cli.Templates = templates.New(transport, formats)
|
||||
cli.Tenants = tenants.New(transport, formats)
|
||||
cli.TrackEvents = track_events.New(transport, formats)
|
||||
cli.Tracks = tracks.New(transport, formats)
|
||||
cli.Transactions = transactions.New(transport, formats)
|
||||
cli.Users = users.New(transport, formats)
|
||||
|
|
@ -222,6 +224,8 @@ type Members struct {
|
|||
|
||||
Tenants tenants.ClientService
|
||||
|
||||
TrackEvents track_events.ClientService
|
||||
|
||||
Tracks tracks.ClientService
|
||||
|
||||
Transactions transactions.ClientService
|
||||
|
|
@ -259,6 +263,7 @@ func (c *Members) SetTransport(transport runtime.ContextualTransport) {
|
|||
c.Sessions.SetTransport(transport)
|
||||
c.Templates.SetTransport(transport)
|
||||
c.Tenants.SetTransport(transport)
|
||||
c.TrackEvents.SetTransport(transport)
|
||||
c.Tracks.SetTransport(transport)
|
||||
c.Transactions.SetTransport(transport)
|
||||
c.Users.SetTransport(transport)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
const membersTrackSpecSHA256 = "707dcee4b2078d431ba7f6c6a81105fb1c94c4b0b9298fa04567e63343af9a9d"
|
||||
const membersTrackSpecSHA256 = "631ed1313bf3a2fee7d7f1cd053c09b058bf8acb6117d3100af24e340c57291e"
|
||||
|
||||
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
||||
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
||||
|
|
@ -167,7 +167,7 @@ func TestTrackModelAndSingleRecordRequestAreBounded(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestTrackSurfaceOmitsRelationshipsDeleteAndUnsafeAliases(t *testing.T) {
|
||||
func TestTrackSurfaceSeparatesBoundedRelationshipAndOmitsUnsafeAliases(t *testing.T) {
|
||||
contract := reflect.TypeOf((*tracks.ClientService)(nil)).Elem()
|
||||
for index := 0; index < contract.NumMethod(); index++ {
|
||||
method := contract.Method(index).Name
|
||||
|
|
@ -182,25 +182,22 @@ func TestTrackSurfaceOmitsRelationshipsDeleteAndUnsafeAliases(t *testing.T) {
|
|||
if _, exists := root.FieldByName("Tracks"); !exists {
|
||||
t.Fatal("root Members client does not expose governed Tracks")
|
||||
}
|
||||
for _, forbidden := range []string{
|
||||
"TrackEvent", "TrackEvents", "TrackTopic", "TrackTopics", "TrackUser", "TrackUsers",
|
||||
} {
|
||||
if _, exists := root.FieldByName("TrackEvents"); !exists {
|
||||
t.Fatal("root Members client does not expose governed TrackEvents")
|
||||
}
|
||||
for _, forbidden := range []string{"TrackTopic", "TrackTopics", "TrackUser", "TrackUsers"} {
|
||||
if _, exists := root.FieldByName(forbidden); exists {
|
||||
t.Errorf("root Members client exposes provider-pending %s", forbidden)
|
||||
}
|
||||
}
|
||||
|
||||
repoRoot := learningRepoRoot(t)
|
||||
for _, path := range []string{
|
||||
"/trackevents", "/tracktopics", "/trackusers",
|
||||
} {
|
||||
for _, path := range []string{"/tracktopics", "/trackusers"} {
|
||||
if strings.Contains(readMembersLearningSpec(t), "\n "+path+":") {
|
||||
t.Errorf("authoritative spec exposes provider-pending %s", path)
|
||||
}
|
||||
}
|
||||
for _, artifact := range []string{
|
||||
"trackevent.go", "trackevent_request.go", "trackevent_response.go",
|
||||
"track_event.go", "track_event_request.go", "track_event_response.go",
|
||||
"tracktopic.go", "tracktopic_request.go", "tracktopic_response.go",
|
||||
"track_topic.go", "track_topic_request.go", "track_topic_response.go",
|
||||
"trackuser.go", "trackuser_request.go", "trackuser_response.go",
|
||||
|
|
@ -212,9 +209,7 @@ func TestTrackSurfaceOmitsRelationshipsDeleteAndUnsafeAliases(t *testing.T) {
|
|||
t.Errorf("provider-pending generated artifact exists: %s", artifact)
|
||||
}
|
||||
}
|
||||
for _, clientDir := range []string{
|
||||
"trackevents", "track_events", "tracktopics", "track_topics", "trackusers", "track_users",
|
||||
} {
|
||||
for _, clientDir := range []string{"tracktopics", "track_topics", "trackusers", "track_users"} {
|
||||
path := filepath.Join(repoRoot, "api", "members", "members_client", clientDir)
|
||||
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
||||
t.Errorf("provider-pending generated client directory exists: %s", clientDir)
|
||||
|
|
@ -233,7 +228,7 @@ func TestMembersSpecIsPinnedToTrackProviderCommit(t *testing.T) {
|
|||
sum := sha256.Sum256(mainSpec)
|
||||
if got := hex.EncodeToString(sum[:]); got != membersTrackSpecSHA256 {
|
||||
t.Fatalf(
|
||||
"Members spec drifted from integrated Cluster provider commit a7cedc5: SHA-256 = %s, want %s",
|
||||
"Members spec drifted from the governed TrackEvent provider source: SHA-256 = %s, want %s",
|
||||
got, membersTrackSpecSHA256,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
package members_client
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_events"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
func TestTrackEventClientExposesOnlyReadAndImmutableCreate(t *testing.T) {
|
||||
client := track_events.New(nil, strfmt.Default)
|
||||
if client == nil {
|
||||
t.Fatal("generated TrackEvent client is nil")
|
||||
}
|
||||
var _ track_events.ClientService = client
|
||||
|
||||
params := track_events.NewGetTrackEventsParams().
|
||||
WithID(trackEventString("association")).
|
||||
WithTrackID(trackEventString("track")).
|
||||
WithEventID(trackEventString("event"))
|
||||
if params.ID == nil || *params.ID != "association" ||
|
||||
params.TrackID == nil || *params.TrackID != "track" ||
|
||||
params.EventID == nil || *params.EventID != "event" {
|
||||
t.Fatal("generated TrackEvent GET filters do not preserve values")
|
||||
}
|
||||
|
||||
request := &members_models.TrackEventRequest{Data: []*members_models.TrackEvent{{
|
||||
EventID: "event", TrackID: "track",
|
||||
}}}
|
||||
create := track_events.NewPostTrackEventsParams().WithTrackEventRequest(request)
|
||||
if create.TrackEventRequest != request {
|
||||
t.Fatal("generated TrackEvent POST does not preserve its request")
|
||||
}
|
||||
|
||||
entries, err := os.ReadDir("track_events")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, entry := range entries {
|
||||
name := strings.ToLower(entry.Name())
|
||||
if strings.Contains(name, "put_") || strings.Contains(name, "delete_") {
|
||||
t.Errorf("forbidden mutable TrackEvent operation artifact: %s", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrackEventClientHasNoLegacyOrCredentialSurface(t *testing.T) {
|
||||
for _, root := range []string{"track_events", "../members_models"} {
|
||||
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if info.IsDir() || (!strings.Contains(path, "track_event") && root != "track_events") {
|
||||
return nil
|
||||
}
|
||||
raw, readErr := os.ReadFile(path)
|
||||
if readErr != nil {
|
||||
return readErr
|
||||
}
|
||||
source := strings.ToLower(string(raw))
|
||||
forbidden := []string{"salesforce", "sf-gate", "go-force", "cache"}
|
||||
if root != "track_events" {
|
||||
forbidden = append(forbidden, "api_key", "credential", "password", "token")
|
||||
}
|
||||
for _, forbidden := range forbidden {
|
||||
if strings.Contains(source, forbidden) {
|
||||
t.Errorf("%s contains forbidden coupling %q", path, forbidden)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func trackEventString(value string) *string { return &value }
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package track_events
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetTrackEventsParams creates a new GetTrackEventsParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetTrackEventsParams() *GetTrackEventsParams {
|
||||
return NewGetTrackEventsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetTrackEventsParamsWithTimeout creates a new GetTrackEventsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetTrackEventsParamsWithTimeout(timeout time.Duration) *GetTrackEventsParams {
|
||||
return &GetTrackEventsParams{
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTrackEventsParamsWithContext creates a new GetTrackEventsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetTrackEventsParams].
|
||||
func NewGetTrackEventsParamsWithContext(ctx context.Context) *GetTrackEventsParams {
|
||||
return &GetTrackEventsParams{
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTrackEventsParamsWithHTTPClient creates a new GetTrackEventsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetTrackEventsParamsWithHTTPClient(client *http.Client) *GetTrackEventsParams {
|
||||
return &GetTrackEventsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetTrackEventsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get track events operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetTrackEventsParams struct {
|
||||
|
||||
// EventID.
|
||||
EventID *string
|
||||
|
||||
// ID.
|
||||
//
|
||||
// Unique Record ID
|
||||
ID *string
|
||||
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
// TrackID.
|
||||
TrackID *string
|
||||
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get track events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTrackEventsParams) WithDefaults() *GetTrackEventsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get track events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetTrackEventsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithTimeout(timeout time.Duration) *GetTrackEventsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetTimeout(timeout time.Duration) {
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get track events params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetTrackEventsParams].
|
||||
func (o *GetTrackEventsParams) WithContext(ctx context.Context) *GetTrackEventsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get track events params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetTrackEventsParams].
|
||||
func (o *GetTrackEventsParams) SetContext(ctx context.Context) {
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithHTTPClient(client *http.Client) *GetTrackEventsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEventID adds the eventID to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithEventID(eventID *string) *GetTrackEventsParams {
|
||||
o.SetEventID(eventID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEventID adds the eventId to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetEventID(eventID *string) {
|
||||
o.EventID = eventID
|
||||
}
|
||||
|
||||
// WithID adds the id to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithID(id *string) *GetTrackEventsParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithLimit(limit *int64) *GetTrackEventsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithOffset(offset *int64) *GetTrackEventsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WithTrackID adds the trackID to the get track events params.
|
||||
func (o *GetTrackEventsParams) WithTrackID(trackID *string) *GetTrackEventsParams {
|
||||
o.SetTrackID(trackID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTrackID adds the trackId to the get track events params.
|
||||
func (o *GetTrackEventsParams) SetTrackID(trackID *string) {
|
||||
o.TrackID = trackID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.EventID != nil {
|
||||
|
||||
// query param eventId
|
||||
var qrEventID string
|
||||
|
||||
if o.EventID != nil {
|
||||
qrEventID = *o.EventID
|
||||
}
|
||||
qEventID := qrEventID
|
||||
if qEventID != "" {
|
||||
|
||||
if err := r.SetQueryParam("eventId", qEventID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.TrackID != nil {
|
||||
|
||||
// query param trackId
|
||||
var qrTrackID string
|
||||
|
||||
if o.TrackID != nil {
|
||||
qrTrackID = *o.TrackID
|
||||
}
|
||||
qTrackID := qrTrackID
|
||||
if qTrackID != "" {
|
||||
|
||||
if err := r.SetQueryParam("trackId", qTrackID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,410 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package track_events
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// GetTrackEventsReader is a Reader for the GetTrackEvents structure.
|
||||
type GetTrackEventsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetTrackEventsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetTrackEventsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetTrackEventsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetTrackEventsNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetTrackEventsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /trackevents] getTrackEvents", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetTrackEventsOK creates a GetTrackEventsOK with default headers values
|
||||
func NewGetTrackEventsOK() *GetTrackEventsOK {
|
||||
return &GetTrackEventsOK{}
|
||||
}
|
||||
|
||||
// GetTrackEventsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Governed Track-to-Event association response
|
||||
type GetTrackEventsOK struct {
|
||||
Payload *members_models.TrackEventResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get track events o k response has a 2xx status code
|
||||
func (o *GetTrackEventsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get track events o k response has a 3xx status code
|
||||
func (o *GetTrackEventsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get track events o k response has a 4xx status code
|
||||
func (o *GetTrackEventsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get track events o k response has a 5xx status code
|
||||
func (o *GetTrackEventsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get track events o k response a status code equal to that given
|
||||
func (o *GetTrackEventsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get track events o k response
|
||||
func (o *GetTrackEventsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.TrackEventResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTrackEventsUnauthorized creates a GetTrackEventsUnauthorized with default headers values
|
||||
func NewGetTrackEventsUnauthorized() *GetTrackEventsUnauthorized {
|
||||
return &GetTrackEventsUnauthorized{}
|
||||
}
|
||||
|
||||
// GetTrackEventsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type GetTrackEventsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get track events unauthorized response has a 2xx status code
|
||||
func (o *GetTrackEventsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get track events unauthorized response has a 3xx status code
|
||||
func (o *GetTrackEventsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get track events unauthorized response has a 4xx status code
|
||||
func (o *GetTrackEventsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get track events unauthorized response has a 5xx status code
|
||||
func (o *GetTrackEventsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get track events unauthorized response a status code equal to that given
|
||||
func (o *GetTrackEventsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get track events unauthorized response
|
||||
func (o *GetTrackEventsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsUnauthorized) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsUnauthorized) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTrackEventsForbidden creates a GetTrackEventsForbidden with default headers values
|
||||
func NewGetTrackEventsForbidden() *GetTrackEventsForbidden {
|
||||
return &GetTrackEventsForbidden{}
|
||||
}
|
||||
|
||||
// GetTrackEventsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetTrackEventsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get track events forbidden response has a 2xx status code
|
||||
func (o *GetTrackEventsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get track events forbidden response has a 3xx status code
|
||||
func (o *GetTrackEventsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get track events forbidden response has a 4xx status code
|
||||
func (o *GetTrackEventsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get track events forbidden response has a 5xx status code
|
||||
func (o *GetTrackEventsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get track events forbidden response a status code equal to that given
|
||||
func (o *GetTrackEventsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get track events forbidden response
|
||||
func (o *GetTrackEventsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsForbidden) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsForbidden) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTrackEventsNotFound creates a GetTrackEventsNotFound with default headers values
|
||||
func NewGetTrackEventsNotFound() *GetTrackEventsNotFound {
|
||||
return &GetTrackEventsNotFound{}
|
||||
}
|
||||
|
||||
// GetTrackEventsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetTrackEventsNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get track events not found response has a 2xx status code
|
||||
func (o *GetTrackEventsNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get track events not found response has a 3xx status code
|
||||
func (o *GetTrackEventsNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get track events not found response has a 4xx status code
|
||||
func (o *GetTrackEventsNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get track events not found response has a 5xx status code
|
||||
func (o *GetTrackEventsNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get track events not found response a status code equal to that given
|
||||
func (o *GetTrackEventsNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get track events not found response
|
||||
func (o *GetTrackEventsNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsNotFound) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsNotFound) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetTrackEventsInternalServerError creates a GetTrackEventsInternalServerError with default headers values
|
||||
func NewGetTrackEventsInternalServerError() *GetTrackEventsInternalServerError {
|
||||
return &GetTrackEventsInternalServerError{}
|
||||
}
|
||||
|
||||
// GetTrackEventsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetTrackEventsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get track events internal server error response has a 2xx status code
|
||||
func (o *GetTrackEventsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get track events internal server error response has a 3xx status code
|
||||
func (o *GetTrackEventsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get track events internal server error response has a 4xx status code
|
||||
func (o *GetTrackEventsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get track events internal server error response has a 5xx status code
|
||||
func (o *GetTrackEventsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get track events internal server error response a status code equal to that given
|
||||
func (o *GetTrackEventsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get track events internal server error response
|
||||
func (o *GetTrackEventsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsInternalServerError) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsInternalServerError) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package track_events
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewPostTrackEventsParams creates a new PostTrackEventsParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostTrackEventsParams() *PostTrackEventsParams {
|
||||
return NewPostTrackEventsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostTrackEventsParamsWithTimeout creates a new PostTrackEventsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostTrackEventsParamsWithTimeout(timeout time.Duration) *PostTrackEventsParams {
|
||||
return &PostTrackEventsParams{
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostTrackEventsParamsWithContext creates a new PostTrackEventsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostTrackEventsParams].
|
||||
func NewPostTrackEventsParamsWithContext(ctx context.Context) *PostTrackEventsParams {
|
||||
return &PostTrackEventsParams{
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostTrackEventsParamsWithHTTPClient creates a new PostTrackEventsParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostTrackEventsParamsWithHTTPClient(client *http.Client) *PostTrackEventsParams {
|
||||
return &PostTrackEventsParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostTrackEventsParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post track events operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostTrackEventsParams struct {
|
||||
|
||||
// TrackEventRequest.
|
||||
//
|
||||
// Exactly one governed Track-to-Event association
|
||||
TrackEventRequest *members_models.TrackEventRequest
|
||||
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post track events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostTrackEventsParams) WithDefaults() *PostTrackEventsParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post track events params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostTrackEventsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post track events params.
|
||||
func (o *PostTrackEventsParams) WithTimeout(timeout time.Duration) *PostTrackEventsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post track events params.
|
||||
func (o *PostTrackEventsParams) SetTimeout(timeout time.Duration) {
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post track events params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostTrackEventsParams].
|
||||
func (o *PostTrackEventsParams) WithContext(ctx context.Context) *PostTrackEventsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post track events params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostTrackEventsParams].
|
||||
func (o *PostTrackEventsParams) SetContext(ctx context.Context) {
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post track events params.
|
||||
func (o *PostTrackEventsParams) WithHTTPClient(client *http.Client) *PostTrackEventsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post track events params.
|
||||
func (o *PostTrackEventsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithTrackEventRequest adds the trackEventRequest to the post track events params.
|
||||
func (o *PostTrackEventsParams) WithTrackEventRequest(trackEventRequest *members_models.TrackEventRequest) *PostTrackEventsParams {
|
||||
o.SetTrackEventRequest(trackEventRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTrackEventRequest adds the trackEventRequest to the post track events params.
|
||||
func (o *PostTrackEventsParams) SetTrackEventRequest(trackEventRequest *members_models.TrackEventRequest) {
|
||||
o.TrackEventRequest = trackEventRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.TrackEventRequest != nil {
|
||||
if err := r.SetBodyParam(o.TrackEventRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,410 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package track_events
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// PostTrackEventsReader is a Reader for the PostTrackEvents structure.
|
||||
type PostTrackEventsReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostTrackEventsOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostTrackEventsUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostTrackEventsForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostTrackEventsUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostTrackEventsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[POST /trackevents] postTrackEvents", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostTrackEventsOK creates a PostTrackEventsOK with default headers values
|
||||
func NewPostTrackEventsOK() *PostTrackEventsOK {
|
||||
return &PostTrackEventsOK{}
|
||||
}
|
||||
|
||||
// PostTrackEventsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Governed Track-to-Event association response
|
||||
type PostTrackEventsOK struct {
|
||||
Payload *members_models.TrackEventResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post track events o k response has a 2xx status code
|
||||
func (o *PostTrackEventsOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post track events o k response has a 3xx status code
|
||||
func (o *PostTrackEventsOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post track events o k response has a 4xx status code
|
||||
func (o *PostTrackEventsOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post track events o k response has a 5xx status code
|
||||
func (o *PostTrackEventsOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post track events o k response a status code equal to that given
|
||||
func (o *PostTrackEventsOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post track events o k response
|
||||
func (o *PostTrackEventsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.TrackEventResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostTrackEventsUnauthorized creates a PostTrackEventsUnauthorized with default headers values
|
||||
func NewPostTrackEventsUnauthorized() *PostTrackEventsUnauthorized {
|
||||
return &PostTrackEventsUnauthorized{}
|
||||
}
|
||||
|
||||
// PostTrackEventsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type PostTrackEventsUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post track events unauthorized response has a 2xx status code
|
||||
func (o *PostTrackEventsUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post track events unauthorized response has a 3xx status code
|
||||
func (o *PostTrackEventsUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post track events unauthorized response has a 4xx status code
|
||||
func (o *PostTrackEventsUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post track events unauthorized response has a 5xx status code
|
||||
func (o *PostTrackEventsUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post track events unauthorized response a status code equal to that given
|
||||
func (o *PostTrackEventsUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post track events unauthorized response
|
||||
func (o *PostTrackEventsUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnauthorized) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnauthorized) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostTrackEventsForbidden creates a PostTrackEventsForbidden with default headers values
|
||||
func NewPostTrackEventsForbidden() *PostTrackEventsForbidden {
|
||||
return &PostTrackEventsForbidden{}
|
||||
}
|
||||
|
||||
// PostTrackEventsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostTrackEventsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post track events forbidden response has a 2xx status code
|
||||
func (o *PostTrackEventsForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post track events forbidden response has a 3xx status code
|
||||
func (o *PostTrackEventsForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post track events forbidden response has a 4xx status code
|
||||
func (o *PostTrackEventsForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post track events forbidden response has a 5xx status code
|
||||
func (o *PostTrackEventsForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post track events forbidden response a status code equal to that given
|
||||
func (o *PostTrackEventsForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post track events forbidden response
|
||||
func (o *PostTrackEventsForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsForbidden) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsForbidden) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostTrackEventsUnprocessableEntity creates a PostTrackEventsUnprocessableEntity with default headers values
|
||||
func NewPostTrackEventsUnprocessableEntity() *PostTrackEventsUnprocessableEntity {
|
||||
return &PostTrackEventsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
// PostTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostTrackEventsUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post track events unprocessable entity response has a 2xx status code
|
||||
func (o *PostTrackEventsUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post track events unprocessable entity response has a 3xx status code
|
||||
func (o *PostTrackEventsUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post track events unprocessable entity response has a 4xx status code
|
||||
func (o *PostTrackEventsUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post track events unprocessable entity response has a 5xx status code
|
||||
func (o *PostTrackEventsUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post track events unprocessable entity response a status code equal to that given
|
||||
func (o *PostTrackEventsUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post track events unprocessable entity response
|
||||
func (o *PostTrackEventsUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnprocessableEntity) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnprocessableEntity) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostTrackEventsInternalServerError creates a PostTrackEventsInternalServerError with default headers values
|
||||
func NewPostTrackEventsInternalServerError() *PostTrackEventsInternalServerError {
|
||||
return &PostTrackEventsInternalServerError{}
|
||||
}
|
||||
|
||||
// PostTrackEventsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostTrackEventsInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post track events internal server error response has a 2xx status code
|
||||
func (o *PostTrackEventsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post track events internal server error response has a 3xx status code
|
||||
func (o *PostTrackEventsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post track events internal server error response has a 4xx status code
|
||||
func (o *PostTrackEventsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post track events internal server error response has a 5xx status code
|
||||
func (o *PostTrackEventsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post track events internal server error response a status code equal to that given
|
||||
func (o *PostTrackEventsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post track events internal server error response
|
||||
func (o *PostTrackEventsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsInternalServerError) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsInternalServerError) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package track_events
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new track events API client.
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
// New creates a new track events API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new track events API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for track events API.
|
||||
type Client struct {
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// GetTrackEvents get governed track to event associations.
|
||||
GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error)
|
||||
|
||||
// GetTrackEventsContext get governed track to event associations.
|
||||
GetTrackEventsContext(ctx context.Context, params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error)
|
||||
|
||||
// PostTrackEvents create a governed track to event association.
|
||||
PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error)
|
||||
|
||||
// PostTrackEventsContext create a governed track to event association.
|
||||
PostTrackEventsContext(ctx context.Context, params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
// GetTrackEvents gets governed track to event associations.
|
||||
//
|
||||
// Reads Track-to-Event associations only when both roots belong to active members of the configured Keenan Vision tenant. Owners and Managers may read all such associations; Contributors may read only associations whose Track creator and Event organizer are both the acting member. Requires members:track-event:read and an active native member session..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetTrackEventsContext] instead.
|
||||
func (a *Client) GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error) {
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetTrackEventsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetTrackEventsContext gets governed track to event associations.
|
||||
//
|
||||
// Reads Track-to-Event associations only when both roots belong to active members of the configured Keenan Vision tenant. Owners and Managers may read all such associations; Contributors may read only associations whose Track creator and Event organizer are both the acting member. Requires members:track-event:read and an active native member session..
|
||||
//
|
||||
// Do not use the deprecated [GetTrackEventsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetTrackEventsContext(ctx context.Context, params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetTrackEventsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getTrackEvents",
|
||||
Method: "GET",
|
||||
PathPattern: "/trackevents",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetTrackEventsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetTrackEventsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// PostTrackEvents creates a governed track to event association.
|
||||
//
|
||||
// Creates one immutable Track-to-Event association after proving both roots belong to active members of the configured Keenan Vision tenant. Requires members:track-event:create and an active native Owner or Manager session. Identity and audit fields are server-owned. Update and delete are intentionally unsupported..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostTrackEventsContext] instead.
|
||||
func (a *Client) PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error) {
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostTrackEventsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostTrackEventsContext creates a governed track to event association.
|
||||
//
|
||||
// Creates one immutable Track-to-Event association after proving both roots belong to active members of the configured Keenan Vision tenant. Requires members:track-event:create and an active native Owner or Manager session. Identity and audit fields are server-owned. Update and delete are intentionally unsupported..
|
||||
//
|
||||
// Do not use the deprecated [PostTrackEventsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostTrackEventsContext(ctx context.Context, params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostTrackEventsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postTrackEvents",
|
||||
Method: "POST",
|
||||
PathPattern: "/trackevents",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostTrackEventsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostTrackEventsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [TrackEventsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members_models
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// TrackEvent An immutable governed association between a tenant-bounded Track and Event. Both relationship keys and all identity and audit fields are immutable after creation.
|
||||
//
|
||||
// swagger:model TrackEvent
|
||||
type TrackEvent struct {
|
||||
|
||||
// created by ID
|
||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||
|
||||
// created date
|
||||
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||
|
||||
// event ID
|
||||
EventID string `json:"EventID,omitempty"`
|
||||
|
||||
// ID
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
// last modified by ID
|
||||
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
// last modified date
|
||||
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
|
||||
|
||||
// track ID
|
||||
TrackID string `json:"TrackID,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this track event
|
||||
func (m *TrackEvent) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this track event based on context it is used
|
||||
func (m *TrackEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TrackEvent) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TrackEvent) UnmarshalBinary(b []byte) error {
|
||||
var res TrackEvent
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members_models
|
||||
|
||||
import (
|
||||
"context"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// TrackEventRequest Exactly one Track-to-Event association
|
||||
//
|
||||
// swagger:model TrackEventRequest
|
||||
type TrackEventRequest struct {
|
||||
|
||||
// data
|
||||
// Max Items: 1
|
||||
// Min Items: 1
|
||||
Data []*TrackEvent `json:"Data"`
|
||||
}
|
||||
|
||||
// Validate validates this track event request
|
||||
func (m *TrackEventRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventRequest) validateData(formats strfmt.Registry) error {
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
iDataSize := int64(len(m.Data))
|
||||
|
||||
if err := validate.MinItems("Data", "body", iDataSize, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxItems("Data", "body", iDataSize, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this track event request based on the context it is used
|
||||
func (m *TrackEventRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TrackEventRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TrackEventRequest) UnmarshalBinary(b []byte) error {
|
||||
var res TrackEventRequest
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package members_models
|
||||
|
||||
import (
|
||||
"context"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// TrackEventResponse An array of governed Track-to-Event associations
|
||||
//
|
||||
// swagger:model TrackEventResponse
|
||||
type TrackEventResponse struct {
|
||||
|
||||
// data
|
||||
Data []*TrackEvent `json:"Data"`
|
||||
|
||||
// meta
|
||||
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this track event response
|
||||
func (m *TrackEventResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateData(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMeta(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventResponse) validateData(formats strfmt.Registry) error {
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this track event response based on the context it is used
|
||||
func (m *TrackEventResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateMeta(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TrackEventResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TrackEventResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TrackEventResponse) UnmarshalBinary(b []byte) error {
|
||||
var res TrackEventResponse
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Members TrackEvent client
|
||||
|
||||
Date: 2026-07-24
|
||||
|
||||
Provider source: Members commit
|
||||
`4d9fbe2` (`agent/track-event-provider`; draft until exact DB scopes land).
|
||||
|
||||
The generated Members client exposes only:
|
||||
|
||||
- `GET /trackevents` for tenant-bounded list/detail reads, with optional ID,
|
||||
TrackID, and EventID filters.
|
||||
- `POST /trackevents` for Owner/Manager creation of one immutable
|
||||
Track-to-Event association.
|
||||
|
||||
The provider requires compound machine API-key plus native member-session
|
||||
authentication and exact `members:track-event:read` or
|
||||
`members:track-event:create` machine scope. There is no broad manage scope,
|
||||
update, delete, Ticket coupling, Salesforce, sf-gate, Cache, credential, or
|
||||
direct-database client surface.
|
||||
|
||||
Members proves both roots against the configured Keenan Vision tenant:
|
||||
the Track creator and Event organizer must each have an active membership.
|
||||
Contributors may read only relationships for which they own both roots.
|
||||
`TrackTopic` remains blocked on a governed Members-to-Research Topic
|
||||
validation capability. `TrackUser` remains blocked on an explicit
|
||||
assignment-role vocabulary and grant/revoke lifecycle.
|
||||
|
|
@ -218,6 +218,13 @@ parameters:
|
|||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/TrackRequest"
|
||||
TrackEventRequest:
|
||||
description: Exactly one governed Track-to-Event association
|
||||
in: body
|
||||
name: trackEventRequest
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/TrackEventRequest"
|
||||
FavoriteRequest:
|
||||
description: An array of new Favorite records
|
||||
in: body
|
||||
|
|
@ -584,6 +591,10 @@ responses:
|
|||
description: Governed Track response
|
||||
schema:
|
||||
$ref: "#/definitions/TrackResponse"
|
||||
TrackEventResponse:
|
||||
description: Governed Track-to-Event association response
|
||||
schema:
|
||||
$ref: "#/definitions/TrackEventResponse"
|
||||
FavoriteResponse:
|
||||
description: Favorite Response Object
|
||||
schema:
|
||||
|
|
@ -4205,6 +4216,61 @@ paths:
|
|||
summary: Update a governed Track
|
||||
tags:
|
||||
- Tracks
|
||||
/trackevents:
|
||||
get:
|
||||
description: Reads Track-to-Event associations only when both roots belong to active members of the configured Keenan Vision tenant. Owners and Managers may read all such associations; Contributors may read only associations whose Track creator and Event organizer are both the acting member. Requires members:track-event:read and an active native member session.
|
||||
operationId: getTrackEvents
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
kvSessionCookie: []
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- name: trackId
|
||||
in: query
|
||||
type: string
|
||||
required: false
|
||||
- name: eventId
|
||||
in: query
|
||||
type: string
|
||||
required: false
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/TrackEventResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
summary: Get governed Track-to-Event associations
|
||||
tags:
|
||||
- TrackEvents
|
||||
post:
|
||||
description: Creates one immutable Track-to-Event association after proving both roots belong to active members of the configured Keenan Vision tenant. Requires members:track-event:create and an active native Owner or Manager session. Identity and audit fields are server-owned. Update and delete are intentionally unsupported.
|
||||
operationId: postTrackEvents
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
kvSessionCookie: []
|
||||
parameters:
|
||||
- $ref: "#/parameters/TrackEventRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/TrackEventResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
summary: Create a governed Track-to-Event association
|
||||
tags:
|
||||
- TrackEvents
|
||||
/transactions:
|
||||
get:
|
||||
description: Return a list of Transaction records from the datastore
|
||||
|
|
@ -4516,6 +4582,49 @@ definitions:
|
|||
$ref: "#/definitions/Track"
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
TrackEvent:
|
||||
description: An immutable governed association between a tenant-bounded Track and Event. Both relationship keys and all identity and audit fields are immutable after creation.
|
||||
type: object
|
||||
properties:
|
||||
ID:
|
||||
type: string
|
||||
CreatedByID:
|
||||
type: string
|
||||
x-nullable: true
|
||||
CreatedDate:
|
||||
type: string
|
||||
x-nullable: true
|
||||
EventID:
|
||||
type: string
|
||||
LastModifiedByID:
|
||||
type: string
|
||||
x-nullable: true
|
||||
LastModifiedDate:
|
||||
type: string
|
||||
x-nullable: true
|
||||
TrackID:
|
||||
type: string
|
||||
x-provider-ownership: both-roots-active-in-configured-keenan-vision-tenant
|
||||
TrackEventRequest:
|
||||
description: Exactly one Track-to-Event association
|
||||
type: object
|
||||
properties:
|
||||
Data:
|
||||
type: array
|
||||
minItems: 1
|
||||
maxItems: 1
|
||||
items:
|
||||
$ref: "#/definitions/TrackEvent"
|
||||
TrackEventResponse:
|
||||
description: An array of governed Track-to-Event associations
|
||||
type: object
|
||||
properties:
|
||||
Data:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/TrackEvent"
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
AuditFields:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
|||
|
|
@ -218,6 +218,13 @@ parameters:
|
|||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/TrackRequest"
|
||||
TrackEventRequest:
|
||||
description: Exactly one governed Track-to-Event association
|
||||
in: body
|
||||
name: trackEventRequest
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/TrackEventRequest"
|
||||
FavoriteRequest:
|
||||
description: An array of new Favorite records
|
||||
in: body
|
||||
|
|
@ -584,6 +591,10 @@ responses:
|
|||
description: Governed Track response
|
||||
schema:
|
||||
$ref: "#/definitions/TrackResponse"
|
||||
TrackEventResponse:
|
||||
description: Governed Track-to-Event association response
|
||||
schema:
|
||||
$ref: "#/definitions/TrackEventResponse"
|
||||
FavoriteResponse:
|
||||
description: Favorite Response Object
|
||||
schema:
|
||||
|
|
@ -4205,6 +4216,61 @@ paths:
|
|||
summary: Update a governed Track
|
||||
tags:
|
||||
- Tracks
|
||||
/trackevents:
|
||||
get:
|
||||
description: Reads Track-to-Event associations only when both roots belong to active members of the configured Keenan Vision tenant. Owners and Managers may read all such associations; Contributors may read only associations whose Track creator and Event organizer are both the acting member. Requires members:track-event:read and an active native member session.
|
||||
operationId: getTrackEvents
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
kvSessionCookie: []
|
||||
parameters:
|
||||
- $ref: "#/parameters/idQuery"
|
||||
- name: trackId
|
||||
in: query
|
||||
type: string
|
||||
required: false
|
||||
- name: eventId
|
||||
in: query
|
||||
type: string
|
||||
required: false
|
||||
- $ref: "#/parameters/limitQuery"
|
||||
- $ref: "#/parameters/offsetQuery"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/TrackEventResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"404":
|
||||
$ref: "#/responses/NotFound"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
summary: Get governed Track-to-Event associations
|
||||
tags:
|
||||
- TrackEvents
|
||||
post:
|
||||
description: Creates one immutable Track-to-Event association after proving both roots belong to active members of the configured Keenan Vision tenant. Requires members:track-event:create and an active native Owner or Manager session. Identity and audit fields are server-owned. Update and delete are intentionally unsupported.
|
||||
operationId: postTrackEvents
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
kvSessionCookie: []
|
||||
parameters:
|
||||
- $ref: "#/parameters/TrackEventRequest"
|
||||
responses:
|
||||
"200":
|
||||
$ref: "#/responses/TrackEventResponse"
|
||||
"401":
|
||||
$ref: "#/responses/Unauthorized"
|
||||
"403":
|
||||
$ref: "#/responses/AccessForbidden"
|
||||
"422":
|
||||
$ref: "#/responses/UnprocessableEntity"
|
||||
"500":
|
||||
$ref: "#/responses/ServerError"
|
||||
summary: Create a governed Track-to-Event association
|
||||
tags:
|
||||
- TrackEvents
|
||||
/transactions:
|
||||
get:
|
||||
description: Return a list of Transaction records from the datastore
|
||||
|
|
@ -4516,6 +4582,49 @@ definitions:
|
|||
$ref: "#/definitions/Track"
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
TrackEvent:
|
||||
description: An immutable governed association between a tenant-bounded Track and Event. Both relationship keys and all identity and audit fields are immutable after creation.
|
||||
type: object
|
||||
properties:
|
||||
ID:
|
||||
type: string
|
||||
CreatedByID:
|
||||
type: string
|
||||
x-nullable: true
|
||||
CreatedDate:
|
||||
type: string
|
||||
x-nullable: true
|
||||
EventID:
|
||||
type: string
|
||||
LastModifiedByID:
|
||||
type: string
|
||||
x-nullable: true
|
||||
LastModifiedDate:
|
||||
type: string
|
||||
x-nullable: true
|
||||
TrackID:
|
||||
type: string
|
||||
x-provider-ownership: both-roots-active-in-configured-keenan-vision-tenant
|
||||
TrackEventRequest:
|
||||
description: Exactly one Track-to-Event association
|
||||
type: object
|
||||
properties:
|
||||
Data:
|
||||
type: array
|
||||
minItems: 1
|
||||
maxItems: 1
|
||||
items:
|
||||
$ref: "#/definitions/TrackEvent"
|
||||
TrackEventResponse:
|
||||
description: An array of governed Track-to-Event associations
|
||||
type: object
|
||||
properties:
|
||||
Data:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/TrackEvent"
|
||||
Meta:
|
||||
$ref: "#/definitions/ResponseMeta"
|
||||
AuditFields:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
|||
Loading…
Reference in New Issue