feat(members): add governed Track relationship clients (#27)

agent/lib-database-metadata-client v0.7.19
Vernon Keenan 2026-07-24 08:16:09 -07:00 committed by GitHub
parent f9653c5652
commit 08763a7bbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 5480 additions and 33 deletions

View File

@ -23,7 +23,7 @@ import (
"github.com/go-openapi/strfmt"
)
const membersProviderSpecSHA256 = "6f60547e3faf342bf4b9f6aad15eebfde0cd553f60550f67d71e469dbd83cc7f"
const membersProviderSpecSHA256 = "4b7d409b5e989632ca4b0ab9a5a868dc1234a89b4dc3ba1fef307cd306478a6c"
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 the integrated TrackEvent and Transaction provider contract: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
t.Fatalf("Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, and TrackUser provider contract: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
}
externalSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "external", "members-vernonkeenan.yaml"))

View File

@ -35,6 +35,8 @@ import (
"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/track_topics"
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_users"
"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"
@ -112,6 +114,8 @@ func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Member
cli.Templates = templates.New(transport, formats)
cli.Tenants = tenants.New(transport, formats)
cli.TrackEvents = track_events.New(transport, formats)
cli.TrackTopics = track_topics.New(transport, formats)
cli.TrackUsers = track_users.New(transport, formats)
cli.Tracks = tracks.New(transport, formats)
cli.Transactions = transactions.New(transport, formats)
cli.Users = users.New(transport, formats)
@ -226,6 +230,10 @@ type Members struct {
TrackEvents track_events.ClientService
TrackTopics track_topics.ClientService
TrackUsers track_users.ClientService
Tracks tracks.ClientService
Transactions transactions.ClientService
@ -264,6 +272,8 @@ func (c *Members) SetTransport(transport runtime.ContextualTransport) {
c.Templates.SetTransport(transport)
c.Tenants.SetTransport(transport)
c.TrackEvents.SetTransport(transport)
c.TrackTopics.SetTransport(transport)
c.TrackUsers.SetTransport(transport)
c.Tracks.SetTransport(transport)
c.Transactions.SetTransport(transport)
c.Users.SetTransport(transport)

View File

@ -19,7 +19,7 @@ import (
"github.com/go-openapi/strfmt"
)
const membersTrackSpecSHA256 = "6f60547e3faf342bf4b9f6aad15eebfde0cd553f60550f67d71e469dbd83cc7f"
const membersTrackSpecSHA256 = "4b7d409b5e989632ca4b0ab9a5a868dc1234a89b4dc3ba1fef307cd306478a6c"
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
@ -167,7 +167,7 @@ func TestTrackModelAndSingleRecordRequestAreBounded(t *testing.T) {
}
}
func TestTrackSurfaceSeparatesBoundedRelationshipAndOmitsUnsafeAliases(t *testing.T) {
func TestTrackSurfaceSeparatesBoundedRelationshipClients(t *testing.T) {
contract := reflect.TypeOf((*tracks.ClientService)(nil)).Elem()
for index := 0; index < contract.NumMethod(); index++ {
method := contract.Method(index).Name
@ -185,34 +185,9 @@ func TestTrackSurfaceSeparatesBoundedRelationshipAndOmitsUnsafeAliases(t *testin
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{"/tracktopics", "/trackusers"} {
if strings.Contains(readMembersLearningSpec(t), "\n "+path+":") {
t.Errorf("authoritative spec exposes provider-pending %s", path)
}
}
for _, artifact := range []string{
"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",
"track_user.go", "track_user_request.go", "track_user_response.go",
} {
if _, err := os.Stat(filepath.Join(
repoRoot, "api", "members", "members_models", artifact,
)); !os.IsNotExist(err) {
t.Errorf("provider-pending generated artifact exists: %s", artifact)
}
}
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)
for _, required := range []string{"TrackTopics", "TrackUsers"} {
if _, exists := root.FieldByName(required); !exists {
t.Errorf("root Members client omits governed %s", required)
}
}
}
@ -228,7 +203,7 @@ func TestMembersSpecIsPinnedToTrackProviderCommit(t *testing.T) {
sum := sha256.Sum256(mainSpec)
if got := hex.EncodeToString(sum[:]); got != membersTrackSpecSHA256 {
t.Fatalf(
"Members spec drifted from the integrated TrackEvent and Transaction provider contract: SHA-256 = %s, want %s",
"Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, and TrackUser provider contract: SHA-256 = %s, want %s",
got, membersTrackSpecSHA256,
)
}

View File

@ -0,0 +1,218 @@
package members_client
import (
"os"
"path/filepath"
"strings"
"testing"
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_topics"
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/track_users"
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
"github.com/go-openapi/strfmt"
)
func TestTrackTopicClientExposesOnlyReadAndImmutableCreate(t *testing.T) {
client := track_topics.New(nil, strfmt.Default)
if client == nil {
t.Fatal("generated TrackTopic client is nil")
}
var _ track_topics.ClientService = client
params := track_topics.NewGetTrackTopicsParams().
WithID(trackRelationshipString("association")).
WithTrackID(trackRelationshipString("track")).
WithTopicID(trackRelationshipString("topic"))
if params.ID == nil || *params.ID != "association" ||
params.TrackID == nil || *params.TrackID != "track" ||
params.TopicID == nil || *params.TopicID != "topic" {
t.Fatal("generated TrackTopic GET filters do not preserve values")
}
request := &members_models.TrackTopicRequest{Data: []*members_models.TrackTopic{{
TopicID: "topic", TrackID: "track",
}}}
create := track_topics.NewPostTrackTopicsParams().WithTrackTopicRequest(request)
if create.TrackTopicRequest != request {
t.Fatal("generated TrackTopic POST does not preserve its request")
}
assertNoGeneratedOperation(t, "track_topics", "put_", "delete_")
}
func TestTrackUserClientExposesReadCreateAndRoleOnlyUpdate(t *testing.T) {
client := track_users.New(nil, strfmt.Default)
if client == nil {
t.Fatal("generated TrackUser client is nil")
}
var _ track_users.ClientService = client
params := track_users.NewGetTrackUsersParams().
WithID(trackRelationshipString("association")).
WithTrackID(trackRelationshipString("track")).
WithUserID(trackRelationshipString("user")).
WithRole(trackRelationshipString(members_models.TrackUserRoleModerator))
if params.ID == nil || *params.ID != "association" ||
params.TrackID == nil || *params.TrackID != "track" ||
params.UserID == nil || *params.UserID != "user" ||
params.Role == nil || *params.Role != "Moderator" {
t.Fatal("generated TrackUser GET filters do not preserve values")
}
request := &members_models.TrackUserRequest{Data: []*members_models.TrackUser{{
ID: "association", LastModifiedDate: trackRelationshipString("version"),
Role: members_models.TrackUserRolePresenter,
}}}
create := track_users.NewPostTrackUsersParams().WithTrackUserRequest(request)
update := track_users.NewPutTrackUsersParams().WithTrackUserRequest(request)
if create.TrackUserRequest != request || update.TrackUserRequest != request {
t.Fatal("generated TrackUser mutations do not preserve their request")
}
if members_models.TrackUserRoleAttendee != "Attendee" ||
members_models.TrackUserRoleModerator != "Moderator" ||
members_models.TrackUserRolePresenter != "Presenter" {
t.Fatal("generated TrackUser role vocabulary changed")
}
assertNoGeneratedOperation(t, "track_users", "delete_")
}
func TestMembersClientWiresTrackRelationshipServices(t *testing.T) {
client := New(nil, strfmt.Default)
if client.TrackTopics == nil || client.TrackUsers == nil {
t.Fatal("Members root client does not wire Track relationship services")
}
}
func TestTrackRelationshipSpecPreservesExactScopesAndCompoundAuth(t *testing.T) {
raw, err := os.ReadFile("../../../swagger/members-vernonkeenan.yaml")
if err != nil {
t.Fatal(err)
}
spec := string(raw)
tests := []struct {
path, method, operationID, scope string
}{
{"/tracktopics", "get", "getTrackTopics", "members:track-topic:read"},
{"/tracktopics", "post", "postTrackTopics", "members:track-topic:create"},
{"/trackusers", "get", "getTrackUsers", "members:track-user:read"},
{"/trackusers", "post", "postTrackUsers", "members:track-user:create"},
{"/trackusers", "put", "putTrackUsers", "members:track-user:update"},
}
const compoundSecurity = " security:\n - ApiKeyAuth: []\n kvSessionCookie: []"
for _, test := range tests {
block := trackRelationshipOperationBlock(t, spec, test.path, test.method)
if !strings.Contains(block, " operationId: "+test.operationID+"\n") {
t.Errorf("%s %s lost operationId %q", strings.ToUpper(test.method), test.path, test.operationID)
}
if strings.Count(block, compoundSecurity) != 1 {
t.Errorf("%s %s does not preserve compound authentication", strings.ToUpper(test.method), test.path)
}
if !strings.Contains(block, test.scope) {
t.Errorf("%s %s lost exact scope %q", strings.ToUpper(test.method), test.path, test.scope)
}
}
if strings.Contains(trackRelationshipPathBlock(t, spec, "/tracktopics"), " put:") ||
strings.Contains(trackRelationshipPathBlock(t, spec, "/tracktopics"), " delete:") {
t.Fatal("TrackTopic spec exposes unsupported mutation")
}
if strings.Contains(trackRelationshipPathBlock(t, spec, "/trackusers"), " delete:") {
t.Fatal("TrackUser spec exposes unsupported delete")
}
if !track_users.NewPutTrackUsersConflict().IsCode(409) {
t.Fatal("TrackUser update client lost the optimistic concurrency response")
}
}
func TestTrackRelationshipClientHasNoLegacyOrCredentialSurface(t *testing.T) {
for _, root := range []string{
"track_topics", "track_users", "../members_models",
} {
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if info.IsDir() ||
(root == "../members_models" &&
!strings.Contains(path, "track_topic") &&
!strings.Contains(path, "track_user")) {
return nil
}
raw, readErr := os.ReadFile(path)
if readErr != nil {
return readErr
}
source := strings.ToLower(string(raw))
forbiddenValues := []string{
"salesforce", "sf-gate", "go-force", "cache",
}
if root == "../members_models" {
forbiddenValues = append(
forbiddenValues,
"api_key", "credential", "password", "token",
)
}
for _, forbidden := range forbiddenValues {
if strings.Contains(source, forbidden) {
t.Errorf("%s contains forbidden coupling %q", path, forbidden)
}
}
return nil
})
if err != nil {
t.Fatal(err)
}
}
}
func assertNoGeneratedOperation(t *testing.T, directory string, prefixes ...string) {
t.Helper()
entries, err := os.ReadDir(directory)
if err != nil {
t.Fatal(err)
}
for _, entry := range entries {
name := strings.ToLower(entry.Name())
for _, prefix := range prefixes {
if strings.HasPrefix(name, prefix) {
t.Errorf("forbidden operation artifact: %s/%s", directory, name)
}
}
}
}
func trackRelationshipString(value string) *string { return &value }
func trackRelationshipPathBlock(t *testing.T, spec, path string) string {
t.Helper()
startMarker := "\n " + path + ":\n"
start := strings.Index(spec, startMarker)
if start < 0 {
t.Fatalf("missing path %s", path)
}
block := spec[start+1:]
if end := strings.Index(block, "\n /"); end >= 0 {
block = block[:end]
}
return block
}
func trackRelationshipOperationBlock(t *testing.T, spec, path, method string) string {
t.Helper()
pathBlock := trackRelationshipPathBlock(t, spec, path)
startMarker := "\n " + method + ":\n"
start := strings.Index("\n"+pathBlock, startMarker)
if start < 0 {
t.Fatalf("missing %s operation for %s", method, path)
}
block := ("\n" + pathBlock)[start+1:]
for _, next := range []string{"get", "post", "put", "patch", "delete"} {
if next == method {
continue
}
if end := strings.Index(block, "\n "+next+":\n"); end >= 0 {
block = block[:end]
}
}
return block
}

View File

@ -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_topics
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"
)
// NewGetTrackTopicsParams creates a new GetTrackTopicsParams 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 NewGetTrackTopicsParams() *GetTrackTopicsParams {
return NewGetTrackTopicsParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetTrackTopicsParamsWithTimeout creates a new GetTrackTopicsParams object
// with the ability to set a timeout on a request.
func NewGetTrackTopicsParamsWithTimeout(timeout time.Duration) *GetTrackTopicsParams {
return &GetTrackTopicsParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewGetTrackTopicsParamsWithContext creates a new GetTrackTopicsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackTopicsParams].
func NewGetTrackTopicsParamsWithContext(ctx context.Context) *GetTrackTopicsParams {
return &GetTrackTopicsParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewGetTrackTopicsParamsWithHTTPClient creates a new GetTrackTopicsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTrackTopicsParamsWithHTTPClient(client *http.Client) *GetTrackTopicsParams {
return &GetTrackTopicsParams{
HTTPClient: client,
}
}
/*
GetTrackTopicsParams contains all the parameters to send to the API endpoint
for the get track topics operation.
Typically these are written to a http.Request.
*/
type GetTrackTopicsParams struct {
// 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
// TopicID.
TopicID *string
// TrackID.
TrackID *string
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the get track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackTopicsParams) WithDefaults() *GetTrackTopicsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackTopicsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get track topics params.
func (o *GetTrackTopicsParams) WithTimeout(timeout time.Duration) *GetTrackTopicsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get track topics params.
func (o *GetTrackTopicsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the get track topics params.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackTopicsParams].
func (o *GetTrackTopicsParams) WithContext(ctx context.Context) *GetTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track topics params.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackTopicsParams].
func (o *GetTrackTopicsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the get track topics params.
func (o *GetTrackTopicsParams) WithHTTPClient(client *http.Client) *GetTrackTopicsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get track topics params.
func (o *GetTrackTopicsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get track topics params.
func (o *GetTrackTopicsParams) WithID(id *string) *GetTrackTopicsParams {
o.SetID(id)
return o
}
// SetID adds the id to the get track topics params.
func (o *GetTrackTopicsParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get track topics params.
func (o *GetTrackTopicsParams) WithLimit(limit *int64) *GetTrackTopicsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get track topics params.
func (o *GetTrackTopicsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get track topics params.
func (o *GetTrackTopicsParams) WithOffset(offset *int64) *GetTrackTopicsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get track topics params.
func (o *GetTrackTopicsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithTopicID adds the topicID to the get track topics params.
func (o *GetTrackTopicsParams) WithTopicID(topicID *string) *GetTrackTopicsParams {
o.SetTopicID(topicID)
return o
}
// SetTopicID adds the topicId to the get track topics params.
func (o *GetTrackTopicsParams) SetTopicID(topicID *string) {
o.TopicID = topicID
}
// WithTrackID adds the trackID to the get track topics params.
func (o *GetTrackTopicsParams) WithTrackID(trackID *string) *GetTrackTopicsParams {
o.SetTrackID(trackID)
return o
}
// SetTrackID adds the trackId to the get track topics params.
func (o *GetTrackTopicsParams) SetTrackID(trackID *string) {
o.TrackID = trackID
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
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.TopicID != nil {
// query param topicId
var qrTopicID string
if o.TopicID != nil {
qrTopicID = *o.TopicID
}
qTopicID := qrTopicID
if qTopicID != "" {
if err := r.SetQueryParam("topicId", qTopicID); 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
}

View File

@ -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_topics
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"
)
// GetTrackTopicsReader is a Reader for the GetTrackTopics structure.
type GetTrackTopicsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTrackTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewGetTrackTopicsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTrackTopicsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTrackTopicsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTrackTopicsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTrackTopicsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /tracktopics] getTrackTopics", response, response.Code())
}
}
// NewGetTrackTopicsOK creates a GetTrackTopicsOK with default headers values
func NewGetTrackTopicsOK() *GetTrackTopicsOK {
return &GetTrackTopicsOK{}
}
// GetTrackTopicsOK describes a response with status code 200, with default header values.
//
// Governed Track-to-Topic association response
type GetTrackTopicsOK struct {
Payload *members_models.TrackTopicResponse
}
// IsSuccess returns true when this get track topics o k response has a 2xx status code
func (o *GetTrackTopicsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get track topics o k response has a 3xx status code
func (o *GetTrackTopicsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics o k response has a 4xx status code
func (o *GetTrackTopicsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get track topics o k response has a 5xx status code
func (o *GetTrackTopicsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics o k response a status code equal to that given
func (o *GetTrackTopicsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get track topics o k response
func (o *GetTrackTopicsOK) Code() int {
return 200
}
func (o *GetTrackTopicsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %s", 200, payload)
}
func (o *GetTrackTopicsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %s", 200, payload)
}
func (o *GetTrackTopicsOK) GetPayload() *members_models.TrackTopicResponse {
return o.Payload
}
func (o *GetTrackTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackTopicResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewGetTrackTopicsUnauthorized creates a GetTrackTopicsUnauthorized with default headers values
func NewGetTrackTopicsUnauthorized() *GetTrackTopicsUnauthorized {
return &GetTrackTopicsUnauthorized{}
}
// GetTrackTopicsUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type GetTrackTopicsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track topics unauthorized response has a 2xx status code
func (o *GetTrackTopicsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics unauthorized response has a 3xx status code
func (o *GetTrackTopicsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics unauthorized response has a 4xx status code
func (o *GetTrackTopicsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get track topics unauthorized response has a 5xx status code
func (o *GetTrackTopicsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics unauthorized response a status code equal to that given
func (o *GetTrackTopicsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get track topics unauthorized response
func (o *GetTrackTopicsUnauthorized) Code() int {
return 401
}
func (o *GetTrackTopicsUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %s", 401, payload)
}
func (o *GetTrackTopicsUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %s", 401, payload)
}
func (o *GetTrackTopicsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackTopicsUnauthorized) 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
}
// NewGetTrackTopicsForbidden creates a GetTrackTopicsForbidden with default headers values
func NewGetTrackTopicsForbidden() *GetTrackTopicsForbidden {
return &GetTrackTopicsForbidden{}
}
// GetTrackTopicsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type GetTrackTopicsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get track topics forbidden response has a 2xx status code
func (o *GetTrackTopicsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics forbidden response has a 3xx status code
func (o *GetTrackTopicsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics forbidden response has a 4xx status code
func (o *GetTrackTopicsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get track topics forbidden response has a 5xx status code
func (o *GetTrackTopicsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics forbidden response a status code equal to that given
func (o *GetTrackTopicsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get track topics forbidden response
func (o *GetTrackTopicsForbidden) Code() int {
return 403
}
func (o *GetTrackTopicsForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %s", 403, payload)
}
func (o *GetTrackTopicsForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %s", 403, payload)
}
func (o *GetTrackTopicsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackTopicsForbidden) 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
}
// NewGetTrackTopicsNotFound creates a GetTrackTopicsNotFound with default headers values
func NewGetTrackTopicsNotFound() *GetTrackTopicsNotFound {
return &GetTrackTopicsNotFound{}
}
// GetTrackTopicsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type GetTrackTopicsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track topics not found response has a 2xx status code
func (o *GetTrackTopicsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics not found response has a 3xx status code
func (o *GetTrackTopicsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics not found response has a 4xx status code
func (o *GetTrackTopicsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get track topics not found response has a 5xx status code
func (o *GetTrackTopicsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics not found response a status code equal to that given
func (o *GetTrackTopicsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get track topics not found response
func (o *GetTrackTopicsNotFound) Code() int {
return 404
}
func (o *GetTrackTopicsNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %s", 404, payload)
}
func (o *GetTrackTopicsNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %s", 404, payload)
}
func (o *GetTrackTopicsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackTopicsNotFound) 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
}
// NewGetTrackTopicsInternalServerError creates a GetTrackTopicsInternalServerError with default headers values
func NewGetTrackTopicsInternalServerError() *GetTrackTopicsInternalServerError {
return &GetTrackTopicsInternalServerError{}
}
// GetTrackTopicsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type GetTrackTopicsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track topics internal server error response has a 2xx status code
func (o *GetTrackTopicsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics internal server error response has a 3xx status code
func (o *GetTrackTopicsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics internal server error response has a 4xx status code
func (o *GetTrackTopicsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get track topics internal server error response has a 5xx status code
func (o *GetTrackTopicsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get track topics internal server error response a status code equal to that given
func (o *GetTrackTopicsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get track topics internal server error response
func (o *GetTrackTopicsInternalServerError) Code() int {
return 500
}
func (o *GetTrackTopicsInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %s", 500, payload)
}
func (o *GetTrackTopicsInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %s", 500, payload)
}
func (o *GetTrackTopicsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackTopicsInternalServerError) 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
}

View File

@ -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_topics
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"
)
// NewPostTrackTopicsParams creates a new PostTrackTopicsParams 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 NewPostTrackTopicsParams() *PostTrackTopicsParams {
return NewPostTrackTopicsParamsWithTimeout(cr.DefaultTimeout)
}
// NewPostTrackTopicsParamsWithTimeout creates a new PostTrackTopicsParams object
// with the ability to set a timeout on a request.
func NewPostTrackTopicsParamsWithTimeout(timeout time.Duration) *PostTrackTopicsParams {
return &PostTrackTopicsParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewPostTrackTopicsParamsWithContext creates a new PostTrackTopicsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackTopicsParams].
func NewPostTrackTopicsParamsWithContext(ctx context.Context) *PostTrackTopicsParams {
return &PostTrackTopicsParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewPostTrackTopicsParamsWithHTTPClient creates a new PostTrackTopicsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTrackTopicsParamsWithHTTPClient(client *http.Client) *PostTrackTopicsParams {
return &PostTrackTopicsParams{
HTTPClient: client,
}
}
/*
PostTrackTopicsParams contains all the parameters to send to the API endpoint
for the post track topics operation.
Typically these are written to a http.Request.
*/
type PostTrackTopicsParams struct {
// TrackTopicRequest.
//
// Exactly one governed Track-to-Topic association
TrackTopicRequest *members_models.TrackTopicRequest
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the post track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackTopicsParams) WithDefaults() *PostTrackTopicsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackTopicsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post track topics params.
func (o *PostTrackTopicsParams) WithTimeout(timeout time.Duration) *PostTrackTopicsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post track topics params.
func (o *PostTrackTopicsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the post track topics params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackTopicsParams].
func (o *PostTrackTopicsParams) WithContext(ctx context.Context) *PostTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track topics params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackTopicsParams].
func (o *PostTrackTopicsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the post track topics params.
func (o *PostTrackTopicsParams) WithHTTPClient(client *http.Client) *PostTrackTopicsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post track topics params.
func (o *PostTrackTopicsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackTopicRequest adds the trackTopicRequest to the post track topics params.
func (o *PostTrackTopicsParams) WithTrackTopicRequest(trackTopicRequest *members_models.TrackTopicRequest) *PostTrackTopicsParams {
o.SetTrackTopicRequest(trackTopicRequest)
return o
}
// SetTrackTopicRequest adds the trackTopicRequest to the post track topics params.
func (o *PostTrackTopicsParams) SetTrackTopicRequest(trackTopicRequest *members_models.TrackTopicRequest) {
o.TrackTopicRequest = trackTopicRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
if o.TrackTopicRequest != nil {
if err := r.SetBodyParam(o.TrackTopicRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -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_topics
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"
)
// PostTrackTopicsReader is a Reader for the PostTrackTopics structure.
type PostTrackTopicsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTrackTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewPostTrackTopicsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTrackTopicsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTrackTopicsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTrackTopicsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTrackTopicsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /tracktopics] postTrackTopics", response, response.Code())
}
}
// NewPostTrackTopicsOK creates a PostTrackTopicsOK with default headers values
func NewPostTrackTopicsOK() *PostTrackTopicsOK {
return &PostTrackTopicsOK{}
}
// PostTrackTopicsOK describes a response with status code 200, with default header values.
//
// Governed Track-to-Topic association response
type PostTrackTopicsOK struct {
Payload *members_models.TrackTopicResponse
}
// IsSuccess returns true when this post track topics o k response has a 2xx status code
func (o *PostTrackTopicsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post track topics o k response has a 3xx status code
func (o *PostTrackTopicsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics o k response has a 4xx status code
func (o *PostTrackTopicsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post track topics o k response has a 5xx status code
func (o *PostTrackTopicsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics o k response a status code equal to that given
func (o *PostTrackTopicsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post track topics o k response
func (o *PostTrackTopicsOK) Code() int {
return 200
}
func (o *PostTrackTopicsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %s", 200, payload)
}
func (o *PostTrackTopicsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %s", 200, payload)
}
func (o *PostTrackTopicsOK) GetPayload() *members_models.TrackTopicResponse {
return o.Payload
}
func (o *PostTrackTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackTopicResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewPostTrackTopicsUnauthorized creates a PostTrackTopicsUnauthorized with default headers values
func NewPostTrackTopicsUnauthorized() *PostTrackTopicsUnauthorized {
return &PostTrackTopicsUnauthorized{}
}
// PostTrackTopicsUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type PostTrackTopicsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track topics unauthorized response has a 2xx status code
func (o *PostTrackTopicsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics unauthorized response has a 3xx status code
func (o *PostTrackTopicsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics unauthorized response has a 4xx status code
func (o *PostTrackTopicsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post track topics unauthorized response has a 5xx status code
func (o *PostTrackTopicsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics unauthorized response a status code equal to that given
func (o *PostTrackTopicsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post track topics unauthorized response
func (o *PostTrackTopicsUnauthorized) Code() int {
return 401
}
func (o *PostTrackTopicsUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %s", 401, payload)
}
func (o *PostTrackTopicsUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %s", 401, payload)
}
func (o *PostTrackTopicsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackTopicsUnauthorized) 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
}
// NewPostTrackTopicsForbidden creates a PostTrackTopicsForbidden with default headers values
func NewPostTrackTopicsForbidden() *PostTrackTopicsForbidden {
return &PostTrackTopicsForbidden{}
}
// PostTrackTopicsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PostTrackTopicsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post track topics forbidden response has a 2xx status code
func (o *PostTrackTopicsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics forbidden response has a 3xx status code
func (o *PostTrackTopicsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics forbidden response has a 4xx status code
func (o *PostTrackTopicsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post track topics forbidden response has a 5xx status code
func (o *PostTrackTopicsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics forbidden response a status code equal to that given
func (o *PostTrackTopicsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post track topics forbidden response
func (o *PostTrackTopicsForbidden) Code() int {
return 403
}
func (o *PostTrackTopicsForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %s", 403, payload)
}
func (o *PostTrackTopicsForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %s", 403, payload)
}
func (o *PostTrackTopicsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackTopicsForbidden) 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
}
// NewPostTrackTopicsUnprocessableEntity creates a PostTrackTopicsUnprocessableEntity with default headers values
func NewPostTrackTopicsUnprocessableEntity() *PostTrackTopicsUnprocessableEntity {
return &PostTrackTopicsUnprocessableEntity{}
}
// PostTrackTopicsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type PostTrackTopicsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track topics unprocessable entity response has a 2xx status code
func (o *PostTrackTopicsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics unprocessable entity response has a 3xx status code
func (o *PostTrackTopicsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics unprocessable entity response has a 4xx status code
func (o *PostTrackTopicsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post track topics unprocessable entity response has a 5xx status code
func (o *PostTrackTopicsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics unprocessable entity response a status code equal to that given
func (o *PostTrackTopicsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post track topics unprocessable entity response
func (o *PostTrackTopicsUnprocessableEntity) Code() int {
return 422
}
func (o *PostTrackTopicsUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %s", 422, payload)
}
func (o *PostTrackTopicsUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %s", 422, payload)
}
func (o *PostTrackTopicsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackTopicsUnprocessableEntity) 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
}
// NewPostTrackTopicsInternalServerError creates a PostTrackTopicsInternalServerError with default headers values
func NewPostTrackTopicsInternalServerError() *PostTrackTopicsInternalServerError {
return &PostTrackTopicsInternalServerError{}
}
// PostTrackTopicsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type PostTrackTopicsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track topics internal server error response has a 2xx status code
func (o *PostTrackTopicsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics internal server error response has a 3xx status code
func (o *PostTrackTopicsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics internal server error response has a 4xx status code
func (o *PostTrackTopicsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post track topics internal server error response has a 5xx status code
func (o *PostTrackTopicsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post track topics internal server error response a status code equal to that given
func (o *PostTrackTopicsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post track topics internal server error response
func (o *PostTrackTopicsInternalServerError) Code() int {
return 500
}
func (o *PostTrackTopicsInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %s", 500, payload)
}
func (o *PostTrackTopicsInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %s", 500, payload)
}
func (o *PostTrackTopicsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackTopicsInternalServerError) 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
}

View File

@ -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_topics
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 topics API client.
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new track topics 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 topics 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 topics 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 {
// GetTrackTopics get governed track to topic associations.
GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error)
// GetTrackTopicsContext get governed track to topic associations.
GetTrackTopicsContext(ctx context.Context, params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error)
// PostTrackTopics create a governed track to topic association.
PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error)
// PostTrackTopicsContext create a governed track to topic association.
PostTrackTopicsContext(ctx context.Context, params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error)
SetTransport(transport runtime.ContextualTransport)
}
// GetTrackTopics gets governed track to topic associations.
//
// Reads Track-to-Topic associations through the configured tenant's governed Track boundary and only when the referenced Research Topic exists. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-topic: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.GetTrackTopicsContext] instead.
func (a *Client) GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error) {
var ctx context.Context
if params.inner.ctx != nil {
ctx = params.inner.ctx
} else {
ctx = context.Background()
}
return a.GetTrackTopicsContext(ctx, params, authInfo, opts...)
}
// GetTrackTopicsContext gets governed track to topic associations.
//
// Reads Track-to-Topic associations through the configured tenant's governed Track boundary and only when the referenced Research Topic exists. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-topic:read and an active native member session..
//
// Do not use the deprecated [GetTrackTopicsParams.Context] with this method: it would be ignored.
func (a *Client) GetTrackTopicsContext(ctx context.Context, params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetTrackTopicsParams()
}
op := &runtime.ClientOperation{
ID: "getTrackTopics",
Method: "GET",
PathPattern: "/tracktopics",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTrackTopicsReader{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.(*GetTrackTopicsOK)
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 getTrackTopics: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// PostTrackTopics creates a governed track to topic association.
//
// Creates one immutable Track-to-Topic association after proving the Track belongs to the configured tenant and the referenced Research Topic exists. Requires members:track-topic:create and an active native Owner or Manager session. Identity, relationship keys, and audit fields are immutable; update and delete are 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.PostTrackTopicsContext] instead.
func (a *Client) PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error) {
var ctx context.Context
if params.inner.ctx != nil {
ctx = params.inner.ctx
} else {
ctx = context.Background()
}
return a.PostTrackTopicsContext(ctx, params, authInfo, opts...)
}
// PostTrackTopicsContext creates a governed track to topic association.
//
// Creates one immutable Track-to-Topic association after proving the Track belongs to the configured tenant and the referenced Research Topic exists. Requires members:track-topic:create and an active native Owner or Manager session. Identity, relationship keys, and audit fields are immutable; update and delete are unsupported..
//
// Do not use the deprecated [PostTrackTopicsParams.Context] with this method: it would be ignored.
func (a *Client) PostTrackTopicsContext(ctx context.Context, params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPostTrackTopicsParams()
}
op := &runtime.ClientOperation{
ID: "postTrackTopics",
Method: "POST",
PathPattern: "/tracktopics",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTrackTopicsReader{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.(*PostTrackTopicsOK)
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 postTrackTopics: 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 [TrackTopicsParams].
ctx context.Context
}

View File

@ -0,0 +1,334 @@
// 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_users
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"
)
// NewGetTrackUsersParams creates a new GetTrackUsersParams 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 NewGetTrackUsersParams() *GetTrackUsersParams {
return NewGetTrackUsersParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetTrackUsersParamsWithTimeout creates a new GetTrackUsersParams object
// with the ability to set a timeout on a request.
func NewGetTrackUsersParamsWithTimeout(timeout time.Duration) *GetTrackUsersParams {
return &GetTrackUsersParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewGetTrackUsersParamsWithContext creates a new GetTrackUsersParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackUsersParams].
func NewGetTrackUsersParamsWithContext(ctx context.Context) *GetTrackUsersParams {
return &GetTrackUsersParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewGetTrackUsersParamsWithHTTPClient creates a new GetTrackUsersParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTrackUsersParamsWithHTTPClient(client *http.Client) *GetTrackUsersParams {
return &GetTrackUsersParams{
HTTPClient: client,
}
}
/*
GetTrackUsersParams contains all the parameters to send to the API endpoint
for the get track users operation.
Typically these are written to a http.Request.
*/
type GetTrackUsersParams struct {
// 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
// Role.
Role *string
// TrackID.
TrackID *string
// UserID.
UserID *string
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the get track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackUsersParams) WithDefaults() *GetTrackUsersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackUsersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get track users params.
func (o *GetTrackUsersParams) WithTimeout(timeout time.Duration) *GetTrackUsersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get track users params.
func (o *GetTrackUsersParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the get track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackUsersParams].
func (o *GetTrackUsersParams) WithContext(ctx context.Context) *GetTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [GetTrackUsersParams].
func (o *GetTrackUsersParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the get track users params.
func (o *GetTrackUsersParams) WithHTTPClient(client *http.Client) *GetTrackUsersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get track users params.
func (o *GetTrackUsersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get track users params.
func (o *GetTrackUsersParams) WithID(id *string) *GetTrackUsersParams {
o.SetID(id)
return o
}
// SetID adds the id to the get track users params.
func (o *GetTrackUsersParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get track users params.
func (o *GetTrackUsersParams) WithLimit(limit *int64) *GetTrackUsersParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get track users params.
func (o *GetTrackUsersParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get track users params.
func (o *GetTrackUsersParams) WithOffset(offset *int64) *GetTrackUsersParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get track users params.
func (o *GetTrackUsersParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WithRole adds the role to the get track users params.
func (o *GetTrackUsersParams) WithRole(role *string) *GetTrackUsersParams {
o.SetRole(role)
return o
}
// SetRole adds the role to the get track users params.
func (o *GetTrackUsersParams) SetRole(role *string) {
o.Role = role
}
// WithTrackID adds the trackID to the get track users params.
func (o *GetTrackUsersParams) WithTrackID(trackID *string) *GetTrackUsersParams {
o.SetTrackID(trackID)
return o
}
// SetTrackID adds the trackId to the get track users params.
func (o *GetTrackUsersParams) SetTrackID(trackID *string) {
o.TrackID = trackID
}
// WithUserID adds the userID to the get track users params.
func (o *GetTrackUsersParams) WithUserID(userID *string) *GetTrackUsersParams {
o.SetUserID(userID)
return o
}
// SetUserID adds the userId to the get track users params.
func (o *GetTrackUsersParams) SetUserID(userID *string) {
o.UserID = userID
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
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.Role != nil {
// query param role
var qrRole string
if o.Role != nil {
qrRole = *o.Role
}
qRole := qrRole
if qRole != "" {
if err := r.SetQueryParam("role", qRole); 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 o.UserID != nil {
// query param userId
var qrUserID string
if o.UserID != nil {
qrUserID = *o.UserID
}
qUserID := qrUserID
if qUserID != "" {
if err := r.SetQueryParam("userId", qUserID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -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_users
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"
)
// GetTrackUsersReader is a Reader for the GetTrackUsers structure.
type GetTrackUsersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTrackUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewGetTrackUsersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTrackUsersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTrackUsersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTrackUsersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTrackUsersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /trackusers] getTrackUsers", response, response.Code())
}
}
// NewGetTrackUsersOK creates a GetTrackUsersOK with default headers values
func NewGetTrackUsersOK() *GetTrackUsersOK {
return &GetTrackUsersOK{}
}
// GetTrackUsersOK describes a response with status code 200, with default header values.
//
// Governed Track-to-User association response
type GetTrackUsersOK struct {
Payload *members_models.TrackUserResponse
}
// IsSuccess returns true when this get track users o k response has a 2xx status code
func (o *GetTrackUsersOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get track users o k response has a 3xx status code
func (o *GetTrackUsersOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users o k response has a 4xx status code
func (o *GetTrackUsersOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get track users o k response has a 5xx status code
func (o *GetTrackUsersOK) IsServerError() bool {
return false
}
// IsCode returns true when this get track users o k response a status code equal to that given
func (o *GetTrackUsersOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get track users o k response
func (o *GetTrackUsersOK) Code() int {
return 200
}
func (o *GetTrackUsersOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %s", 200, payload)
}
func (o *GetTrackUsersOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %s", 200, payload)
}
func (o *GetTrackUsersOK) GetPayload() *members_models.TrackUserResponse {
return o.Payload
}
func (o *GetTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewGetTrackUsersUnauthorized creates a GetTrackUsersUnauthorized with default headers values
func NewGetTrackUsersUnauthorized() *GetTrackUsersUnauthorized {
return &GetTrackUsersUnauthorized{}
}
// GetTrackUsersUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type GetTrackUsersUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track users unauthorized response has a 2xx status code
func (o *GetTrackUsersUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users unauthorized response has a 3xx status code
func (o *GetTrackUsersUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users unauthorized response has a 4xx status code
func (o *GetTrackUsersUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get track users unauthorized response has a 5xx status code
func (o *GetTrackUsersUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get track users unauthorized response a status code equal to that given
func (o *GetTrackUsersUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get track users unauthorized response
func (o *GetTrackUsersUnauthorized) Code() int {
return 401
}
func (o *GetTrackUsersUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %s", 401, payload)
}
func (o *GetTrackUsersUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %s", 401, payload)
}
func (o *GetTrackUsersUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackUsersUnauthorized) 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
}
// NewGetTrackUsersForbidden creates a GetTrackUsersForbidden with default headers values
func NewGetTrackUsersForbidden() *GetTrackUsersForbidden {
return &GetTrackUsersForbidden{}
}
// GetTrackUsersForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type GetTrackUsersForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get track users forbidden response has a 2xx status code
func (o *GetTrackUsersForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users forbidden response has a 3xx status code
func (o *GetTrackUsersForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users forbidden response has a 4xx status code
func (o *GetTrackUsersForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get track users forbidden response has a 5xx status code
func (o *GetTrackUsersForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get track users forbidden response a status code equal to that given
func (o *GetTrackUsersForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get track users forbidden response
func (o *GetTrackUsersForbidden) Code() int {
return 403
}
func (o *GetTrackUsersForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %s", 403, payload)
}
func (o *GetTrackUsersForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %s", 403, payload)
}
func (o *GetTrackUsersForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackUsersForbidden) 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
}
// NewGetTrackUsersNotFound creates a GetTrackUsersNotFound with default headers values
func NewGetTrackUsersNotFound() *GetTrackUsersNotFound {
return &GetTrackUsersNotFound{}
}
// GetTrackUsersNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type GetTrackUsersNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track users not found response has a 2xx status code
func (o *GetTrackUsersNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users not found response has a 3xx status code
func (o *GetTrackUsersNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users not found response has a 4xx status code
func (o *GetTrackUsersNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get track users not found response has a 5xx status code
func (o *GetTrackUsersNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get track users not found response a status code equal to that given
func (o *GetTrackUsersNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get track users not found response
func (o *GetTrackUsersNotFound) Code() int {
return 404
}
func (o *GetTrackUsersNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %s", 404, payload)
}
func (o *GetTrackUsersNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %s", 404, payload)
}
func (o *GetTrackUsersNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackUsersNotFound) 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
}
// NewGetTrackUsersInternalServerError creates a GetTrackUsersInternalServerError with default headers values
func NewGetTrackUsersInternalServerError() *GetTrackUsersInternalServerError {
return &GetTrackUsersInternalServerError{}
}
// GetTrackUsersInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type GetTrackUsersInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track users internal server error response has a 2xx status code
func (o *GetTrackUsersInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users internal server error response has a 3xx status code
func (o *GetTrackUsersInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users internal server error response has a 4xx status code
func (o *GetTrackUsersInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get track users internal server error response has a 5xx status code
func (o *GetTrackUsersInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get track users internal server error response a status code equal to that given
func (o *GetTrackUsersInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get track users internal server error response
func (o *GetTrackUsersInternalServerError) Code() int {
return 500
}
func (o *GetTrackUsersInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %s", 500, payload)
}
func (o *GetTrackUsersInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %s", 500, payload)
}
func (o *GetTrackUsersInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackUsersInternalServerError) 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
}

View File

@ -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_users
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"
)
// NewPostTrackUsersParams creates a new PostTrackUsersParams 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 NewPostTrackUsersParams() *PostTrackUsersParams {
return NewPostTrackUsersParamsWithTimeout(cr.DefaultTimeout)
}
// NewPostTrackUsersParamsWithTimeout creates a new PostTrackUsersParams object
// with the ability to set a timeout on a request.
func NewPostTrackUsersParamsWithTimeout(timeout time.Duration) *PostTrackUsersParams {
return &PostTrackUsersParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewPostTrackUsersParamsWithContext creates a new PostTrackUsersParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackUsersParams].
func NewPostTrackUsersParamsWithContext(ctx context.Context) *PostTrackUsersParams {
return &PostTrackUsersParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewPostTrackUsersParamsWithHTTPClient creates a new PostTrackUsersParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTrackUsersParamsWithHTTPClient(client *http.Client) *PostTrackUsersParams {
return &PostTrackUsersParams{
HTTPClient: client,
}
}
/*
PostTrackUsersParams contains all the parameters to send to the API endpoint
for the post track users operation.
Typically these are written to a http.Request.
*/
type PostTrackUsersParams struct {
// TrackUserRequest.
//
// Exactly one governed Track-to-User association
TrackUserRequest *members_models.TrackUserRequest
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the post track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackUsersParams) WithDefaults() *PostTrackUsersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackUsersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post track users params.
func (o *PostTrackUsersParams) WithTimeout(timeout time.Duration) *PostTrackUsersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post track users params.
func (o *PostTrackUsersParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the post track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackUsersParams].
func (o *PostTrackUsersParams) WithContext(ctx context.Context) *PostTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [PostTrackUsersParams].
func (o *PostTrackUsersParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the post track users params.
func (o *PostTrackUsersParams) WithHTTPClient(client *http.Client) *PostTrackUsersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post track users params.
func (o *PostTrackUsersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackUserRequest adds the trackUserRequest to the post track users params.
func (o *PostTrackUsersParams) WithTrackUserRequest(trackUserRequest *members_models.TrackUserRequest) *PostTrackUsersParams {
o.SetTrackUserRequest(trackUserRequest)
return o
}
// SetTrackUserRequest adds the trackUserRequest to the post track users params.
func (o *PostTrackUsersParams) SetTrackUserRequest(trackUserRequest *members_models.TrackUserRequest) {
o.TrackUserRequest = trackUserRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PostTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
if o.TrackUserRequest != nil {
if err := r.SetBodyParam(o.TrackUserRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -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_users
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"
)
// PostTrackUsersReader is a Reader for the PostTrackUsers structure.
type PostTrackUsersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTrackUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewPostTrackUsersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTrackUsersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTrackUsersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTrackUsersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTrackUsersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /trackusers] postTrackUsers", response, response.Code())
}
}
// NewPostTrackUsersOK creates a PostTrackUsersOK with default headers values
func NewPostTrackUsersOK() *PostTrackUsersOK {
return &PostTrackUsersOK{}
}
// PostTrackUsersOK describes a response with status code 200, with default header values.
//
// Governed Track-to-User association response
type PostTrackUsersOK struct {
Payload *members_models.TrackUserResponse
}
// IsSuccess returns true when this post track users o k response has a 2xx status code
func (o *PostTrackUsersOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post track users o k response has a 3xx status code
func (o *PostTrackUsersOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users o k response has a 4xx status code
func (o *PostTrackUsersOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post track users o k response has a 5xx status code
func (o *PostTrackUsersOK) IsServerError() bool {
return false
}
// IsCode returns true when this post track users o k response a status code equal to that given
func (o *PostTrackUsersOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post track users o k response
func (o *PostTrackUsersOK) Code() int {
return 200
}
func (o *PostTrackUsersOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %s", 200, payload)
}
func (o *PostTrackUsersOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %s", 200, payload)
}
func (o *PostTrackUsersOK) GetPayload() *members_models.TrackUserResponse {
return o.Payload
}
func (o *PostTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewPostTrackUsersUnauthorized creates a PostTrackUsersUnauthorized with default headers values
func NewPostTrackUsersUnauthorized() *PostTrackUsersUnauthorized {
return &PostTrackUsersUnauthorized{}
}
// PostTrackUsersUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type PostTrackUsersUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track users unauthorized response has a 2xx status code
func (o *PostTrackUsersUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users unauthorized response has a 3xx status code
func (o *PostTrackUsersUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users unauthorized response has a 4xx status code
func (o *PostTrackUsersUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post track users unauthorized response has a 5xx status code
func (o *PostTrackUsersUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post track users unauthorized response a status code equal to that given
func (o *PostTrackUsersUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post track users unauthorized response
func (o *PostTrackUsersUnauthorized) Code() int {
return 401
}
func (o *PostTrackUsersUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %s", 401, payload)
}
func (o *PostTrackUsersUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %s", 401, payload)
}
func (o *PostTrackUsersUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackUsersUnauthorized) 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
}
// NewPostTrackUsersForbidden creates a PostTrackUsersForbidden with default headers values
func NewPostTrackUsersForbidden() *PostTrackUsersForbidden {
return &PostTrackUsersForbidden{}
}
// PostTrackUsersForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PostTrackUsersForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post track users forbidden response has a 2xx status code
func (o *PostTrackUsersForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users forbidden response has a 3xx status code
func (o *PostTrackUsersForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users forbidden response has a 4xx status code
func (o *PostTrackUsersForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post track users forbidden response has a 5xx status code
func (o *PostTrackUsersForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post track users forbidden response a status code equal to that given
func (o *PostTrackUsersForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post track users forbidden response
func (o *PostTrackUsersForbidden) Code() int {
return 403
}
func (o *PostTrackUsersForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %s", 403, payload)
}
func (o *PostTrackUsersForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %s", 403, payload)
}
func (o *PostTrackUsersForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackUsersForbidden) 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
}
// NewPostTrackUsersUnprocessableEntity creates a PostTrackUsersUnprocessableEntity with default headers values
func NewPostTrackUsersUnprocessableEntity() *PostTrackUsersUnprocessableEntity {
return &PostTrackUsersUnprocessableEntity{}
}
// PostTrackUsersUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type PostTrackUsersUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track users unprocessable entity response has a 2xx status code
func (o *PostTrackUsersUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users unprocessable entity response has a 3xx status code
func (o *PostTrackUsersUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users unprocessable entity response has a 4xx status code
func (o *PostTrackUsersUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post track users unprocessable entity response has a 5xx status code
func (o *PostTrackUsersUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post track users unprocessable entity response a status code equal to that given
func (o *PostTrackUsersUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post track users unprocessable entity response
func (o *PostTrackUsersUnprocessableEntity) Code() int {
return 422
}
func (o *PostTrackUsersUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %s", 422, payload)
}
func (o *PostTrackUsersUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %s", 422, payload)
}
func (o *PostTrackUsersUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackUsersUnprocessableEntity) 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
}
// NewPostTrackUsersInternalServerError creates a PostTrackUsersInternalServerError with default headers values
func NewPostTrackUsersInternalServerError() *PostTrackUsersInternalServerError {
return &PostTrackUsersInternalServerError{}
}
// PostTrackUsersInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type PostTrackUsersInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track users internal server error response has a 2xx status code
func (o *PostTrackUsersInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users internal server error response has a 3xx status code
func (o *PostTrackUsersInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users internal server error response has a 4xx status code
func (o *PostTrackUsersInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post track users internal server error response has a 5xx status code
func (o *PostTrackUsersInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post track users internal server error response a status code equal to that given
func (o *PostTrackUsersInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post track users internal server error response
func (o *PostTrackUsersInternalServerError) Code() int {
return 500
}
func (o *PostTrackUsersInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %s", 500, payload)
}
func (o *PostTrackUsersInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %s", 500, payload)
}
func (o *PostTrackUsersInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackUsersInternalServerError) 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
}

View File

@ -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_users
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"
)
// NewPutTrackUsersParams creates a new PutTrackUsersParams 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 NewPutTrackUsersParams() *PutTrackUsersParams {
return NewPutTrackUsersParamsWithTimeout(cr.DefaultTimeout)
}
// NewPutTrackUsersParamsWithTimeout creates a new PutTrackUsersParams object
// with the ability to set a timeout on a request.
func NewPutTrackUsersParamsWithTimeout(timeout time.Duration) *PutTrackUsersParams {
return &PutTrackUsersParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewPutTrackUsersParamsWithContext creates a new PutTrackUsersParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PutTrackUsersParams].
func NewPutTrackUsersParamsWithContext(ctx context.Context) *PutTrackUsersParams {
return &PutTrackUsersParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewPutTrackUsersParamsWithHTTPClient creates a new PutTrackUsersParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTrackUsersParamsWithHTTPClient(client *http.Client) *PutTrackUsersParams {
return &PutTrackUsersParams{
HTTPClient: client,
}
}
/*
PutTrackUsersParams contains all the parameters to send to the API endpoint
for the put track users operation.
Typically these are written to a http.Request.
*/
type PutTrackUsersParams struct {
// TrackUserRequest.
//
// Exactly one governed Track-to-User association
TrackUserRequest *members_models.TrackUserRequest
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the put track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackUsersParams) WithDefaults() *PutTrackUsersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put track users params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackUsersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put track users params.
func (o *PutTrackUsersParams) WithTimeout(timeout time.Duration) *PutTrackUsersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put track users params.
func (o *PutTrackUsersParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the put track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutTrackUsersParams].
func (o *PutTrackUsersParams) WithContext(ctx context.Context) *PutTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put track users params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutTrackUsersParams].
func (o *PutTrackUsersParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the put track users params.
func (o *PutTrackUsersParams) WithHTTPClient(client *http.Client) *PutTrackUsersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put track users params.
func (o *PutTrackUsersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackUserRequest adds the trackUserRequest to the put track users params.
func (o *PutTrackUsersParams) WithTrackUserRequest(trackUserRequest *members_models.TrackUserRequest) *PutTrackUsersParams {
o.SetTrackUserRequest(trackUserRequest)
return o
}
// SetTrackUserRequest adds the trackUserRequest to the put track users params.
func (o *PutTrackUsersParams) SetTrackUserRequest(trackUserRequest *members_models.TrackUserRequest) {
o.TrackUserRequest = trackUserRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *PutTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
if o.TrackUserRequest != nil {
if err := r.SetBodyParam(o.TrackUserRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,558 @@
// 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_users
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"
)
// PutTrackUsersReader is a Reader for the PutTrackUsers structure.
type PutTrackUsersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutTrackUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewPutTrackUsersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutTrackUsersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutTrackUsersForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutTrackUsersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 409:
result := NewPutTrackUsersConflict()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutTrackUsersUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutTrackUsersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /trackusers] putTrackUsers", response, response.Code())
}
}
// NewPutTrackUsersOK creates a PutTrackUsersOK with default headers values
func NewPutTrackUsersOK() *PutTrackUsersOK {
return &PutTrackUsersOK{}
}
// PutTrackUsersOK describes a response with status code 200, with default header values.
//
// Governed Track-to-User association response
type PutTrackUsersOK struct {
Payload *members_models.TrackUserResponse
}
// IsSuccess returns true when this put track users o k response has a 2xx status code
func (o *PutTrackUsersOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put track users o k response has a 3xx status code
func (o *PutTrackUsersOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users o k response has a 4xx status code
func (o *PutTrackUsersOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put track users o k response has a 5xx status code
func (o *PutTrackUsersOK) IsServerError() bool {
return false
}
// IsCode returns true when this put track users o k response a status code equal to that given
func (o *PutTrackUsersOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put track users o k response
func (o *PutTrackUsersOK) Code() int {
return 200
}
func (o *PutTrackUsersOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersOK %s", 200, payload)
}
func (o *PutTrackUsersOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersOK %s", 200, payload)
}
func (o *PutTrackUsersOK) GetPayload() *members_models.TrackUserResponse {
return o.Payload
}
func (o *PutTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewPutTrackUsersUnauthorized creates a PutTrackUsersUnauthorized with default headers values
func NewPutTrackUsersUnauthorized() *PutTrackUsersUnauthorized {
return &PutTrackUsersUnauthorized{}
}
// PutTrackUsersUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type PutTrackUsersUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track users unauthorized response has a 2xx status code
func (o *PutTrackUsersUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users unauthorized response has a 3xx status code
func (o *PutTrackUsersUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users unauthorized response has a 4xx status code
func (o *PutTrackUsersUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put track users unauthorized response has a 5xx status code
func (o *PutTrackUsersUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put track users unauthorized response a status code equal to that given
func (o *PutTrackUsersUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put track users unauthorized response
func (o *PutTrackUsersUnauthorized) Code() int {
return 401
}
func (o *PutTrackUsersUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnauthorized %s", 401, payload)
}
func (o *PutTrackUsersUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnauthorized %s", 401, payload)
}
func (o *PutTrackUsersUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersUnauthorized) 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
}
// NewPutTrackUsersForbidden creates a PutTrackUsersForbidden with default headers values
func NewPutTrackUsersForbidden() *PutTrackUsersForbidden {
return &PutTrackUsersForbidden{}
}
// PutTrackUsersForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PutTrackUsersForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this put track users forbidden response has a 2xx status code
func (o *PutTrackUsersForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users forbidden response has a 3xx status code
func (o *PutTrackUsersForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users forbidden response has a 4xx status code
func (o *PutTrackUsersForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put track users forbidden response has a 5xx status code
func (o *PutTrackUsersForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put track users forbidden response a status code equal to that given
func (o *PutTrackUsersForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put track users forbidden response
func (o *PutTrackUsersForbidden) Code() int {
return 403
}
func (o *PutTrackUsersForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersForbidden %s", 403, payload)
}
func (o *PutTrackUsersForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersForbidden %s", 403, payload)
}
func (o *PutTrackUsersForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersForbidden) 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
}
// NewPutTrackUsersNotFound creates a PutTrackUsersNotFound with default headers values
func NewPutTrackUsersNotFound() *PutTrackUsersNotFound {
return &PutTrackUsersNotFound{}
}
// PutTrackUsersNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type PutTrackUsersNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track users not found response has a 2xx status code
func (o *PutTrackUsersNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users not found response has a 3xx status code
func (o *PutTrackUsersNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users not found response has a 4xx status code
func (o *PutTrackUsersNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put track users not found response has a 5xx status code
func (o *PutTrackUsersNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put track users not found response a status code equal to that given
func (o *PutTrackUsersNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put track users not found response
func (o *PutTrackUsersNotFound) Code() int {
return 404
}
func (o *PutTrackUsersNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersNotFound %s", 404, payload)
}
func (o *PutTrackUsersNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersNotFound %s", 404, payload)
}
func (o *PutTrackUsersNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersNotFound) 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
}
// NewPutTrackUsersConflict creates a PutTrackUsersConflict with default headers values
func NewPutTrackUsersConflict() *PutTrackUsersConflict {
return &PutTrackUsersConflict{}
}
// PutTrackUsersConflict describes a response with status code 409, with default header values.
//
// The supplied LastModifiedDate is stale; reload the record before retrying.
type PutTrackUsersConflict struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track users conflict response has a 2xx status code
func (o *PutTrackUsersConflict) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users conflict response has a 3xx status code
func (o *PutTrackUsersConflict) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users conflict response has a 4xx status code
func (o *PutTrackUsersConflict) IsClientError() bool {
return true
}
// IsServerError returns true when this put track users conflict response has a 5xx status code
func (o *PutTrackUsersConflict) IsServerError() bool {
return false
}
// IsCode returns true when this put track users conflict response a status code equal to that given
func (o *PutTrackUsersConflict) IsCode(code int) bool {
return code == 409
}
// Code gets the status code for the put track users conflict response
func (o *PutTrackUsersConflict) Code() int {
return 409
}
func (o *PutTrackUsersConflict) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersConflict %s", 409, payload)
}
func (o *PutTrackUsersConflict) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersConflict %s", 409, payload)
}
func (o *PutTrackUsersConflict) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersConflict) 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
}
// NewPutTrackUsersUnprocessableEntity creates a PutTrackUsersUnprocessableEntity with default headers values
func NewPutTrackUsersUnprocessableEntity() *PutTrackUsersUnprocessableEntity {
return &PutTrackUsersUnprocessableEntity{}
}
// PutTrackUsersUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type PutTrackUsersUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track users unprocessable entity response has a 2xx status code
func (o *PutTrackUsersUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users unprocessable entity response has a 3xx status code
func (o *PutTrackUsersUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users unprocessable entity response has a 4xx status code
func (o *PutTrackUsersUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put track users unprocessable entity response has a 5xx status code
func (o *PutTrackUsersUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put track users unprocessable entity response a status code equal to that given
func (o *PutTrackUsersUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put track users unprocessable entity response
func (o *PutTrackUsersUnprocessableEntity) Code() int {
return 422
}
func (o *PutTrackUsersUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnprocessableEntity %s", 422, payload)
}
func (o *PutTrackUsersUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnprocessableEntity %s", 422, payload)
}
func (o *PutTrackUsersUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersUnprocessableEntity) 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
}
// NewPutTrackUsersInternalServerError creates a PutTrackUsersInternalServerError with default headers values
func NewPutTrackUsersInternalServerError() *PutTrackUsersInternalServerError {
return &PutTrackUsersInternalServerError{}
}
// PutTrackUsersInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type PutTrackUsersInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track users internal server error response has a 2xx status code
func (o *PutTrackUsersInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track users internal server error response has a 3xx status code
func (o *PutTrackUsersInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track users internal server error response has a 4xx status code
func (o *PutTrackUsersInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put track users internal server error response has a 5xx status code
func (o *PutTrackUsersInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put track users internal server error response a status code equal to that given
func (o *PutTrackUsersInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put track users internal server error response
func (o *PutTrackUsersInternalServerError) Code() int {
return 500
}
func (o *PutTrackUsersInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersInternalServerError %s", 500, payload)
}
func (o *PutTrackUsersInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersInternalServerError %s", 500, payload)
}
func (o *PutTrackUsersInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackUsersInternalServerError) 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
}

View File

@ -0,0 +1,296 @@
// 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_users
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 users API client.
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new track users 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 users 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 users 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 {
// GetTrackUsers get governed track to user associations.
GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error)
// GetTrackUsersContext get governed track to user associations.
GetTrackUsersContext(ctx context.Context, params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error)
// PostTrackUsers create a governed track to user association.
PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error)
// PostTrackUsersContext create a governed track to user association.
PostTrackUsersContext(ctx context.Context, params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error)
// PutTrackUsers update a governed track to user role.
PutTrackUsers(params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error)
// PutTrackUsersContext update a governed track to user role.
PutTrackUsersContext(ctx context.Context, params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error)
SetTransport(transport runtime.ContextualTransport)
}
// GetTrackUsers gets governed track to user associations.
//
// Reads Track-to-User associations through the configured tenant's governed Track boundary and only for active referenced Users with an active membership in that tenant and an allowed role. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-user: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.GetTrackUsersContext] instead.
func (a *Client) GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error) {
var ctx context.Context
if params.inner.ctx != nil {
ctx = params.inner.ctx
} else {
ctx = context.Background()
}
return a.GetTrackUsersContext(ctx, params, authInfo, opts...)
}
// GetTrackUsersContext gets governed track to user associations.
//
// Reads Track-to-User associations through the configured tenant's governed Track boundary and only for active referenced Users with an active membership in that tenant and an allowed role. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-user:read and an active native member session..
//
// Do not use the deprecated [GetTrackUsersParams.Context] with this method: it would be ignored.
func (a *Client) GetTrackUsersContext(ctx context.Context, params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetTrackUsersParams()
}
op := &runtime.ClientOperation{
ID: "getTrackUsers",
Method: "GET",
PathPattern: "/trackusers",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTrackUsersReader{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.(*GetTrackUsersOK)
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 getTrackUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// PostTrackUsers creates a governed track to user association.
//
// Creates one Track-to-User association after proving the Track and active referenced User belong to the configured tenant and the role is Attendee, Moderator, or Presenter. Requires members:track-user:create and an active native Owner or Manager session. Identity, TrackID, UserID, and audit fields are server-owned or immutable..
//
// 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.PostTrackUsersContext] instead.
func (a *Client) PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error) {
var ctx context.Context
if params.inner.ctx != nil {
ctx = params.inner.ctx
} else {
ctx = context.Background()
}
return a.PostTrackUsersContext(ctx, params, authInfo, opts...)
}
// PostTrackUsersContext creates a governed track to user association.
//
// Creates one Track-to-User association after proving the Track and active referenced User belong to the configured tenant and the role is Attendee, Moderator, or Presenter. Requires members:track-user:create and an active native Owner or Manager session. Identity, TrackID, UserID, and audit fields are server-owned or immutable..
//
// Do not use the deprecated [PostTrackUsersParams.Context] with this method: it would be ignored.
func (a *Client) PostTrackUsersContext(ctx context.Context, params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPostTrackUsersParams()
}
op := &runtime.ClientOperation{
ID: "postTrackUsers",
Method: "POST",
PathPattern: "/trackusers",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTrackUsersReader{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.(*PostTrackUsersOK)
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 postTrackUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// PutTrackUsers updates a governed track to user role.
//
// CAS-updates only the allowed role of one bounded Track-to-User association. Requires members:track-user:update, an active native Owner or Manager session, and the current LastModifiedDate. TrackID, UserID, identity, and creator fields remain immutable. Delete is unsupported because recovery-safe removal semantics are not governed..
//
// 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.PutTrackUsersContext] instead.
func (a *Client) PutTrackUsers(params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error) {
var ctx context.Context
if params.inner.ctx != nil {
ctx = params.inner.ctx
} else {
ctx = context.Background()
}
return a.PutTrackUsersContext(ctx, params, authInfo, opts...)
}
// PutTrackUsersContext updates a governed track to user role.
//
// CAS-updates only the allowed role of one bounded Track-to-User association. Requires members:track-user:update, an active native Owner or Manager session, and the current LastModifiedDate. TrackID, UserID, identity, and creator fields remain immutable. Delete is unsupported because recovery-safe removal semantics are not governed..
//
// Do not use the deprecated [PutTrackUsersParams.Context] with this method: it would be ignored.
func (a *Client) PutTrackUsersContext(ctx context.Context, params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPutTrackUsersParams()
}
op := &runtime.ClientOperation{
ID: "putTrackUsers",
Method: "PUT",
PathPattern: "/trackusers",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutTrackUsersReader{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.(*PutTrackUsersOK)
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 putTrackUsers: 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 [TrackUsersParams].
ctx context.Context
}

View File

@ -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"
)
// TrackTopic An immutable governed association between a tenant-bounded Track and an existing Research Topic. Relationship identity and audit fields are immutable after creation.
//
// swagger:model TrackTopic
type TrackTopic struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// topic ID
TopicID string `json:"TopicID,omitempty"`
// track ID
TrackID string `json:"TrackID,omitempty"`
}
// Validate validates this track topic
func (m *TrackTopic) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this track topic based on context it is used
func (m *TrackTopic) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TrackTopic) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopic) UnmarshalBinary(b []byte) error {
var res TrackTopic
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -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"
)
// TrackTopicRequest Exactly one Track-to-Topic association
//
// swagger:model TrackTopicRequest
type TrackTopicRequest struct {
// data
// Max Items: 1
// Min Items: 1
Data []*TrackTopic `json:"Data"`
}
// Validate validates this track topic request
func (m *TrackTopicRequest) 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 *TrackTopicRequest) 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 topic request based on the context it is used
func (m *TrackTopicRequest) 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 *TrackTopicRequest) 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 *TrackTopicRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicRequest) UnmarshalBinary(b []byte) error {
var res TrackTopicRequest
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -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"
)
// TrackTopicResponse An array of governed Track-to-Topic associations
//
// swagger:model TrackTopicResponse
type TrackTopicResponse struct {
// data
Data []*TrackTopic `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track topic response
func (m *TrackTopicResponse) 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 *TrackTopicResponse) 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 *TrackTopicResponse) 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 topic response based on the context it is used
func (m *TrackTopicResponse) 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 *TrackTopicResponse) 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 *TrackTopicResponse) 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 *TrackTopicResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicResponse) UnmarshalBinary(b []byte) error {
var res TrackTopicResponse
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,131 @@
// 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"
"encoding/json"
"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"
)
// TrackUser A governed association between a tenant-bounded Track and an active User in the same configured tenant. TrackID and UserID are immutable; only Role may be CAS-updated.
//
// swagger:model TrackUser
type TrackUser struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// role
// Enum: ["Attendee","Moderator","Presenter"]
Role string `json:"Role,omitempty"`
// track ID
TrackID string `json:"TrackID,omitempty"`
// user ID
UserID string `json:"UserID,omitempty"`
}
// Validate validates this track user
func (m *TrackUser) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateRole(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var trackUserTypeRolePropEnum []any
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Attendee","Moderator","Presenter"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
trackUserTypeRolePropEnum = append(trackUserTypeRolePropEnum, v)
}
}
const (
// TrackUserRoleAttendee captures enum value "Attendee"
TrackUserRoleAttendee string = "Attendee"
// TrackUserRoleModerator captures enum value "Moderator"
TrackUserRoleModerator string = "Moderator"
// TrackUserRolePresenter captures enum value "Presenter"
TrackUserRolePresenter string = "Presenter"
)
// prop value enum
func (m *TrackUser) validateRoleEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, trackUserTypeRolePropEnum, true); err != nil {
return err
}
return nil
}
func (m *TrackUser) validateRole(formats strfmt.Registry) error {
if typeutils.IsZero(m.Role) { // not required
return nil
}
// value enum
if err := m.validateRoleEnum("Role", "body", m.Role); err != nil {
return err
}
return nil
}
// ContextValidate validates this track user based on context it is used
func (m *TrackUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TrackUser) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUser) UnmarshalBinary(b []byte) error {
var res TrackUser
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -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"
)
// TrackUserRequest Exactly one Track-to-User association or role-only CAS update
//
// swagger:model TrackUserRequest
type TrackUserRequest struct {
// data
// Max Items: 1
// Min Items: 1
Data []*TrackUser `json:"Data"`
}
// Validate validates this track user request
func (m *TrackUserRequest) 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 *TrackUserRequest) 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 user request based on the context it is used
func (m *TrackUserRequest) 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 *TrackUserRequest) 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 *TrackUserRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserRequest) UnmarshalBinary(b []byte) error {
var res TrackUserRequest
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -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"
)
// TrackUserResponse An array of governed Track-to-User associations
//
// swagger:model TrackUserResponse
type TrackUserResponse struct {
// data
Data []*TrackUser `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track user response
func (m *TrackUserResponse) 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 *TrackUserResponse) 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 *TrackUserResponse) 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 user response based on the context it is used
func (m *TrackUserResponse) 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 *TrackUserResponse) 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 *TrackUserResponse) 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 *TrackUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserResponse) UnmarshalBinary(b []byte) error {
var res TrackUserResponse
if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,33 @@
# Members Track relationship clients
Date: 2026-07-24
Provider source: Members draft PR
[#40](https://github.com/vernonkeenan/members/pull/40), commit `6b48a56`.
The generated Members client exposes:
- `GET /tracktopics` and `POST /tracktopics` for tenant-bounded,
immutable Track-to-Topic associations.
- `GET /trackusers` and `POST /trackusers` for tenant-bounded
Track-to-User assignments.
- `PUT /trackusers` for role-only optimistic updates.
The provider requires compound machine API-key plus native member-session
authentication and an exact operation scope. Owners and Managers may create or
update; Contributors may read only relationships beneath Tracks they created.
Topics must exist in authoritative Research. Users must be active with active
membership in the configured tenant. TrackUser role is restricted to
`Attendee`, `Moderator`, or `Presenter`.
TrackTopic identity and keys are immutable. TrackUser TrackID and UserID are
immutable. Neither client exposes delete because a recovery-safe removal
workflow is not yet governed. There is no broad manage scope, Salesforce,
sf-gate, Cache, credential-bearing model, or direct-database client surface.
Generation note: Lib `main` already contains additional Members spec paths
whose generated clients belong to separate pending slices. This draft pins the
updated spec hash but includes only the TrackTopic/TrackUser artifacts and root
wiring generated with go-swagger v0.35.0. A future all-service regeneration
must reconcile those independent slices; this draft does not silently absorb
them.

View File

@ -239,6 +239,20 @@ parameters:
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: Exactly one governed Track-to-Topic association
in: body
name: trackTopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: Exactly one governed Track-to-User association
in: body
name: trackUserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
FavoriteRequest:
description: An array of new Favorite records
in: body
@ -609,6 +623,14 @@ responses:
description: Governed Track-to-Event association response
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: Governed Track-to-Topic association response
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: Governed Track-to-User association response
schema:
$ref: "#/definitions/TrackUserResponse"
FavoriteResponse:
description: Favorite Response Object
schema:
@ -4285,6 +4307,147 @@ paths:
summary: Create a governed Track-to-Event association
tags:
- TrackEvents
/tracktopics:
get:
description: Reads Track-to-Topic associations through the configured tenant's governed Track boundary and only when the referenced Research Topic exists. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-topic:read and an active native member session.
operationId: getTrackTopics
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/idQuery"
- name: trackId
in: query
type: string
required: false
- name: topicId
in: query
type: string
required: false
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
summary: Get governed Track-to-Topic associations
tags:
- TrackTopics
post:
description: Creates one immutable Track-to-Topic association after proving the Track belongs to the configured tenant and the referenced Research Topic exists. Requires members:track-topic:create and an active native Owner or Manager session. Identity, relationship keys, and audit fields are immutable; update and delete are unsupported.
operationId: postTrackTopics
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Create a governed Track-to-Topic association
tags:
- TrackTopics
/trackusers:
get:
description: Reads Track-to-User associations through the configured tenant's governed Track boundary and only for active referenced Users with an active membership in that tenant and an allowed role. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-user:read and an active native member session.
operationId: getTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/idQuery"
- name: trackId
in: query
type: string
required: false
- name: userId
in: query
type: string
required: false
- name: role
in: query
type: string
enum: [Attendee, Moderator, Presenter]
required: false
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
summary: Get governed Track-to-User associations
tags:
- TrackUsers
post:
description: Creates one Track-to-User association after proving the Track and active referenced User belong to the configured tenant and the role is Attendee, Moderator, or Presenter. Requires members:track-user:create and an active native Owner or Manager session. Identity, TrackID, UserID, and audit fields are server-owned or immutable.
operationId: postTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Create a governed Track-to-User association
tags:
- TrackUsers
put:
description: CAS-updates only the allowed role of one bounded Track-to-User association. Requires members:track-user:update, an active native Owner or Manager session, and the current LastModifiedDate. TrackID, UserID, identity, and creator fields remain immutable. Delete is unsupported because recovery-safe removal semantics are not governed.
operationId: putTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"409":
$ref: "#/responses/Conflict"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Update a governed Track-to-User role
tags:
- TrackUsers
/transactions:
get:
description: Return tenant-scoped, payment-token-free Transaction records. Requires members:transaction:read and active Owner or Manager access in tenantId.
@ -4647,6 +4810,97 @@ definitions:
$ref: "#/definitions/TrackEvent"
Meta:
$ref: "#/definitions/ResponseMeta"
TrackTopic:
description: An immutable governed association between a tenant-bounded Track and an existing Research Topic. Relationship 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
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
TopicID:
type: string
TrackID:
type: string
x-provider-ownership: track-creator-active-in-configured-keenan-vision-tenant
x-reference-validation: research.topic
TrackTopicRequest:
description: Exactly one Track-to-Topic association
type: object
properties:
Data:
type: array
minItems: 1
maxItems: 1
items:
$ref: "#/definitions/TrackTopic"
TrackTopicResponse:
description: An array of governed Track-to-Topic associations
type: object
properties:
Data:
type: array
items:
$ref: "#/definitions/TrackTopic"
Meta:
$ref: "#/definitions/ResponseMeta"
TrackUser:
description: A governed association between a tenant-bounded Track and an active User in the same configured tenant. TrackID and UserID are immutable; only Role may be CAS-updated.
type: object
properties:
ID:
type: string
CreatedByID:
type: string
x-nullable: true
CreatedDate:
type: string
x-nullable: true
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
Role:
type: string
enum: [Attendee, Moderator, Presenter]
TrackID:
type: string
UserID:
type: string
x-provider-ownership: track-creator-active-in-configured-keenan-vision-tenant
x-reference-validation: active-user-membership-in-configured-keenan-vision-tenant
TrackUserRequest:
description: Exactly one Track-to-User association or role-only CAS update
type: object
properties:
Data:
type: array
minItems: 1
maxItems: 1
items:
$ref: "#/definitions/TrackUser"
TrackUserResponse:
description: An array of governed Track-to-User associations
type: object
properties:
Data:
type: array
items:
$ref: "#/definitions/TrackUser"
Meta:
$ref: "#/definitions/ResponseMeta"
AuditFields:
type: object
properties:

View File

@ -239,6 +239,20 @@ parameters:
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: Exactly one governed Track-to-Topic association
in: body
name: trackTopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: Exactly one governed Track-to-User association
in: body
name: trackUserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
FavoriteRequest:
description: An array of new Favorite records
in: body
@ -609,6 +623,14 @@ responses:
description: Governed Track-to-Event association response
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: Governed Track-to-Topic association response
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: Governed Track-to-User association response
schema:
$ref: "#/definitions/TrackUserResponse"
FavoriteResponse:
description: Favorite Response Object
schema:
@ -4285,6 +4307,147 @@ paths:
summary: Create a governed Track-to-Event association
tags:
- TrackEvents
/tracktopics:
get:
description: Reads Track-to-Topic associations through the configured tenant's governed Track boundary and only when the referenced Research Topic exists. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-topic:read and an active native member session.
operationId: getTrackTopics
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/idQuery"
- name: trackId
in: query
type: string
required: false
- name: topicId
in: query
type: string
required: false
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
summary: Get governed Track-to-Topic associations
tags:
- TrackTopics
post:
description: Creates one immutable Track-to-Topic association after proving the Track belongs to the configured tenant and the referenced Research Topic exists. Requires members:track-topic:create and an active native Owner or Manager session. Identity, relationship keys, and audit fields are immutable; update and delete are unsupported.
operationId: postTrackTopics
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Create a governed Track-to-Topic association
tags:
- TrackTopics
/trackusers:
get:
description: Reads Track-to-User associations through the configured tenant's governed Track boundary and only for active referenced Users with an active membership in that tenant and an allowed role. Owners and Managers may read all bounded associations; Contributors may read associations for Tracks they created. Requires members:track-user:read and an active native member session.
operationId: getTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/idQuery"
- name: trackId
in: query
type: string
required: false
- name: userId
in: query
type: string
required: false
- name: role
in: query
type: string
enum: [Attendee, Moderator, Presenter]
required: false
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"500":
$ref: "#/responses/ServerError"
summary: Get governed Track-to-User associations
tags:
- TrackUsers
post:
description: Creates one Track-to-User association after proving the Track and active referenced User belong to the configured tenant and the role is Attendee, Moderator, or Presenter. Requires members:track-user:create and an active native Owner or Manager session. Identity, TrackID, UserID, and audit fields are server-owned or immutable.
operationId: postTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Create a governed Track-to-User association
tags:
- TrackUsers
put:
description: CAS-updates only the allowed role of one bounded Track-to-User association. Requires members:track-user:update, an active native Owner or Manager session, and the current LastModifiedDate. TrackID, UserID, identity, and creator fields remain immutable. Delete is unsupported because recovery-safe removal semantics are not governed.
operationId: putTrackUsers
security:
- ApiKeyAuth: []
kvSessionCookie: []
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"409":
$ref: "#/responses/Conflict"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
summary: Update a governed Track-to-User role
tags:
- TrackUsers
/transactions:
get:
description: Return tenant-scoped, payment-token-free Transaction records. Requires members:transaction:read and active Owner or Manager access in tenantId.
@ -4647,6 +4810,97 @@ definitions:
$ref: "#/definitions/TrackEvent"
Meta:
$ref: "#/definitions/ResponseMeta"
TrackTopic:
description: An immutable governed association between a tenant-bounded Track and an existing Research Topic. Relationship 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
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
TopicID:
type: string
TrackID:
type: string
x-provider-ownership: track-creator-active-in-configured-keenan-vision-tenant
x-reference-validation: research.topic
TrackTopicRequest:
description: Exactly one Track-to-Topic association
type: object
properties:
Data:
type: array
minItems: 1
maxItems: 1
items:
$ref: "#/definitions/TrackTopic"
TrackTopicResponse:
description: An array of governed Track-to-Topic associations
type: object
properties:
Data:
type: array
items:
$ref: "#/definitions/TrackTopic"
Meta:
$ref: "#/definitions/ResponseMeta"
TrackUser:
description: A governed association between a tenant-bounded Track and an active User in the same configured tenant. TrackID and UserID are immutable; only Role may be CAS-updated.
type: object
properties:
ID:
type: string
CreatedByID:
type: string
x-nullable: true
CreatedDate:
type: string
x-nullable: true
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
Role:
type: string
enum: [Attendee, Moderator, Presenter]
TrackID:
type: string
UserID:
type: string
x-provider-ownership: track-creator-active-in-configured-keenan-vision-tenant
x-reference-validation: active-user-membership-in-configured-keenan-vision-tenant
TrackUserRequest:
description: Exactly one Track-to-User association or role-only CAS update
type: object
properties:
Data:
type: array
minItems: 1
maxItems: 1
items:
$ref: "#/definitions/TrackUser"
TrackUserResponse:
description: An array of governed Track-to-User associations
type: object
properties:
Data:
type: array
items:
$ref: "#/definitions/TrackUser"
Meta:
$ref: "#/definitions/ResponseMeta"
AuditFields:
type: object
properties: