add tracks

v0.1.4 v0.1.4
Vernon Keenan 2023-09-30 15:38:27 +00:00
parent 8928bb8e01
commit 13ff3cd6dd
82 changed files with 19129 additions and 0 deletions

View File

@ -34,6 +34,10 @@ import (
"code.tnxs.net/work/lib/api/members/members_client/templates"
"code.tnxs.net/work/lib/api/members/members_client/tenants"
"code.tnxs.net/work/lib/api/members/members_client/tickets"
"code.tnxs.net/work/lib/api/members/members_client/track_events"
"code.tnxs.net/work/lib/api/members/members_client/track_topics"
"code.tnxs.net/work/lib/api/members/members_client/track_users"
"code.tnxs.net/work/lib/api/members/members_client/tracks"
"code.tnxs.net/work/lib/api/members/members_client/transactions"
"code.tnxs.net/work/lib/api/members/members_client/users"
"code.tnxs.net/work/lib/api/members/members_client/webhooks"
@ -101,6 +105,10 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Members {
cli.Templates = templates.New(transport, formats)
cli.Tenants = tenants.New(transport, formats)
cli.Tickets = tickets.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)
cli.Webhooks = webhooks.New(transport, formats)
@ -188,6 +196,14 @@ type Members struct {
Tickets tickets.ClientService
TrackEvents track_events.ClientService
TrackTopics track_topics.ClientService
TrackUsers track_users.ClientService
Tracks tracks.ClientService
Transactions transactions.ClientService
Users users.ClientService
@ -220,6 +236,10 @@ func (c *Members) SetTransport(transport runtime.ClientTransport) {
c.Templates.SetTransport(transport)
c.Tenants.SetTransport(transport)
c.Tickets.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)
c.Webhooks.SetTransport(transport)

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// NewGetTrackEventsParams creates a new GetTrackEventsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetTrackEventsParams() *GetTrackEventsParams {
return &GetTrackEventsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTrackEventsParamsWithTimeout creates a new GetTrackEventsParams object
// with the ability to set a timeout on a request.
func NewGetTrackEventsParamsWithTimeout(timeout time.Duration) *GetTrackEventsParams {
return &GetTrackEventsParams{
timeout: timeout,
}
}
// NewGetTrackEventsParamsWithContext creates a new GetTrackEventsParams object
// with the ability to set a context for a request.
func NewGetTrackEventsParamsWithContext(ctx context.Context) *GetTrackEventsParams {
return &GetTrackEventsParams{
Context: ctx,
}
}
// NewGetTrackEventsParamsWithHTTPClient creates a new GetTrackEventsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTrackEventsParamsWithHTTPClient(client *http.Client) *GetTrackEventsParams {
return &GetTrackEventsParams{
HTTPClient: client,
}
}
/*
GetTrackEventsParams contains all the parameters to send to the API endpoint
for the get track events operation.
Typically these are written to a http.Request.
*/
type GetTrackEventsParams struct {
/* 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackEventsParams) WithDefaults() *GetTrackEventsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackEventsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get track events params
func (o *GetTrackEventsParams) WithTimeout(timeout time.Duration) *GetTrackEventsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get track events params
func (o *GetTrackEventsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get track events params
func (o *GetTrackEventsParams) WithContext(ctx context.Context) *GetTrackEventsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track events params
func (o *GetTrackEventsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get track events params
func (o *GetTrackEventsParams) WithHTTPClient(client *http.Client) *GetTrackEventsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get track events params
func (o *GetTrackEventsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get track events params
func (o *GetTrackEventsParams) WithID(id *string) *GetTrackEventsParams {
o.SetID(id)
return o
}
// SetID adds the id to the get track events params
func (o *GetTrackEventsParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get track events params
func (o *GetTrackEventsParams) WithLimit(limit *int64) *GetTrackEventsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get track events params
func (o *GetTrackEventsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get track events params
func (o *GetTrackEventsParams) WithOffset(offset *int64) *GetTrackEventsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get track events params
func (o *GetTrackEventsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// GetTrackEventsReader is a Reader for the GetTrackEvents structure.
type GetTrackEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTrackEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTrackEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTrackEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTrackEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTrackEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTrackEventsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetTrackEventsOK creates a GetTrackEventsOK with default headers values
func NewGetTrackEventsOK() *GetTrackEventsOK {
return &GetTrackEventsOK{}
}
/*
GetTrackEventsOK describes a response with status code 200, with default header values.
TrackEvent Response Object
*/
type GetTrackEventsOK struct {
Payload *members_models.TrackEventResponse
}
// IsSuccess returns true when this get track events o k response has a 2xx status code
func (o *GetTrackEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get track events o k response has a 3xx status code
func (o *GetTrackEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events o k response has a 4xx status code
func (o *GetTrackEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get track events o k response has a 5xx status code
func (o *GetTrackEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get track events o k response a status code equal to that given
func (o *GetTrackEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get track events o k response
func (o *GetTrackEventsOK) Code() int {
return 200
}
func (o *GetTrackEventsOK) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %+v", 200, o.Payload)
}
func (o *GetTrackEventsOK) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %+v", 200, o.Payload)
}
func (o *GetTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
return o.Payload
}
func (o *GetTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackEventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsUnauthorized creates a GetTrackEventsUnauthorized with default headers values
func NewGetTrackEventsUnauthorized() *GetTrackEventsUnauthorized {
return &GetTrackEventsUnauthorized{}
}
/*
GetTrackEventsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetTrackEventsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track events unauthorized response has a 2xx status code
func (o *GetTrackEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events unauthorized response has a 3xx status code
func (o *GetTrackEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events unauthorized response has a 4xx status code
func (o *GetTrackEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events unauthorized response has a 5xx status code
func (o *GetTrackEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get track events unauthorized response a status code equal to that given
func (o *GetTrackEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get track events unauthorized response
func (o *GetTrackEventsUnauthorized) Code() int {
return 401
}
func (o *GetTrackEventsUnauthorized) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackEventsUnauthorized) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackEventsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsForbidden creates a GetTrackEventsForbidden with default headers values
func NewGetTrackEventsForbidden() *GetTrackEventsForbidden {
return &GetTrackEventsForbidden{}
}
/*
GetTrackEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTrackEventsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get track events forbidden response has a 2xx status code
func (o *GetTrackEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events forbidden response has a 3xx status code
func (o *GetTrackEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events forbidden response has a 4xx status code
func (o *GetTrackEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events forbidden response has a 5xx status code
func (o *GetTrackEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get track events forbidden response a status code equal to that given
func (o *GetTrackEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get track events forbidden response
func (o *GetTrackEventsForbidden) Code() int {
return 403
}
func (o *GetTrackEventsForbidden) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackEventsForbidden) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackEventsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsNotFound creates a GetTrackEventsNotFound with default headers values
func NewGetTrackEventsNotFound() *GetTrackEventsNotFound {
return &GetTrackEventsNotFound{}
}
/*
GetTrackEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTrackEventsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track events not found response has a 2xx status code
func (o *GetTrackEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events not found response has a 3xx status code
func (o *GetTrackEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events not found response has a 4xx status code
func (o *GetTrackEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events not found response has a 5xx status code
func (o *GetTrackEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get track events not found response a status code equal to that given
func (o *GetTrackEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get track events not found response
func (o *GetTrackEventsNotFound) Code() int {
return 404
}
func (o *GetTrackEventsNotFound) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackEventsNotFound) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackEventsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsUnprocessableEntity creates a GetTrackEventsUnprocessableEntity with default headers values
func NewGetTrackEventsUnprocessableEntity() *GetTrackEventsUnprocessableEntity {
return &GetTrackEventsUnprocessableEntity{}
}
/*
GetTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackEventsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track events unprocessable entity response has a 2xx status code
func (o *GetTrackEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events unprocessable entity response has a 3xx status code
func (o *GetTrackEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events unprocessable entity response has a 4xx status code
func (o *GetTrackEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events unprocessable entity response has a 5xx status code
func (o *GetTrackEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track events unprocessable entity response a status code equal to that given
func (o *GetTrackEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track events unprocessable entity response
func (o *GetTrackEventsUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackEventsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackEventsUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsInternalServerError creates a GetTrackEventsInternalServerError with default headers values
func NewGetTrackEventsInternalServerError() *GetTrackEventsInternalServerError {
return &GetTrackEventsInternalServerError{}
}
/*
GetTrackEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTrackEventsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track events internal server error response has a 2xx status code
func (o *GetTrackEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events internal server error response has a 3xx status code
func (o *GetTrackEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events internal server error response has a 4xx status code
func (o *GetTrackEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get track events internal server error response has a 5xx status code
func (o *GetTrackEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get track events internal server error response a status code equal to that given
func (o *GetTrackEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get track events internal server error response
func (o *GetTrackEventsInternalServerError) Code() int {
return 500
}
func (o *GetTrackEventsInternalServerError) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackEventsInternalServerError) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackEventsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPostTrackEventsParams creates a new PostTrackEventsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostTrackEventsParams() *PostTrackEventsParams {
return &PostTrackEventsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTrackEventsParamsWithTimeout creates a new PostTrackEventsParams object
// with the ability to set a timeout on a request.
func NewPostTrackEventsParamsWithTimeout(timeout time.Duration) *PostTrackEventsParams {
return &PostTrackEventsParams{
timeout: timeout,
}
}
// NewPostTrackEventsParamsWithContext creates a new PostTrackEventsParams object
// with the ability to set a context for a request.
func NewPostTrackEventsParamsWithContext(ctx context.Context) *PostTrackEventsParams {
return &PostTrackEventsParams{
Context: ctx,
}
}
// NewPostTrackEventsParamsWithHTTPClient creates a new PostTrackEventsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTrackEventsParamsWithHTTPClient(client *http.Client) *PostTrackEventsParams {
return &PostTrackEventsParams{
HTTPClient: client,
}
}
/*
PostTrackEventsParams contains all the parameters to send to the API endpoint
for the post track events operation.
Typically these are written to a http.Request.
*/
type PostTrackEventsParams struct {
/* TrackeventRequest.
An array of new TrackEvent records
*/
TrackeventRequest *members_models.TrackEventRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackEventsParams) WithDefaults() *PostTrackEventsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackEventsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post track events params
func (o *PostTrackEventsParams) WithTimeout(timeout time.Duration) *PostTrackEventsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post track events params
func (o *PostTrackEventsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post track events params
func (o *PostTrackEventsParams) WithContext(ctx context.Context) *PostTrackEventsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track events params
func (o *PostTrackEventsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post track events params
func (o *PostTrackEventsParams) WithHTTPClient(client *http.Client) *PostTrackEventsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post track events params
func (o *PostTrackEventsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) WithTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) *PostTrackEventsParams {
o.SetTrackeventRequest(trackeventRequest)
return o
}
// SetTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) SetTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) {
o.TrackeventRequest = trackeventRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackeventRequest != nil {
if err := r.SetBodyParam(o.TrackeventRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// PostTrackEventsReader is a Reader for the PostTrackEvents structure.
type PostTrackEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostTrackEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTrackEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTrackEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostTrackEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTrackEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTrackEventsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostTrackEventsOK creates a PostTrackEventsOK with default headers values
func NewPostTrackEventsOK() *PostTrackEventsOK {
return &PostTrackEventsOK{}
}
/*
PostTrackEventsOK describes a response with status code 200, with default header values.
TrackEvent Response Object
*/
type PostTrackEventsOK struct {
Payload *members_models.TrackEventResponse
}
// IsSuccess returns true when this post track events o k response has a 2xx status code
func (o *PostTrackEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post track events o k response has a 3xx status code
func (o *PostTrackEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events o k response has a 4xx status code
func (o *PostTrackEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post track events o k response has a 5xx status code
func (o *PostTrackEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post track events o k response a status code equal to that given
func (o *PostTrackEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post track events o k response
func (o *PostTrackEventsOK) Code() int {
return 200
}
func (o *PostTrackEventsOK) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %+v", 200, o.Payload)
}
func (o *PostTrackEventsOK) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %+v", 200, o.Payload)
}
func (o *PostTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
return o.Payload
}
func (o *PostTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackEventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsUnauthorized creates a PostTrackEventsUnauthorized with default headers values
func NewPostTrackEventsUnauthorized() *PostTrackEventsUnauthorized {
return &PostTrackEventsUnauthorized{}
}
/*
PostTrackEventsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostTrackEventsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track events unauthorized response has a 2xx status code
func (o *PostTrackEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events unauthorized response has a 3xx status code
func (o *PostTrackEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events unauthorized response has a 4xx status code
func (o *PostTrackEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events unauthorized response has a 5xx status code
func (o *PostTrackEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post track events unauthorized response a status code equal to that given
func (o *PostTrackEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post track events unauthorized response
func (o *PostTrackEventsUnauthorized) Code() int {
return 401
}
func (o *PostTrackEventsUnauthorized) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackEventsUnauthorized) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackEventsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsForbidden creates a PostTrackEventsForbidden with default headers values
func NewPostTrackEventsForbidden() *PostTrackEventsForbidden {
return &PostTrackEventsForbidden{}
}
/*
PostTrackEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostTrackEventsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post track events forbidden response has a 2xx status code
func (o *PostTrackEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events forbidden response has a 3xx status code
func (o *PostTrackEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events forbidden response has a 4xx status code
func (o *PostTrackEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events forbidden response has a 5xx status code
func (o *PostTrackEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post track events forbidden response a status code equal to that given
func (o *PostTrackEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post track events forbidden response
func (o *PostTrackEventsForbidden) Code() int {
return 403
}
func (o *PostTrackEventsForbidden) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackEventsForbidden) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackEventsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsNotFound creates a PostTrackEventsNotFound with default headers values
func NewPostTrackEventsNotFound() *PostTrackEventsNotFound {
return &PostTrackEventsNotFound{}
}
/*
PostTrackEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackEventsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track events not found response has a 2xx status code
func (o *PostTrackEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events not found response has a 3xx status code
func (o *PostTrackEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events not found response has a 4xx status code
func (o *PostTrackEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events not found response has a 5xx status code
func (o *PostTrackEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track events not found response a status code equal to that given
func (o *PostTrackEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track events not found response
func (o *PostTrackEventsNotFound) Code() int {
return 404
}
func (o *PostTrackEventsNotFound) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackEventsNotFound) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackEventsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackEventsNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsUnprocessableEntity creates a PostTrackEventsUnprocessableEntity with default headers values
func NewPostTrackEventsUnprocessableEntity() *PostTrackEventsUnprocessableEntity {
return &PostTrackEventsUnprocessableEntity{}
}
/*
PostTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostTrackEventsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track events unprocessable entity response has a 2xx status code
func (o *PostTrackEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events unprocessable entity response has a 3xx status code
func (o *PostTrackEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events unprocessable entity response has a 4xx status code
func (o *PostTrackEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events unprocessable entity response has a 5xx status code
func (o *PostTrackEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post track events unprocessable entity response a status code equal to that given
func (o *PostTrackEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post track events unprocessable entity response
func (o *PostTrackEventsUnprocessableEntity) Code() int {
return 422
}
func (o *PostTrackEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackEventsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsInternalServerError creates a PostTrackEventsInternalServerError with default headers values
func NewPostTrackEventsInternalServerError() *PostTrackEventsInternalServerError {
return &PostTrackEventsInternalServerError{}
}
/*
PostTrackEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostTrackEventsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track events internal server error response has a 2xx status code
func (o *PostTrackEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events internal server error response has a 3xx status code
func (o *PostTrackEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events internal server error response has a 4xx status code
func (o *PostTrackEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post track events internal server error response has a 5xx status code
func (o *PostTrackEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post track events internal server error response a status code equal to that given
func (o *PostTrackEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post track events internal server error response
func (o *PostTrackEventsInternalServerError) Code() int {
return 500
}
func (o *PostTrackEventsInternalServerError) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackEventsInternalServerError) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackEventsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPutTrackEventsParams creates a new PutTrackEventsParams 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 NewPutTrackEventsParams() *PutTrackEventsParams {
return &PutTrackEventsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutTrackEventsParamsWithTimeout creates a new PutTrackEventsParams object
// with the ability to set a timeout on a request.
func NewPutTrackEventsParamsWithTimeout(timeout time.Duration) *PutTrackEventsParams {
return &PutTrackEventsParams{
timeout: timeout,
}
}
// NewPutTrackEventsParamsWithContext creates a new PutTrackEventsParams object
// with the ability to set a context for a request.
func NewPutTrackEventsParamsWithContext(ctx context.Context) *PutTrackEventsParams {
return &PutTrackEventsParams{
Context: ctx,
}
}
// NewPutTrackEventsParamsWithHTTPClient creates a new PutTrackEventsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTrackEventsParamsWithHTTPClient(client *http.Client) *PutTrackEventsParams {
return &PutTrackEventsParams{
HTTPClient: client,
}
}
/*
PutTrackEventsParams contains all the parameters to send to the API endpoint
for the put track events operation.
Typically these are written to a http.Request.
*/
type PutTrackEventsParams struct {
/* TrackeventRequest.
An array of new TrackEvent records
*/
TrackeventRequest *members_models.TrackEventRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackEventsParams) WithDefaults() *PutTrackEventsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackEventsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put track events params
func (o *PutTrackEventsParams) WithTimeout(timeout time.Duration) *PutTrackEventsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put track events params
func (o *PutTrackEventsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put track events params
func (o *PutTrackEventsParams) WithContext(ctx context.Context) *PutTrackEventsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put track events params
func (o *PutTrackEventsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put track events params
func (o *PutTrackEventsParams) WithHTTPClient(client *http.Client) *PutTrackEventsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put track events params
func (o *PutTrackEventsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackeventRequest adds the trackeventRequest to the put track events params
func (o *PutTrackEventsParams) WithTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) *PutTrackEventsParams {
o.SetTrackeventRequest(trackeventRequest)
return o
}
// SetTrackeventRequest adds the trackeventRequest to the put track events params
func (o *PutTrackEventsParams) SetTrackeventRequest(trackeventRequest *members_models.TrackEventRequest) {
o.TrackeventRequest = trackeventRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackeventRequest != nil {
if err := r.SetBodyParam(o.TrackeventRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// PutTrackEventsReader is a Reader for the PutTrackEvents structure.
type PutTrackEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutTrackEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutTrackEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutTrackEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutTrackEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutTrackEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutTrackEventsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutTrackEventsOK creates a PutTrackEventsOK with default headers values
func NewPutTrackEventsOK() *PutTrackEventsOK {
return &PutTrackEventsOK{}
}
/*
PutTrackEventsOK describes a response with status code 200, with default header values.
TrackEvent Response Object
*/
type PutTrackEventsOK struct {
Payload *members_models.TrackEventResponse
}
// IsSuccess returns true when this put track events o k response has a 2xx status code
func (o *PutTrackEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put track events o k response has a 3xx status code
func (o *PutTrackEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events o k response has a 4xx status code
func (o *PutTrackEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put track events o k response has a 5xx status code
func (o *PutTrackEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this put track events o k response a status code equal to that given
func (o *PutTrackEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put track events o k response
func (o *PutTrackEventsOK) Code() int {
return 200
}
func (o *PutTrackEventsOK) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsOK %+v", 200, o.Payload)
}
func (o *PutTrackEventsOK) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsOK %+v", 200, o.Payload)
}
func (o *PutTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
return o.Payload
}
func (o *PutTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackEventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutTrackEventsUnauthorized creates a PutTrackEventsUnauthorized with default headers values
func NewPutTrackEventsUnauthorized() *PutTrackEventsUnauthorized {
return &PutTrackEventsUnauthorized{}
}
/*
PutTrackEventsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PutTrackEventsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track events unauthorized response has a 2xx status code
func (o *PutTrackEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track events unauthorized response has a 3xx status code
func (o *PutTrackEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events unauthorized response has a 4xx status code
func (o *PutTrackEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put track events unauthorized response has a 5xx status code
func (o *PutTrackEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put track events unauthorized response a status code equal to that given
func (o *PutTrackEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put track events unauthorized response
func (o *PutTrackEventsUnauthorized) Code() int {
return 401
}
func (o *PutTrackEventsUnauthorized) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PutTrackEventsUnauthorized) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PutTrackEventsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackEventsUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackEventsForbidden creates a PutTrackEventsForbidden with default headers values
func NewPutTrackEventsForbidden() *PutTrackEventsForbidden {
return &PutTrackEventsForbidden{}
}
/*
PutTrackEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutTrackEventsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this put track events forbidden response has a 2xx status code
func (o *PutTrackEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track events forbidden response has a 3xx status code
func (o *PutTrackEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events forbidden response has a 4xx status code
func (o *PutTrackEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put track events forbidden response has a 5xx status code
func (o *PutTrackEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put track events forbidden response a status code equal to that given
func (o *PutTrackEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put track events forbidden response
func (o *PutTrackEventsForbidden) Code() int {
return 403
}
func (o *PutTrackEventsForbidden) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PutTrackEventsForbidden) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PutTrackEventsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackEventsForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackEventsNotFound creates a PutTrackEventsNotFound with default headers values
func NewPutTrackEventsNotFound() *PutTrackEventsNotFound {
return &PutTrackEventsNotFound{}
}
/*
PutTrackEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutTrackEventsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track events not found response has a 2xx status code
func (o *PutTrackEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track events not found response has a 3xx status code
func (o *PutTrackEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events not found response has a 4xx status code
func (o *PutTrackEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put track events not found response has a 5xx status code
func (o *PutTrackEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put track events not found response a status code equal to that given
func (o *PutTrackEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put track events not found response
func (o *PutTrackEventsNotFound) Code() int {
return 404
}
func (o *PutTrackEventsNotFound) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PutTrackEventsNotFound) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PutTrackEventsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackEventsNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackEventsUnprocessableEntity creates a PutTrackEventsUnprocessableEntity with default headers values
func NewPutTrackEventsUnprocessableEntity() *PutTrackEventsUnprocessableEntity {
return &PutTrackEventsUnprocessableEntity{}
}
/*
PutTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutTrackEventsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track events unprocessable entity response has a 2xx status code
func (o *PutTrackEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track events unprocessable entity response has a 3xx status code
func (o *PutTrackEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events unprocessable entity response has a 4xx status code
func (o *PutTrackEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put track events unprocessable entity response has a 5xx status code
func (o *PutTrackEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put track events unprocessable entity response a status code equal to that given
func (o *PutTrackEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put track events unprocessable entity response
func (o *PutTrackEventsUnprocessableEntity) Code() int {
return 422
}
func (o *PutTrackEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTrackEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTrackEventsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackEventsUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackEventsInternalServerError creates a PutTrackEventsInternalServerError with default headers values
func NewPutTrackEventsInternalServerError() *PutTrackEventsInternalServerError {
return &PutTrackEventsInternalServerError{}
}
/*
PutTrackEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutTrackEventsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track events internal server error response has a 2xx status code
func (o *PutTrackEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track events internal server error response has a 3xx status code
func (o *PutTrackEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track events internal server error response has a 4xx status code
func (o *PutTrackEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put track events internal server error response has a 5xx status code
func (o *PutTrackEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put track events internal server error response a status code equal to that given
func (o *PutTrackEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put track events internal server error response
func (o *PutTrackEventsInternalServerError) Code() int {
return 500
}
func (o *PutTrackEventsInternalServerError) Error() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PutTrackEventsInternalServerError) String() string {
return fmt.Sprintf("[PUT /trackevents][%d] putTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PutTrackEventsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackEventsInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,172 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track events API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track events API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error)
PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error)
PutTrackEvents(params *PutTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackEventsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackEvents gets a list track events
Return a list of TrackEvent records from the datastore
*/
func (a *Client) GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetTrackEventsParams()
}
op := &runtime.ClientOperation{
ID: "getTrackEvents",
Method: "GET",
PathPattern: "/trackevents",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTrackEventsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackEventsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostTrackEvents creates new track events
Create TrackEvents
*/
func (a *Client) PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostTrackEventsParams()
}
op := &runtime.ClientOperation{
ID: "postTrackEvents",
Method: "POST",
PathPattern: "/trackevents",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTrackEventsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackEventsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutTrackEvents updates track event
Update TrackEvent
*/
func (a *Client) PutTrackEvents(params *PutTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackEventsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutTrackEventsParams()
}
op := &runtime.ClientOperation{
ID: "putTrackEvents",
Method: "PUT",
PathPattern: "/trackevents",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutTrackEventsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutTrackEventsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putTrackEvents: 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// 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 &GetTrackTopicsParams{
timeout: 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{
timeout: timeout,
}
}
// NewGetTrackTopicsParamsWithContext creates a new GetTrackTopicsParams object
// with the ability to set a context for a request.
func NewGetTrackTopicsParamsWithContext(ctx context.Context) *GetTrackTopicsParams {
return &GetTrackTopicsParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the get track topics params
func (o *GetTrackTopicsParams) WithContext(ctx context.Context) *GetTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track topics params
func (o *GetTrackTopicsParams) SetContext(ctx context.Context) {
o.Context = 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
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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) (interface{}, 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 422:
result := NewGetTrackTopicsUnprocessableEntity()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackTopic Response Object
*/
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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %+v", 200, o.Payload)
}
func (o *GetTrackTopicsOK) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %+v", 200, o.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 && 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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackTopicsUnauthorized) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %+v", 401, o.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 && 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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackTopicsForbidden) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %+v", 403, o.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 && 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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackTopicsNotFound) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %+v", 404, o.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 && err != io.EOF {
return err
}
return nil
}
// NewGetTrackTopicsUnprocessableEntity creates a GetTrackTopicsUnprocessableEntity with default headers values
func NewGetTrackTopicsUnprocessableEntity() *GetTrackTopicsUnprocessableEntity {
return &GetTrackTopicsUnprocessableEntity{}
}
/*
GetTrackTopicsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackTopicsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track topics unprocessable entity response has a 2xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics unprocessable entity response has a 3xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics unprocessable entity response has a 4xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track topics unprocessable entity response has a 5xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics unprocessable entity response a status code equal to that given
func (o *GetTrackTopicsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track topics unprocessable entity response
func (o *GetTrackTopicsUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackTopicsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackTopicsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackTopicsUnprocessableEntity) 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 && 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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackTopicsInternalServerError) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %+v", 500, o.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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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 &PostTrackTopicsParams{
timeout: 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{
timeout: timeout,
}
}
// NewPostTrackTopicsParamsWithContext creates a new PostTrackTopicsParams object
// with the ability to set a context for a request.
func NewPostTrackTopicsParamsWithContext(ctx context.Context) *PostTrackTopicsParams {
return &PostTrackTopicsParams{
Context: 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.
An array of new TrackTopic records
*/
TracktopicRequest *members_models.TrackTopicRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the post track topics params
func (o *PostTrackTopicsParams) WithContext(ctx context.Context) *PostTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track topics params
func (o *PostTrackTopicsParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *PostTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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) (interface{}, 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 404:
result := NewPostTrackTopicsNotFound()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackTopic Response Object
*/
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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %+v", 200, o.Payload)
}
func (o *PostTrackTopicsOK) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %+v", 200, o.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 && 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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackTopicsUnauthorized) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %+v", 401, o.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 && 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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackTopicsForbidden) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %+v", 403, o.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 && err != io.EOF {
return err
}
return nil
}
// NewPostTrackTopicsNotFound creates a PostTrackTopicsNotFound with default headers values
func NewPostTrackTopicsNotFound() *PostTrackTopicsNotFound {
return &PostTrackTopicsNotFound{}
}
/*
PostTrackTopicsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackTopicsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track topics not found response has a 2xx status code
func (o *PostTrackTopicsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics not found response has a 3xx status code
func (o *PostTrackTopicsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics not found response has a 4xx status code
func (o *PostTrackTopicsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track topics not found response has a 5xx status code
func (o *PostTrackTopicsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics not found response a status code equal to that given
func (o *PostTrackTopicsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track topics not found response
func (o *PostTrackTopicsNotFound) Code() int {
return 404
}
func (o *PostTrackTopicsNotFound) Error() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackTopicsNotFound) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackTopicsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackTopicsNotFound) 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 && 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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %+v", 422, o.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 && 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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackTopicsInternalServerError) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %+v", 500, o.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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPutTrackTopicsParams creates a new PutTrackTopicsParams 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 NewPutTrackTopicsParams() *PutTrackTopicsParams {
return &PutTrackTopicsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutTrackTopicsParamsWithTimeout creates a new PutTrackTopicsParams object
// with the ability to set a timeout on a request.
func NewPutTrackTopicsParamsWithTimeout(timeout time.Duration) *PutTrackTopicsParams {
return &PutTrackTopicsParams{
timeout: timeout,
}
}
// NewPutTrackTopicsParamsWithContext creates a new PutTrackTopicsParams object
// with the ability to set a context for a request.
func NewPutTrackTopicsParamsWithContext(ctx context.Context) *PutTrackTopicsParams {
return &PutTrackTopicsParams{
Context: ctx,
}
}
// NewPutTrackTopicsParamsWithHTTPClient creates a new PutTrackTopicsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTrackTopicsParamsWithHTTPClient(client *http.Client) *PutTrackTopicsParams {
return &PutTrackTopicsParams{
HTTPClient: client,
}
}
/*
PutTrackTopicsParams contains all the parameters to send to the API endpoint
for the put track topics operation.
Typically these are written to a http.Request.
*/
type PutTrackTopicsParams struct {
/* TracktopicRequest.
An array of new TrackTopic records
*/
TracktopicRequest *members_models.TrackTopicRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackTopicsParams) WithDefaults() *PutTrackTopicsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put track topics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTrackTopicsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put track topics params
func (o *PutTrackTopicsParams) WithTimeout(timeout time.Duration) *PutTrackTopicsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put track topics params
func (o *PutTrackTopicsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put track topics params
func (o *PutTrackTopicsParams) WithContext(ctx context.Context) *PutTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put track topics params
func (o *PutTrackTopicsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put track topics params
func (o *PutTrackTopicsParams) WithHTTPClient(client *http.Client) *PutTrackTopicsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put track topics params
func (o *PutTrackTopicsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTracktopicRequest adds the tracktopicRequest to the put track topics params
func (o *PutTrackTopicsParams) WithTracktopicRequest(tracktopicRequest *members_models.TrackTopicRequest) *PutTrackTopicsParams {
o.SetTracktopicRequest(tracktopicRequest)
return o
}
// SetTracktopicRequest adds the tracktopicRequest to the put track topics params
func (o *PutTrackTopicsParams) SetTracktopicRequest(tracktopicRequest *members_models.TrackTopicRequest) {
o.TracktopicRequest = tracktopicRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// PutTrackTopicsReader is a Reader for the PutTrackTopics structure.
type PutTrackTopicsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutTrackTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutTrackTopicsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutTrackTopicsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutTrackTopicsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutTrackTopicsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutTrackTopicsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutTrackTopicsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutTrackTopicsOK creates a PutTrackTopicsOK with default headers values
func NewPutTrackTopicsOK() *PutTrackTopicsOK {
return &PutTrackTopicsOK{}
}
/*
PutTrackTopicsOK describes a response with status code 200, with default header values.
TrackTopic Response Object
*/
type PutTrackTopicsOK struct {
Payload *members_models.TrackTopicResponse
}
// IsSuccess returns true when this put track topics o k response has a 2xx status code
func (o *PutTrackTopicsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put track topics o k response has a 3xx status code
func (o *PutTrackTopicsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics o k response has a 4xx status code
func (o *PutTrackTopicsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put track topics o k response has a 5xx status code
func (o *PutTrackTopicsOK) IsServerError() bool {
return false
}
// IsCode returns true when this put track topics o k response a status code equal to that given
func (o *PutTrackTopicsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put track topics o k response
func (o *PutTrackTopicsOK) Code() int {
return 200
}
func (o *PutTrackTopicsOK) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsOK %+v", 200, o.Payload)
}
func (o *PutTrackTopicsOK) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsOK %+v", 200, o.Payload)
}
func (o *PutTrackTopicsOK) GetPayload() *members_models.TrackTopicResponse {
return o.Payload
}
func (o *PutTrackTopicsOK) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackTopicsUnauthorized creates a PutTrackTopicsUnauthorized with default headers values
func NewPutTrackTopicsUnauthorized() *PutTrackTopicsUnauthorized {
return &PutTrackTopicsUnauthorized{}
}
/*
PutTrackTopicsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PutTrackTopicsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track topics unauthorized response has a 2xx status code
func (o *PutTrackTopicsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track topics unauthorized response has a 3xx status code
func (o *PutTrackTopicsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics unauthorized response has a 4xx status code
func (o *PutTrackTopicsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put track topics unauthorized response has a 5xx status code
func (o *PutTrackTopicsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put track topics unauthorized response a status code equal to that given
func (o *PutTrackTopicsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put track topics unauthorized response
func (o *PutTrackTopicsUnauthorized) Code() int {
return 401
}
func (o *PutTrackTopicsUnauthorized) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *PutTrackTopicsUnauthorized) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *PutTrackTopicsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackTopicsUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackTopicsForbidden creates a PutTrackTopicsForbidden with default headers values
func NewPutTrackTopicsForbidden() *PutTrackTopicsForbidden {
return &PutTrackTopicsForbidden{}
}
/*
PutTrackTopicsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutTrackTopicsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this put track topics forbidden response has a 2xx status code
func (o *PutTrackTopicsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track topics forbidden response has a 3xx status code
func (o *PutTrackTopicsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics forbidden response has a 4xx status code
func (o *PutTrackTopicsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put track topics forbidden response has a 5xx status code
func (o *PutTrackTopicsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put track topics forbidden response a status code equal to that given
func (o *PutTrackTopicsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put track topics forbidden response
func (o *PutTrackTopicsForbidden) Code() int {
return 403
}
func (o *PutTrackTopicsForbidden) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *PutTrackTopicsForbidden) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *PutTrackTopicsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackTopicsForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackTopicsNotFound creates a PutTrackTopicsNotFound with default headers values
func NewPutTrackTopicsNotFound() *PutTrackTopicsNotFound {
return &PutTrackTopicsNotFound{}
}
/*
PutTrackTopicsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutTrackTopicsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track topics not found response has a 2xx status code
func (o *PutTrackTopicsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track topics not found response has a 3xx status code
func (o *PutTrackTopicsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics not found response has a 4xx status code
func (o *PutTrackTopicsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put track topics not found response has a 5xx status code
func (o *PutTrackTopicsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put track topics not found response a status code equal to that given
func (o *PutTrackTopicsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put track topics not found response
func (o *PutTrackTopicsNotFound) Code() int {
return 404
}
func (o *PutTrackTopicsNotFound) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PutTrackTopicsNotFound) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PutTrackTopicsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackTopicsNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackTopicsUnprocessableEntity creates a PutTrackTopicsUnprocessableEntity with default headers values
func NewPutTrackTopicsUnprocessableEntity() *PutTrackTopicsUnprocessableEntity {
return &PutTrackTopicsUnprocessableEntity{}
}
/*
PutTrackTopicsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutTrackTopicsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track topics unprocessable entity response has a 2xx status code
func (o *PutTrackTopicsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track topics unprocessable entity response has a 3xx status code
func (o *PutTrackTopicsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics unprocessable entity response has a 4xx status code
func (o *PutTrackTopicsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put track topics unprocessable entity response has a 5xx status code
func (o *PutTrackTopicsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put track topics unprocessable entity response a status code equal to that given
func (o *PutTrackTopicsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put track topics unprocessable entity response
func (o *PutTrackTopicsUnprocessableEntity) Code() int {
return 422
}
func (o *PutTrackTopicsUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTrackTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTrackTopicsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackTopicsUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTrackTopicsInternalServerError creates a PutTrackTopicsInternalServerError with default headers values
func NewPutTrackTopicsInternalServerError() *PutTrackTopicsInternalServerError {
return &PutTrackTopicsInternalServerError{}
}
/*
PutTrackTopicsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutTrackTopicsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put track topics internal server error response has a 2xx status code
func (o *PutTrackTopicsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put track topics internal server error response has a 3xx status code
func (o *PutTrackTopicsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put track topics internal server error response has a 4xx status code
func (o *PutTrackTopicsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put track topics internal server error response has a 5xx status code
func (o *PutTrackTopicsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put track topics internal server error response a status code equal to that given
func (o *PutTrackTopicsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put track topics internal server error response
func (o *PutTrackTopicsInternalServerError) Code() int {
return 500
}
func (o *PutTrackTopicsInternalServerError) Error() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *PutTrackTopicsInternalServerError) String() string {
return fmt.Sprintf("[PUT /tracktopics][%d] putTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *PutTrackTopicsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTrackTopicsInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,172 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track topics API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track topics API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error)
PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error)
PutTrackTopics(params *PutTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackTopicsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackTopics gets a list track topics
Return a list of TrackTopic records from the datastore
*/
func (a *Client) GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackTopicsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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 new track topics
Create TrackTopics
*/
func (a *Client) PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackTopicsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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)
}
/*
PutTrackTopics updates track topic
Update TrackTopic
*/
func (a *Client) PutTrackTopics(params *PutTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackTopicsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutTrackTopicsParams()
}
op := &runtime.ClientOperation{
ID: "putTrackTopics",
Method: "PUT",
PathPattern: "/tracktopics",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutTrackTopicsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutTrackTopicsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putTrackTopics: 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// 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 &GetTrackUsersParams{
timeout: 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{
timeout: timeout,
}
}
// NewGetTrackUsersParamsWithContext creates a new GetTrackUsersParams object
// with the ability to set a context for a request.
func NewGetTrackUsersParamsWithContext(ctx context.Context) *GetTrackUsersParams {
return &GetTrackUsersParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the get track users params
func (o *GetTrackUsersParams) WithContext(ctx context.Context) *GetTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track users params
func (o *GetTrackUsersParams) SetContext(ctx context.Context) {
o.Context = 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
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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) (interface{}, 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 422:
result := NewGetTrackUsersUnprocessableEntity()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackUser Response Object
*/
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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %+v", 200, o.Payload)
}
func (o *GetTrackUsersOK) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %+v", 200, o.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 && 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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackUsersUnauthorized) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %+v", 401, o.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 && 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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *GetTrackUsersForbidden) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %+v", 403, o.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 && 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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *GetTrackUsersNotFound) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %+v", 404, o.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 && err != io.EOF {
return err
}
return nil
}
// NewGetTrackUsersUnprocessableEntity creates a GetTrackUsersUnprocessableEntity with default headers values
func NewGetTrackUsersUnprocessableEntity() *GetTrackUsersUnprocessableEntity {
return &GetTrackUsersUnprocessableEntity{}
}
/*
GetTrackUsersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackUsersUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get track users unprocessable entity response has a 2xx status code
func (o *GetTrackUsersUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users unprocessable entity response has a 3xx status code
func (o *GetTrackUsersUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users unprocessable entity response has a 4xx status code
func (o *GetTrackUsersUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track users unprocessable entity response has a 5xx status code
func (o *GetTrackUsersUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track users unprocessable entity response a status code equal to that given
func (o *GetTrackUsersUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track users unprocessable entity response
func (o *GetTrackUsersUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackUsersUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackUsersUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackUsersUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTrackUsersUnprocessableEntity) 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 && 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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackUsersInternalServerError) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %+v", 500, o.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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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 &PostTrackUsersParams{
timeout: 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{
timeout: timeout,
}
}
// NewPostTrackUsersParamsWithContext creates a new PostTrackUsersParams object
// with the ability to set a context for a request.
func NewPostTrackUsersParamsWithContext(ctx context.Context) *PostTrackUsersParams {
return &PostTrackUsersParams{
Context: 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.
An array of new TrackUser records
*/
TrackuserRequest *members_models.TrackUserRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the post track users params
func (o *PostTrackUsersParams) WithContext(ctx context.Context) *PostTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track users params
func (o *PostTrackUsersParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *PostTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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) (interface{}, 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 404:
result := NewPostTrackUsersNotFound()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackUser Response Object
*/
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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %+v", 200, o.Payload)
}
func (o *PostTrackUsersOK) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %+v", 200, o.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 && 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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackUsersUnauthorized) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %+v", 401, o.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 && 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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *PostTrackUsersForbidden) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %+v", 403, o.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 && err != io.EOF {
return err
}
return nil
}
// NewPostTrackUsersNotFound creates a PostTrackUsersNotFound with default headers values
func NewPostTrackUsersNotFound() *PostTrackUsersNotFound {
return &PostTrackUsersNotFound{}
}
/*
PostTrackUsersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackUsersNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post track users not found response has a 2xx status code
func (o *PostTrackUsersNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users not found response has a 3xx status code
func (o *PostTrackUsersNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users not found response has a 4xx status code
func (o *PostTrackUsersNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track users not found response has a 5xx status code
func (o *PostTrackUsersNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track users not found response a status code equal to that given
func (o *PostTrackUsersNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track users not found response
func (o *PostTrackUsersNotFound) Code() int {
return 404
}
func (o *PostTrackUsersNotFound) Error() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *PostTrackUsersNotFound) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *PostTrackUsersNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTrackUsersNotFound) 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 && 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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackUsersUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %+v", 422, o.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 && 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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackUsersInternalServerError) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %+v", 500, o.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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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 &PutTrackUsersParams{
timeout: 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{
timeout: timeout,
}
}
// NewPutTrackUsersParamsWithContext creates a new PutTrackUsersParams object
// with the ability to set a context for a request.
func NewPutTrackUsersParamsWithContext(ctx context.Context) *PutTrackUsersParams {
return &PutTrackUsersParams{
Context: 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.
An array of new TrackUser records
*/
TrackuserRequest *members_models.TrackUserRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the put track users params
func (o *PutTrackUsersParams) WithContext(ctx context.Context) *PutTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put track users params
func (o *PutTrackUsersParams) SetContext(ctx context.Context) {
o.Context = 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 swagger request
func (o *PutTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// 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) (interface{}, 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 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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackUser Response Object
*/
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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersOK %+v", 200, o.Payload)
}
func (o *PutTrackUsersOK) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersOK %+v", 200, o.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 && 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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *PutTrackUsersUnauthorized) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnauthorized %+v", 401, o.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 && 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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *PutTrackUsersForbidden) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersForbidden %+v", 403, o.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 && 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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *PutTrackUsersNotFound) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersNotFound %+v", 404, o.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 && 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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTrackUsersUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersUnprocessableEntity %+v", 422, o.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 && 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 {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *PutTrackUsersInternalServerError) String() string {
return fmt.Sprintf("[PUT /trackusers][%d] putTrackUsersInternalServerError %+v", 500, o.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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,172 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track users API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track users API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error)
PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error)
PutTrackUsers(params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackUsers gets a list track users
Return a list of TrackUser records from the datastore
*/
func (a *Client) GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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 new track users
Create TrackUsers
*/
func (a *Client) PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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 track user
Update TrackUser
*/
func (a *Client) PutTrackUsers(params *PutTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTrackUsersOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutTrackUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// NewGetTracksParams creates a new GetTracksParams 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 NewGetTracksParams() *GetTracksParams {
return &GetTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTracksParamsWithTimeout creates a new GetTracksParams object
// with the ability to set a timeout on a request.
func NewGetTracksParamsWithTimeout(timeout time.Duration) *GetTracksParams {
return &GetTracksParams{
timeout: timeout,
}
}
// NewGetTracksParamsWithContext creates a new GetTracksParams object
// with the ability to set a context for a request.
func NewGetTracksParamsWithContext(ctx context.Context) *GetTracksParams {
return &GetTracksParams{
Context: ctx,
}
}
// NewGetTracksParamsWithHTTPClient creates a new GetTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTracksParamsWithHTTPClient(client *http.Client) *GetTracksParams {
return &GetTracksParams{
HTTPClient: client,
}
}
/*
GetTracksParams contains all the parameters to send to the API endpoint
for the get tracks operation.
Typically these are written to a http.Request.
*/
type GetTracksParams 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTracksParams) WithDefaults() *GetTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get tracks params
func (o *GetTracksParams) WithTimeout(timeout time.Duration) *GetTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get tracks params
func (o *GetTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get tracks params
func (o *GetTracksParams) WithContext(ctx context.Context) *GetTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get tracks params
func (o *GetTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get tracks params
func (o *GetTracksParams) WithHTTPClient(client *http.Client) *GetTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get tracks params
func (o *GetTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get tracks params
func (o *GetTracksParams) WithID(id *string) *GetTracksParams {
o.SetID(id)
return o
}
// SetID adds the id to the get tracks params
func (o *GetTracksParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get tracks params
func (o *GetTracksParams) WithLimit(limit *int64) *GetTracksParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get tracks params
func (o *GetTracksParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get tracks params
func (o *GetTracksParams) WithOffset(offset *int64) *GetTracksParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get tracks params
func (o *GetTracksParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// GetTracksReader is a Reader for the GetTracks structure.
type GetTracksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTracksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTracksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTracksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTracksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTracksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTracksInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetTracksOK creates a GetTracksOK with default headers values
func NewGetTracksOK() *GetTracksOK {
return &GetTracksOK{}
}
/*
GetTracksOK describes a response with status code 200, with default header values.
Track Response Object
*/
type GetTracksOK struct {
Payload *members_models.TrackResponse
}
// IsSuccess returns true when this get tracks o k response has a 2xx status code
func (o *GetTracksOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get tracks o k response has a 3xx status code
func (o *GetTracksOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks o k response has a 4xx status code
func (o *GetTracksOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get tracks o k response has a 5xx status code
func (o *GetTracksOK) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks o k response a status code equal to that given
func (o *GetTracksOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get tracks o k response
func (o *GetTracksOK) Code() int {
return 200
}
func (o *GetTracksOK) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksOK %+v", 200, o.Payload)
}
func (o *GetTracksOK) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksOK %+v", 200, o.Payload)
}
func (o *GetTracksOK) GetPayload() *members_models.TrackResponse {
return o.Payload
}
func (o *GetTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksUnauthorized creates a GetTracksUnauthorized with default headers values
func NewGetTracksUnauthorized() *GetTracksUnauthorized {
return &GetTracksUnauthorized{}
}
/*
GetTracksUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetTracksUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tracks unauthorized response has a 2xx status code
func (o *GetTracksUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks unauthorized response has a 3xx status code
func (o *GetTracksUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks unauthorized response has a 4xx status code
func (o *GetTracksUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks unauthorized response has a 5xx status code
func (o *GetTracksUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks unauthorized response a status code equal to that given
func (o *GetTracksUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get tracks unauthorized response
func (o *GetTracksUnauthorized) Code() int {
return 401
}
func (o *GetTracksUnauthorized) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %+v", 401, o.Payload)
}
func (o *GetTracksUnauthorized) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %+v", 401, o.Payload)
}
func (o *GetTracksUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTracksUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewGetTracksForbidden creates a GetTracksForbidden with default headers values
func NewGetTracksForbidden() *GetTracksForbidden {
return &GetTracksForbidden{}
}
/*
GetTracksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTracksForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get tracks forbidden response has a 2xx status code
func (o *GetTracksForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks forbidden response has a 3xx status code
func (o *GetTracksForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks forbidden response has a 4xx status code
func (o *GetTracksForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks forbidden response has a 5xx status code
func (o *GetTracksForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks forbidden response a status code equal to that given
func (o *GetTracksForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get tracks forbidden response
func (o *GetTracksForbidden) Code() int {
return 403
}
func (o *GetTracksForbidden) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %+v", 403, o.Payload)
}
func (o *GetTracksForbidden) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %+v", 403, o.Payload)
}
func (o *GetTracksForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTracksForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewGetTracksNotFound creates a GetTracksNotFound with default headers values
func NewGetTracksNotFound() *GetTracksNotFound {
return &GetTracksNotFound{}
}
/*
GetTracksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTracksNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tracks not found response has a 2xx status code
func (o *GetTracksNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks not found response has a 3xx status code
func (o *GetTracksNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks not found response has a 4xx status code
func (o *GetTracksNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks not found response has a 5xx status code
func (o *GetTracksNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks not found response a status code equal to that given
func (o *GetTracksNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get tracks not found response
func (o *GetTracksNotFound) Code() int {
return 404
}
func (o *GetTracksNotFound) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %+v", 404, o.Payload)
}
func (o *GetTracksNotFound) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %+v", 404, o.Payload)
}
func (o *GetTracksNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTracksNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewGetTracksUnprocessableEntity creates a GetTracksUnprocessableEntity with default headers values
func NewGetTracksUnprocessableEntity() *GetTracksUnprocessableEntity {
return &GetTracksUnprocessableEntity{}
}
/*
GetTracksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTracksUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tracks unprocessable entity response has a 2xx status code
func (o *GetTracksUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks unprocessable entity response has a 3xx status code
func (o *GetTracksUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks unprocessable entity response has a 4xx status code
func (o *GetTracksUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks unprocessable entity response has a 5xx status code
func (o *GetTracksUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks unprocessable entity response a status code equal to that given
func (o *GetTracksUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get tracks unprocessable entity response
func (o *GetTracksUnprocessableEntity) Code() int {
return 422
}
func (o *GetTracksUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTracksUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTracksUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTracksUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewGetTracksInternalServerError creates a GetTracksInternalServerError with default headers values
func NewGetTracksInternalServerError() *GetTracksInternalServerError {
return &GetTracksInternalServerError{}
}
/*
GetTracksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTracksInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tracks internal server error response has a 2xx status code
func (o *GetTracksInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks internal server error response has a 3xx status code
func (o *GetTracksInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks internal server error response has a 4xx status code
func (o *GetTracksInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get tracks internal server error response has a 5xx status code
func (o *GetTracksInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get tracks internal server error response a status code equal to that given
func (o *GetTracksInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get tracks internal server error response
func (o *GetTracksInternalServerError) Code() int {
return 500
}
func (o *GetTracksInternalServerError) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %+v", 500, o.Payload)
}
func (o *GetTracksInternalServerError) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %+v", 500, o.Payload)
}
func (o *GetTracksInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTracksInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPostTracksParams creates a new PostTracksParams 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 NewPostTracksParams() *PostTracksParams {
return &PostTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTracksParamsWithTimeout creates a new PostTracksParams object
// with the ability to set a timeout on a request.
func NewPostTracksParamsWithTimeout(timeout time.Duration) *PostTracksParams {
return &PostTracksParams{
timeout: timeout,
}
}
// NewPostTracksParamsWithContext creates a new PostTracksParams object
// with the ability to set a context for a request.
func NewPostTracksParamsWithContext(ctx context.Context) *PostTracksParams {
return &PostTracksParams{
Context: ctx,
}
}
// NewPostTracksParamsWithHTTPClient creates a new PostTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTracksParamsWithHTTPClient(client *http.Client) *PostTracksParams {
return &PostTracksParams{
HTTPClient: client,
}
}
/*
PostTracksParams contains all the parameters to send to the API endpoint
for the post tracks operation.
Typically these are written to a http.Request.
*/
type PostTracksParams struct {
/* TrackRequest.
An array of new Track records
*/
TrackRequest *members_models.TrackRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) WithDefaults() *PostTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) WithTimeout(timeout time.Duration) *PostTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post tracks params
func (o *PostTracksParams) WithContext(ctx context.Context) *PostTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post tracks params
func (o *PostTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) WithHTTPClient(client *http.Client) *PostTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) WithTrackRequest(trackRequest *members_models.TrackRequest) *PostTracksParams {
o.SetTrackRequest(trackRequest)
return o
}
// SetTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) SetTrackRequest(trackRequest *members_models.TrackRequest) {
o.TrackRequest = trackRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackRequest != nil {
if err := r.SetBodyParam(o.TrackRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// PostTracksReader is a Reader for the PostTracks structure.
type PostTracksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostTracksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTracksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTracksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostTracksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTracksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTracksInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostTracksOK creates a PostTracksOK with default headers values
func NewPostTracksOK() *PostTracksOK {
return &PostTracksOK{}
}
/*
PostTracksOK describes a response with status code 200, with default header values.
Track Response Object
*/
type PostTracksOK struct {
Payload *members_models.TrackResponse
}
// IsSuccess returns true when this post tracks o k response has a 2xx status code
func (o *PostTracksOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post tracks o k response has a 3xx status code
func (o *PostTracksOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks o k response has a 4xx status code
func (o *PostTracksOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post tracks o k response has a 5xx status code
func (o *PostTracksOK) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks o k response a status code equal to that given
func (o *PostTracksOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post tracks o k response
func (o *PostTracksOK) Code() int {
return 200
}
func (o *PostTracksOK) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %+v", 200, o.Payload)
}
func (o *PostTracksOK) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %+v", 200, o.Payload)
}
func (o *PostTracksOK) GetPayload() *members_models.TrackResponse {
return o.Payload
}
func (o *PostTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksUnauthorized creates a PostTracksUnauthorized with default headers values
func NewPostTracksUnauthorized() *PostTracksUnauthorized {
return &PostTracksUnauthorized{}
}
/*
PostTracksUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostTracksUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post tracks unauthorized response has a 2xx status code
func (o *PostTracksUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks unauthorized response has a 3xx status code
func (o *PostTracksUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks unauthorized response has a 4xx status code
func (o *PostTracksUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks unauthorized response has a 5xx status code
func (o *PostTracksUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks unauthorized response a status code equal to that given
func (o *PostTracksUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post tracks unauthorized response
func (o *PostTracksUnauthorized) Code() int {
return 401
}
func (o *PostTracksUnauthorized) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PostTracksUnauthorized) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PostTracksUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTracksUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostTracksForbidden creates a PostTracksForbidden with default headers values
func NewPostTracksForbidden() *PostTracksForbidden {
return &PostTracksForbidden{}
}
/*
PostTracksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostTracksForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post tracks forbidden response has a 2xx status code
func (o *PostTracksForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks forbidden response has a 3xx status code
func (o *PostTracksForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks forbidden response has a 4xx status code
func (o *PostTracksForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks forbidden response has a 5xx status code
func (o *PostTracksForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks forbidden response a status code equal to that given
func (o *PostTracksForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post tracks forbidden response
func (o *PostTracksForbidden) Code() int {
return 403
}
func (o *PostTracksForbidden) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %+v", 403, o.Payload)
}
func (o *PostTracksForbidden) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %+v", 403, o.Payload)
}
func (o *PostTracksForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTracksForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostTracksNotFound creates a PostTracksNotFound with default headers values
func NewPostTracksNotFound() *PostTracksNotFound {
return &PostTracksNotFound{}
}
/*
PostTracksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTracksNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post tracks not found response has a 2xx status code
func (o *PostTracksNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks not found response has a 3xx status code
func (o *PostTracksNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks not found response has a 4xx status code
func (o *PostTracksNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks not found response has a 5xx status code
func (o *PostTracksNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks not found response a status code equal to that given
func (o *PostTracksNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post tracks not found response
func (o *PostTracksNotFound) Code() int {
return 404
}
func (o *PostTracksNotFound) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %+v", 404, o.Payload)
}
func (o *PostTracksNotFound) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %+v", 404, o.Payload)
}
func (o *PostTracksNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTracksNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostTracksUnprocessableEntity creates a PostTracksUnprocessableEntity with default headers values
func NewPostTracksUnprocessableEntity() *PostTracksUnprocessableEntity {
return &PostTracksUnprocessableEntity{}
}
/*
PostTracksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostTracksUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post tracks unprocessable entity response has a 2xx status code
func (o *PostTracksUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks unprocessable entity response has a 3xx status code
func (o *PostTracksUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks unprocessable entity response has a 4xx status code
func (o *PostTracksUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks unprocessable entity response has a 5xx status code
func (o *PostTracksUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks unprocessable entity response a status code equal to that given
func (o *PostTracksUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post tracks unprocessable entity response
func (o *PostTracksUnprocessableEntity) Code() int {
return 422
}
func (o *PostTracksUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTracksUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTracksUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTracksUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostTracksInternalServerError creates a PostTracksInternalServerError with default headers values
func NewPostTracksInternalServerError() *PostTracksInternalServerError {
return &PostTracksInternalServerError{}
}
/*
PostTracksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostTracksInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post tracks internal server error response has a 2xx status code
func (o *PostTracksInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks internal server error response has a 3xx status code
func (o *PostTracksInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks internal server error response has a 4xx status code
func (o *PostTracksInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post tracks internal server error response has a 5xx status code
func (o *PostTracksInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post tracks internal server error response a status code equal to that given
func (o *PostTracksInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post tracks internal server error response
func (o *PostTracksInternalServerError) Code() int {
return 500
}
func (o *PostTracksInternalServerError) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PostTracksInternalServerError) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PostTracksInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostTracksInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPutTracksParams creates a new PutTracksParams 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 NewPutTracksParams() *PutTracksParams {
return &PutTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutTracksParamsWithTimeout creates a new PutTracksParams object
// with the ability to set a timeout on a request.
func NewPutTracksParamsWithTimeout(timeout time.Duration) *PutTracksParams {
return &PutTracksParams{
timeout: timeout,
}
}
// NewPutTracksParamsWithContext creates a new PutTracksParams object
// with the ability to set a context for a request.
func NewPutTracksParamsWithContext(ctx context.Context) *PutTracksParams {
return &PutTracksParams{
Context: ctx,
}
}
// NewPutTracksParamsWithHTTPClient creates a new PutTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTracksParamsWithHTTPClient(client *http.Client) *PutTracksParams {
return &PutTracksParams{
HTTPClient: client,
}
}
/*
PutTracksParams contains all the parameters to send to the API endpoint
for the put tracks operation.
Typically these are written to a http.Request.
*/
type PutTracksParams struct {
/* TrackRequest.
An array of new Track records
*/
TrackRequest *members_models.TrackRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTracksParams) WithDefaults() *PutTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put tracks params
func (o *PutTracksParams) WithTimeout(timeout time.Duration) *PutTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put tracks params
func (o *PutTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put tracks params
func (o *PutTracksParams) WithContext(ctx context.Context) *PutTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put tracks params
func (o *PutTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put tracks params
func (o *PutTracksParams) WithHTTPClient(client *http.Client) *PutTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put tracks params
func (o *PutTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackRequest adds the trackRequest to the put tracks params
func (o *PutTracksParams) WithTrackRequest(trackRequest *members_models.TrackRequest) *PutTracksParams {
o.SetTrackRequest(trackRequest)
return o
}
// SetTrackRequest adds the trackRequest to the put tracks params
func (o *PutTracksParams) SetTrackRequest(trackRequest *members_models.TrackRequest) {
o.TrackRequest = trackRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackRequest != nil {
if err := r.SetBodyParam(o.TrackRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,486 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/members/members_models"
)
// PutTracksReader is a Reader for the PutTracks structure.
type PutTracksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutTracksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutTracksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutTracksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutTracksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutTracksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutTracksInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutTracksOK creates a PutTracksOK with default headers values
func NewPutTracksOK() *PutTracksOK {
return &PutTracksOK{}
}
/*
PutTracksOK describes a response with status code 200, with default header values.
Track Response Object
*/
type PutTracksOK struct {
Payload *members_models.TrackResponse
}
// IsSuccess returns true when this put tracks o k response has a 2xx status code
func (o *PutTracksOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put tracks o k response has a 3xx status code
func (o *PutTracksOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks o k response has a 4xx status code
func (o *PutTracksOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put tracks o k response has a 5xx status code
func (o *PutTracksOK) IsServerError() bool {
return false
}
// IsCode returns true when this put tracks o k response a status code equal to that given
func (o *PutTracksOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put tracks o k response
func (o *PutTracksOK) Code() int {
return 200
}
func (o *PutTracksOK) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksOK %+v", 200, o.Payload)
}
func (o *PutTracksOK) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksOK %+v", 200, o.Payload)
}
func (o *PutTracksOK) GetPayload() *members_models.TrackResponse {
return o.Payload
}
func (o *PutTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.TrackResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutTracksUnauthorized creates a PutTracksUnauthorized with default headers values
func NewPutTracksUnauthorized() *PutTracksUnauthorized {
return &PutTracksUnauthorized{}
}
/*
PutTracksUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PutTracksUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put tracks unauthorized response has a 2xx status code
func (o *PutTracksUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put tracks unauthorized response has a 3xx status code
func (o *PutTracksUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks unauthorized response has a 4xx status code
func (o *PutTracksUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put tracks unauthorized response has a 5xx status code
func (o *PutTracksUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put tracks unauthorized response a status code equal to that given
func (o *PutTracksUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put tracks unauthorized response
func (o *PutTracksUnauthorized) Code() int {
return 401
}
func (o *PutTracksUnauthorized) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PutTracksUnauthorized) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PutTracksUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTracksUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTracksForbidden creates a PutTracksForbidden with default headers values
func NewPutTracksForbidden() *PutTracksForbidden {
return &PutTracksForbidden{}
}
/*
PutTracksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutTracksForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this put tracks forbidden response has a 2xx status code
func (o *PutTracksForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put tracks forbidden response has a 3xx status code
func (o *PutTracksForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks forbidden response has a 4xx status code
func (o *PutTracksForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put tracks forbidden response has a 5xx status code
func (o *PutTracksForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put tracks forbidden response a status code equal to that given
func (o *PutTracksForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put tracks forbidden response
func (o *PutTracksForbidden) Code() int {
return 403
}
func (o *PutTracksForbidden) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksForbidden %+v", 403, o.Payload)
}
func (o *PutTracksForbidden) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksForbidden %+v", 403, o.Payload)
}
func (o *PutTracksForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTracksForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTracksNotFound creates a PutTracksNotFound with default headers values
func NewPutTracksNotFound() *PutTracksNotFound {
return &PutTracksNotFound{}
}
/*
PutTracksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutTracksNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put tracks not found response has a 2xx status code
func (o *PutTracksNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put tracks not found response has a 3xx status code
func (o *PutTracksNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks not found response has a 4xx status code
func (o *PutTracksNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put tracks not found response has a 5xx status code
func (o *PutTracksNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put tracks not found response a status code equal to that given
func (o *PutTracksNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put tracks not found response
func (o *PutTracksNotFound) Code() int {
return 404
}
func (o *PutTracksNotFound) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksNotFound %+v", 404, o.Payload)
}
func (o *PutTracksNotFound) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksNotFound %+v", 404, o.Payload)
}
func (o *PutTracksNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTracksNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTracksUnprocessableEntity creates a PutTracksUnprocessableEntity with default headers values
func NewPutTracksUnprocessableEntity() *PutTracksUnprocessableEntity {
return &PutTracksUnprocessableEntity{}
}
/*
PutTracksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutTracksUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put tracks unprocessable entity response has a 2xx status code
func (o *PutTracksUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put tracks unprocessable entity response has a 3xx status code
func (o *PutTracksUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks unprocessable entity response has a 4xx status code
func (o *PutTracksUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put tracks unprocessable entity response has a 5xx status code
func (o *PutTracksUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put tracks unprocessable entity response a status code equal to that given
func (o *PutTracksUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put tracks unprocessable entity response
func (o *PutTracksUnprocessableEntity) Code() int {
return 422
}
func (o *PutTracksUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTracksUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutTracksUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTracksUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewPutTracksInternalServerError creates a PutTracksInternalServerError with default headers values
func NewPutTracksInternalServerError() *PutTracksInternalServerError {
return &PutTracksInternalServerError{}
}
/*
PutTracksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutTracksInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put tracks internal server error response has a 2xx status code
func (o *PutTracksInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put tracks internal server error response has a 3xx status code
func (o *PutTracksInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put tracks internal server error response has a 4xx status code
func (o *PutTracksInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put tracks internal server error response has a 5xx status code
func (o *PutTracksInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put tracks internal server error response a status code equal to that given
func (o *PutTracksInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put tracks internal server error response
func (o *PutTracksInternalServerError) Code() int {
return 500
}
func (o *PutTracksInternalServerError) Error() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PutTracksInternalServerError) String() string {
return fmt.Sprintf("[PUT /tracks][%d] putTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PutTracksInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutTracksInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,172 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new tracks API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for tracks API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTracks(params *GetTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTracksOK, error)
PostTracks(params *PostTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTracksOK, error)
PutTracks(params *PutTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTracksOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTracks gets a list tracks
Return a list of Track records from the datastore
*/
func (a *Client) GetTracks(params *GetTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTracksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetTracksParams()
}
op := &runtime.ClientOperation{
ID: "getTracks",
Method: "GET",
PathPattern: "/tracks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTracksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTracksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getTracks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostTracks creates new tracks
Create Tracks
*/
func (a *Client) PostTracks(params *PostTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTracksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostTracksParams()
}
op := &runtime.ClientOperation{
ID: "postTracks",
Method: "POST",
PathPattern: "/tracks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTracksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTracksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postTracks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PutTracks updates track
Update Track
*/
func (a *Client) PutTracks(params *PutTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutTracksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutTracksParams()
}
op := &runtime.ClientOperation{
ID: "putTracks",
Method: "PUT",
PathPattern: "/tracks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutTracksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PutTracksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for putTracks: 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,84 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Track track
//
// swagger:model track
type Track struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// description
Description *string `json:"Description,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// image alt text
ImageAltText *string `json:"ImageAltText,omitempty"`
// image URL
ImageURL *string `json:"ImageURL,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// logo
Logo *string `json:"Logo,omitempty"`
// name
Name *string `json:"Name,omitempty"`
// slug
Slug *string `json:"Slug,omitempty"`
}
// Validate validates this track
func (m *Track) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this track based on context it is used
func (m *Track) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Track) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Track) UnmarshalBinary(b []byte) error {
var res Track
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,72 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEvent track event
//
// swagger:model trackEvent
type TrackEvent struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// event ID
EventID *string `json:"EventID,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// track ID
TrackID *string `json:"TrackID,omitempty"`
}
// Validate validates this track event
func (m *TrackEvent) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this track event based on context it is used
func (m *TrackEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TrackEvent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEvent) UnmarshalBinary(b []byte) error {
var res TrackEvent
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEventRequest An array of TrackEvent objects
//
// swagger:model TrackEventRequest
type TrackEventRequest struct {
// data
Data []*TrackEvent `json:"Data"`
}
// Validate validates this track event request
func (m *TrackEventRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this track event request based on the context it is used
func (m *TrackEventRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackEventRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEventRequest) UnmarshalBinary(b []byte) error {
var res TrackEventRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEventResponse An array of TrackEvent objects
//
// swagger:model TrackEventResponse
type TrackEventResponse struct {
// data
Data []*TrackEvent `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track event response
func (m *TrackEventResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackEventResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this track event response based on the context it is used
func (m *TrackEventResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackEventResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackEventResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEventResponse) UnmarshalBinary(b []byte) error {
var res TrackEventResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackRequest An array of Track objects
//
// swagger:model TrackRequest
type TrackRequest struct {
// data
Data []*Track `json:"Data"`
}
// Validate validates this track request
func (m *TrackRequest) 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 *TrackRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this track request based on the context it is used
func (m *TrackRequest) 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 *TrackRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackRequest) UnmarshalBinary(b []byte) error {
var res TrackRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackResponse An array of Track objects
//
// swagger:model TrackResponse
type TrackResponse struct {
// data
Data []*Track `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track response
func (m *TrackResponse) 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 *TrackResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this track response based on the context it is used
func (m *TrackResponse) 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 *TrackResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackResponse) UnmarshalBinary(b []byte) error {
var res TrackResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,72 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopic track topic
//
// 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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopic) UnmarshalBinary(b []byte) error {
var res TrackTopic
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopicRequest An array of TrackTopic objects
//
// swagger:model TrackTopicRequest
type TrackTopicRequest struct {
// data
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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicRequest) UnmarshalBinary(b []byte) error {
var res TrackTopicRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopicResponse An array of TrackTopic objects
//
// 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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackTopicResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackTopicResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicResponse) UnmarshalBinary(b []byte) error {
var res TrackTopicResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,75 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUser track user
//
// 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
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 {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUser) UnmarshalBinary(b []byte) error {
var res TrackUser
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUserRequest An array of TrackUser objects
//
// swagger:model TrackUserRequest
type TrackUserRequest struct {
// data
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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserRequest) UnmarshalBinary(b []byte) error {
var res TrackUserRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package members_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUserResponse An array of TrackUser objects
//
// 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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackUserResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserResponse) UnmarshalBinary(b []byte) error {
var res TrackUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -40,6 +40,10 @@ import (
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/templates"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/tenants"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/topics"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/track_events"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/track_topics"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/track_users"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/tracks"
"code.tnxs.net/work/lib/api/sfgate/sfgate_client/users"
)
@ -111,6 +115,10 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Sfgate {
cli.Templates = templates.New(transport, formats)
cli.Tenants = tenants.New(transport, formats)
cli.Topics = topics.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.Users = users.New(transport, formats)
return cli
}
@ -208,6 +216,14 @@ type Sfgate struct {
Topics topics.ClientService
TrackEvents track_events.ClientService
TrackTopics track_topics.ClientService
TrackUsers track_users.ClientService
Tracks tracks.ClientService
Users users.ClientService
Transport runtime.ClientTransport
@ -242,5 +258,9 @@ func (c *Sfgate) SetTransport(transport runtime.ClientTransport) {
c.Templates.SetTransport(transport)
c.Tenants.SetTransport(transport)
c.Topics.SetTransport(transport)
c.TrackEvents.SetTransport(transport)
c.TrackTopics.SetTransport(transport)
c.TrackUsers.SetTransport(transport)
c.Tracks.SetTransport(transport)
c.Users.SetTransport(transport)
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// NewGetTrackEventsParams creates a new GetTrackEventsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetTrackEventsParams() *GetTrackEventsParams {
return &GetTrackEventsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTrackEventsParamsWithTimeout creates a new GetTrackEventsParams object
// with the ability to set a timeout on a request.
func NewGetTrackEventsParamsWithTimeout(timeout time.Duration) *GetTrackEventsParams {
return &GetTrackEventsParams{
timeout: timeout,
}
}
// NewGetTrackEventsParamsWithContext creates a new GetTrackEventsParams object
// with the ability to set a context for a request.
func NewGetTrackEventsParamsWithContext(ctx context.Context) *GetTrackEventsParams {
return &GetTrackEventsParams{
Context: ctx,
}
}
// NewGetTrackEventsParamsWithHTTPClient creates a new GetTrackEventsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTrackEventsParamsWithHTTPClient(client *http.Client) *GetTrackEventsParams {
return &GetTrackEventsParams{
HTTPClient: client,
}
}
/*
GetTrackEventsParams contains all the parameters to send to the API endpoint
for the get track events operation.
Typically these are written to a http.Request.
*/
type GetTrackEventsParams struct {
/* 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackEventsParams) WithDefaults() *GetTrackEventsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTrackEventsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get track events params
func (o *GetTrackEventsParams) WithTimeout(timeout time.Duration) *GetTrackEventsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get track events params
func (o *GetTrackEventsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get track events params
func (o *GetTrackEventsParams) WithContext(ctx context.Context) *GetTrackEventsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track events params
func (o *GetTrackEventsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get track events params
func (o *GetTrackEventsParams) WithHTTPClient(client *http.Client) *GetTrackEventsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get track events params
func (o *GetTrackEventsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get track events params
func (o *GetTrackEventsParams) WithID(id *string) *GetTrackEventsParams {
o.SetID(id)
return o
}
// SetID adds the id to the get track events params
func (o *GetTrackEventsParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get track events params
func (o *GetTrackEventsParams) WithLimit(limit *int64) *GetTrackEventsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get track events params
func (o *GetTrackEventsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get track events params
func (o *GetTrackEventsParams) WithOffset(offset *int64) *GetTrackEventsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get track events params
func (o *GetTrackEventsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// GetTrackEventsReader is a Reader for the GetTrackEvents structure.
type GetTrackEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTrackEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTrackEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTrackEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTrackEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTrackEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTrackEventsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetTrackEventsOK creates a GetTrackEventsOK with default headers values
func NewGetTrackEventsOK() *GetTrackEventsOK {
return &GetTrackEventsOK{}
}
/*
GetTrackEventsOK describes a response with status code 200, with default header values.
TrackEvent Response Object
*/
type GetTrackEventsOK struct {
Payload *sfgate_models.TrackEventResponse
}
// IsSuccess returns true when this get track events o k response has a 2xx status code
func (o *GetTrackEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get track events o k response has a 3xx status code
func (o *GetTrackEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events o k response has a 4xx status code
func (o *GetTrackEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get track events o k response has a 5xx status code
func (o *GetTrackEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get track events o k response a status code equal to that given
func (o *GetTrackEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get track events o k response
func (o *GetTrackEventsOK) Code() int {
return 200
}
func (o *GetTrackEventsOK) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %+v", 200, o.Payload)
}
func (o *GetTrackEventsOK) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsOK %+v", 200, o.Payload)
}
func (o *GetTrackEventsOK) GetPayload() *sfgate_models.TrackEventResponse {
return o.Payload
}
func (o *GetTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackEventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsUnauthorized creates a GetTrackEventsUnauthorized with default headers values
func NewGetTrackEventsUnauthorized() *GetTrackEventsUnauthorized {
return &GetTrackEventsUnauthorized{}
}
/*
GetTrackEventsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetTrackEventsUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track events unauthorized response has a 2xx status code
func (o *GetTrackEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events unauthorized response has a 3xx status code
func (o *GetTrackEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events unauthorized response has a 4xx status code
func (o *GetTrackEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events unauthorized response has a 5xx status code
func (o *GetTrackEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get track events unauthorized response a status code equal to that given
func (o *GetTrackEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get track events unauthorized response
func (o *GetTrackEventsUnauthorized) Code() int {
return 401
}
func (o *GetTrackEventsUnauthorized) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackEventsUnauthorized) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackEventsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsForbidden creates a GetTrackEventsForbidden with default headers values
func NewGetTrackEventsForbidden() *GetTrackEventsForbidden {
return &GetTrackEventsForbidden{}
}
/*
GetTrackEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTrackEventsForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track events forbidden response has a 2xx status code
func (o *GetTrackEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events forbidden response has a 3xx status code
func (o *GetTrackEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events forbidden response has a 4xx status code
func (o *GetTrackEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events forbidden response has a 5xx status code
func (o *GetTrackEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get track events forbidden response a status code equal to that given
func (o *GetTrackEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get track events forbidden response
func (o *GetTrackEventsForbidden) Code() int {
return 403
}
func (o *GetTrackEventsForbidden) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackEventsForbidden) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackEventsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsNotFound creates a GetTrackEventsNotFound with default headers values
func NewGetTrackEventsNotFound() *GetTrackEventsNotFound {
return &GetTrackEventsNotFound{}
}
/*
GetTrackEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTrackEventsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track events not found response has a 2xx status code
func (o *GetTrackEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events not found response has a 3xx status code
func (o *GetTrackEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events not found response has a 4xx status code
func (o *GetTrackEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events not found response has a 5xx status code
func (o *GetTrackEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get track events not found response a status code equal to that given
func (o *GetTrackEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get track events not found response
func (o *GetTrackEventsNotFound) Code() int {
return 404
}
func (o *GetTrackEventsNotFound) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackEventsNotFound) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackEventsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsUnprocessableEntity creates a GetTrackEventsUnprocessableEntity with default headers values
func NewGetTrackEventsUnprocessableEntity() *GetTrackEventsUnprocessableEntity {
return &GetTrackEventsUnprocessableEntity{}
}
/*
GetTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackEventsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track events unprocessable entity response has a 2xx status code
func (o *GetTrackEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events unprocessable entity response has a 3xx status code
func (o *GetTrackEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events unprocessable entity response has a 4xx status code
func (o *GetTrackEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track events unprocessable entity response has a 5xx status code
func (o *GetTrackEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track events unprocessable entity response a status code equal to that given
func (o *GetTrackEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track events unprocessable entity response
func (o *GetTrackEventsUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackEventsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackEventsInternalServerError creates a GetTrackEventsInternalServerError with default headers values
func NewGetTrackEventsInternalServerError() *GetTrackEventsInternalServerError {
return &GetTrackEventsInternalServerError{}
}
/*
GetTrackEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTrackEventsInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track events internal server error response has a 2xx status code
func (o *GetTrackEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track events internal server error response has a 3xx status code
func (o *GetTrackEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track events internal server error response has a 4xx status code
func (o *GetTrackEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get track events internal server error response has a 5xx status code
func (o *GetTrackEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get track events internal server error response a status code equal to that given
func (o *GetTrackEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get track events internal server error response
func (o *GetTrackEventsInternalServerError) Code() int {
return 500
}
func (o *GetTrackEventsInternalServerError) Error() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackEventsInternalServerError) String() string {
return fmt.Sprintf("[GET /trackevents][%d] getTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackEventsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// NewPostTrackEventsParams creates a new PostTrackEventsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostTrackEventsParams() *PostTrackEventsParams {
return &PostTrackEventsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTrackEventsParamsWithTimeout creates a new PostTrackEventsParams object
// with the ability to set a timeout on a request.
func NewPostTrackEventsParamsWithTimeout(timeout time.Duration) *PostTrackEventsParams {
return &PostTrackEventsParams{
timeout: timeout,
}
}
// NewPostTrackEventsParamsWithContext creates a new PostTrackEventsParams object
// with the ability to set a context for a request.
func NewPostTrackEventsParamsWithContext(ctx context.Context) *PostTrackEventsParams {
return &PostTrackEventsParams{
Context: ctx,
}
}
// NewPostTrackEventsParamsWithHTTPClient creates a new PostTrackEventsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTrackEventsParamsWithHTTPClient(client *http.Client) *PostTrackEventsParams {
return &PostTrackEventsParams{
HTTPClient: client,
}
}
/*
PostTrackEventsParams contains all the parameters to send to the API endpoint
for the post track events operation.
Typically these are written to a http.Request.
*/
type PostTrackEventsParams struct {
/* TrackeventRequest.
An array of new TrackEvent records
*/
TrackeventRequest *sfgate_models.TrackEventRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackEventsParams) WithDefaults() *PostTrackEventsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post track events params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTrackEventsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post track events params
func (o *PostTrackEventsParams) WithTimeout(timeout time.Duration) *PostTrackEventsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post track events params
func (o *PostTrackEventsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post track events params
func (o *PostTrackEventsParams) WithContext(ctx context.Context) *PostTrackEventsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track events params
func (o *PostTrackEventsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post track events params
func (o *PostTrackEventsParams) WithHTTPClient(client *http.Client) *PostTrackEventsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post track events params
func (o *PostTrackEventsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) WithTrackeventRequest(trackeventRequest *sfgate_models.TrackEventRequest) *PostTrackEventsParams {
o.SetTrackeventRequest(trackeventRequest)
return o
}
// SetTrackeventRequest adds the trackeventRequest to the post track events params
func (o *PostTrackEventsParams) SetTrackeventRequest(trackeventRequest *sfgate_models.TrackEventRequest) {
o.TrackeventRequest = trackeventRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTrackEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackeventRequest != nil {
if err := r.SetBodyParam(o.TrackeventRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// PostTrackEventsReader is a Reader for the PostTrackEvents structure.
type PostTrackEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostTrackEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTrackEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTrackEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostTrackEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTrackEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTrackEventsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostTrackEventsOK creates a PostTrackEventsOK with default headers values
func NewPostTrackEventsOK() *PostTrackEventsOK {
return &PostTrackEventsOK{}
}
/*
PostTrackEventsOK describes a response with status code 200, with default header values.
TrackEvent Response Object
*/
type PostTrackEventsOK struct {
Payload *sfgate_models.TrackEventResponse
}
// IsSuccess returns true when this post track events o k response has a 2xx status code
func (o *PostTrackEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post track events o k response has a 3xx status code
func (o *PostTrackEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events o k response has a 4xx status code
func (o *PostTrackEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post track events o k response has a 5xx status code
func (o *PostTrackEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post track events o k response a status code equal to that given
func (o *PostTrackEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post track events o k response
func (o *PostTrackEventsOK) Code() int {
return 200
}
func (o *PostTrackEventsOK) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %+v", 200, o.Payload)
}
func (o *PostTrackEventsOK) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsOK %+v", 200, o.Payload)
}
func (o *PostTrackEventsOK) GetPayload() *sfgate_models.TrackEventResponse {
return o.Payload
}
func (o *PostTrackEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackEventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsUnauthorized creates a PostTrackEventsUnauthorized with default headers values
func NewPostTrackEventsUnauthorized() *PostTrackEventsUnauthorized {
return &PostTrackEventsUnauthorized{}
}
/*
PostTrackEventsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostTrackEventsUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track events unauthorized response has a 2xx status code
func (o *PostTrackEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events unauthorized response has a 3xx status code
func (o *PostTrackEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events unauthorized response has a 4xx status code
func (o *PostTrackEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events unauthorized response has a 5xx status code
func (o *PostTrackEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post track events unauthorized response a status code equal to that given
func (o *PostTrackEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post track events unauthorized response
func (o *PostTrackEventsUnauthorized) Code() int {
return 401
}
func (o *PostTrackEventsUnauthorized) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackEventsUnauthorized) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackEventsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsForbidden creates a PostTrackEventsForbidden with default headers values
func NewPostTrackEventsForbidden() *PostTrackEventsForbidden {
return &PostTrackEventsForbidden{}
}
/*
PostTrackEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostTrackEventsForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track events forbidden response has a 2xx status code
func (o *PostTrackEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events forbidden response has a 3xx status code
func (o *PostTrackEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events forbidden response has a 4xx status code
func (o *PostTrackEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events forbidden response has a 5xx status code
func (o *PostTrackEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post track events forbidden response a status code equal to that given
func (o *PostTrackEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post track events forbidden response
func (o *PostTrackEventsForbidden) Code() int {
return 403
}
func (o *PostTrackEventsForbidden) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackEventsForbidden) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackEventsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsNotFound creates a PostTrackEventsNotFound with default headers values
func NewPostTrackEventsNotFound() *PostTrackEventsNotFound {
return &PostTrackEventsNotFound{}
}
/*
PostTrackEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackEventsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track events not found response has a 2xx status code
func (o *PostTrackEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events not found response has a 3xx status code
func (o *PostTrackEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events not found response has a 4xx status code
func (o *PostTrackEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events not found response has a 5xx status code
func (o *PostTrackEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track events not found response a status code equal to that given
func (o *PostTrackEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track events not found response
func (o *PostTrackEventsNotFound) Code() int {
return 404
}
func (o *PostTrackEventsNotFound) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackEventsNotFound) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackEventsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsUnprocessableEntity creates a PostTrackEventsUnprocessableEntity with default headers values
func NewPostTrackEventsUnprocessableEntity() *PostTrackEventsUnprocessableEntity {
return &PostTrackEventsUnprocessableEntity{}
}
/*
PostTrackEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostTrackEventsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track events unprocessable entity response has a 2xx status code
func (o *PostTrackEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events unprocessable entity response has a 3xx status code
func (o *PostTrackEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events unprocessable entity response has a 4xx status code
func (o *PostTrackEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post track events unprocessable entity response has a 5xx status code
func (o *PostTrackEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post track events unprocessable entity response a status code equal to that given
func (o *PostTrackEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post track events unprocessable entity response
func (o *PostTrackEventsUnprocessableEntity) Code() int {
return 422
}
func (o *PostTrackEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackEventsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackEventsInternalServerError creates a PostTrackEventsInternalServerError with default headers values
func NewPostTrackEventsInternalServerError() *PostTrackEventsInternalServerError {
return &PostTrackEventsInternalServerError{}
}
/*
PostTrackEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostTrackEventsInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track events internal server error response has a 2xx status code
func (o *PostTrackEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track events internal server error response has a 3xx status code
func (o *PostTrackEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track events internal server error response has a 4xx status code
func (o *PostTrackEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post track events internal server error response has a 5xx status code
func (o *PostTrackEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post track events internal server error response a status code equal to that given
func (o *PostTrackEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post track events internal server error response
func (o *PostTrackEventsInternalServerError) Code() int {
return 500
}
func (o *PostTrackEventsInternalServerError) Error() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackEventsInternalServerError) String() string {
return fmt.Sprintf("[POST /trackevents][%d] postTrackEventsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackEventsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_events
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track events API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track events API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error)
PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackEvents gets a list track events
Return a list of TrackEvent records from the datastore
*/
func (a *Client) GetTrackEvents(params *GetTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackEventsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetTrackEventsParams()
}
op := &runtime.ClientOperation{
ID: "getTrackEvents",
Method: "GET",
PathPattern: "/trackevents",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTrackEventsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackEventsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostTrackEvents creates new track events
Create TrackEvents
*/
func (a *Client) PostTrackEvents(params *PostTrackEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackEventsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostTrackEventsParams()
}
op := &runtime.ClientOperation{
ID: "postTrackEvents",
Method: "POST",
PathPattern: "/trackevents",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTrackEventsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackEventsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postTrackEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// 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 &GetTrackTopicsParams{
timeout: 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{
timeout: timeout,
}
}
// NewGetTrackTopicsParamsWithContext creates a new GetTrackTopicsParams object
// with the ability to set a context for a request.
func NewGetTrackTopicsParamsWithContext(ctx context.Context) *GetTrackTopicsParams {
return &GetTrackTopicsParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the get track topics params
func (o *GetTrackTopicsParams) WithContext(ctx context.Context) *GetTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track topics params
func (o *GetTrackTopicsParams) SetContext(ctx context.Context) {
o.Context = 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
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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) (interface{}, 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 422:
result := NewGetTrackTopicsUnprocessableEntity()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackTopic Response Object
*/
type GetTrackTopicsOK struct {
Payload *sfgate_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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %+v", 200, o.Payload)
}
func (o *GetTrackTopicsOK) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsOK %+v", 200, o.Payload)
}
func (o *GetTrackTopicsOK) GetPayload() *sfgate_models.TrackTopicResponse {
return o.Payload
}
func (o *GetTrackTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackTopicResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackTopicsUnauthorized) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackTopicsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackTopicsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 {
Payload *sfgate_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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackTopicsForbidden) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *GetTrackTopicsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackTopicsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackTopicsNotFound) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *GetTrackTopicsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackTopicsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackTopicsUnprocessableEntity creates a GetTrackTopicsUnprocessableEntity with default headers values
func NewGetTrackTopicsUnprocessableEntity() *GetTrackTopicsUnprocessableEntity {
return &GetTrackTopicsUnprocessableEntity{}
}
/*
GetTrackTopicsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackTopicsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track topics unprocessable entity response has a 2xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track topics unprocessable entity response has a 3xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track topics unprocessable entity response has a 4xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track topics unprocessable entity response has a 5xx status code
func (o *GetTrackTopicsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track topics unprocessable entity response a status code equal to that given
func (o *GetTrackTopicsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track topics unprocessable entity response
func (o *GetTrackTopicsUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackTopicsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackTopicsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackTopicsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackTopicsInternalServerError) String() string {
return fmt.Sprintf("[GET /tracktopics][%d] getTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackTopicsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackTopicsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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 &PostTrackTopicsParams{
timeout: 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{
timeout: timeout,
}
}
// NewPostTrackTopicsParamsWithContext creates a new PostTrackTopicsParams object
// with the ability to set a context for a request.
func NewPostTrackTopicsParamsWithContext(ctx context.Context) *PostTrackTopicsParams {
return &PostTrackTopicsParams{
Context: 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.
An array of new TrackTopic records
*/
TracktopicRequest *sfgate_models.TrackTopicRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the post track topics params
func (o *PostTrackTopicsParams) WithContext(ctx context.Context) *PostTrackTopicsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track topics params
func (o *PostTrackTopicsParams) SetContext(ctx context.Context) {
o.Context = 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 *sfgate_models.TrackTopicRequest) *PostTrackTopicsParams {
o.SetTracktopicRequest(tracktopicRequest)
return o
}
// SetTracktopicRequest adds the tracktopicRequest to the post track topics params
func (o *PostTrackTopicsParams) SetTracktopicRequest(tracktopicRequest *sfgate_models.TrackTopicRequest) {
o.TracktopicRequest = tracktopicRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTrackTopicsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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) (interface{}, 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 404:
result := NewPostTrackTopicsNotFound()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackTopic Response Object
*/
type PostTrackTopicsOK struct {
Payload *sfgate_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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %+v", 200, o.Payload)
}
func (o *PostTrackTopicsOK) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsOK %+v", 200, o.Payload)
}
func (o *PostTrackTopicsOK) GetPayload() *sfgate_models.TrackTopicResponse {
return o.Payload
}
func (o *PostTrackTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackTopicResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackTopicsUnauthorized) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackTopicsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackTopicsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 {
Payload *sfgate_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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackTopicsForbidden) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsForbidden %+v", 403, o.Payload)
}
func (o *PostTrackTopicsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackTopicsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackTopicsNotFound creates a PostTrackTopicsNotFound with default headers values
func NewPostTrackTopicsNotFound() *PostTrackTopicsNotFound {
return &PostTrackTopicsNotFound{}
}
/*
PostTrackTopicsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackTopicsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track topics not found response has a 2xx status code
func (o *PostTrackTopicsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track topics not found response has a 3xx status code
func (o *PostTrackTopicsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track topics not found response has a 4xx status code
func (o *PostTrackTopicsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track topics not found response has a 5xx status code
func (o *PostTrackTopicsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track topics not found response a status code equal to that given
func (o *PostTrackTopicsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track topics not found response
func (o *PostTrackTopicsNotFound) Code() int {
return 404
}
func (o *PostTrackTopicsNotFound) Error() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackTopicsNotFound) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsNotFound %+v", 404, o.Payload)
}
func (o *PostTrackTopicsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackTopicsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackTopicsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackTopicsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackTopicsInternalServerError) String() string {
return fmt.Sprintf("[POST /tracktopics][%d] postTrackTopicsInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackTopicsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackTopicsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_topics
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track topics API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track topics API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error)
PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackTopics gets a list track topics
Return a list of TrackTopic records from the datastore
*/
func (a *Client) GetTrackTopics(params *GetTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackTopicsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackTopicsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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 new track topics
Create TrackTopics
*/
func (a *Client) PostTrackTopics(params *PostTrackTopicsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackTopicsOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackTopicsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// 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 &GetTrackUsersParams{
timeout: 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{
timeout: timeout,
}
}
// NewGetTrackUsersParamsWithContext creates a new GetTrackUsersParams object
// with the ability to set a context for a request.
func NewGetTrackUsersParamsWithContext(ctx context.Context) *GetTrackUsersParams {
return &GetTrackUsersParams{
Context: 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the get track users params
func (o *GetTrackUsersParams) WithContext(ctx context.Context) *GetTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get track users params
func (o *GetTrackUsersParams) SetContext(ctx context.Context) {
o.Context = 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
}
// WriteToRequest writes these params to a swagger request
func (o *GetTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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) (interface{}, 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 422:
result := NewGetTrackUsersUnprocessableEntity()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackUser Response Object
*/
type GetTrackUsersOK struct {
Payload *sfgate_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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %+v", 200, o.Payload)
}
func (o *GetTrackUsersOK) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK %+v", 200, o.Payload)
}
func (o *GetTrackUsersOK) GetPayload() *sfgate_models.TrackUserResponse {
return o.Payload
}
func (o *GetTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackUsersUnauthorized) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *GetTrackUsersUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 {
Payload *sfgate_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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *GetTrackUsersForbidden) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *GetTrackUsersForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *GetTrackUsersNotFound) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *GetTrackUsersNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTrackUsersUnprocessableEntity creates a GetTrackUsersUnprocessableEntity with default headers values
func NewGetTrackUsersUnprocessableEntity() *GetTrackUsersUnprocessableEntity {
return &GetTrackUsersUnprocessableEntity{}
}
/*
GetTrackUsersUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTrackUsersUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get track users unprocessable entity response has a 2xx status code
func (o *GetTrackUsersUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get track users unprocessable entity response has a 3xx status code
func (o *GetTrackUsersUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get track users unprocessable entity response has a 4xx status code
func (o *GetTrackUsersUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get track users unprocessable entity response has a 5xx status code
func (o *GetTrackUsersUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get track users unprocessable entity response a status code equal to that given
func (o *GetTrackUsersUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get track users unprocessable entity response
func (o *GetTrackUsersUnprocessableEntity) Code() int {
return 422
}
func (o *GetTrackUsersUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackUsersUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTrackUsersUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackUsersInternalServerError) String() string {
return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *GetTrackUsersInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTrackUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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 &PostTrackUsersParams{
timeout: 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{
timeout: timeout,
}
}
// NewPostTrackUsersParamsWithContext creates a new PostTrackUsersParams object
// with the ability to set a context for a request.
func NewPostTrackUsersParamsWithContext(ctx context.Context) *PostTrackUsersParams {
return &PostTrackUsersParams{
Context: 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.
An array of new TrackUser records
*/
TrackuserRequest *sfgate_models.TrackUserRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// 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.timeout = timeout
}
// WithContext adds the context to the post track users params
func (o *PostTrackUsersParams) WithContext(ctx context.Context) *PostTrackUsersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post track users params
func (o *PostTrackUsersParams) SetContext(ctx context.Context) {
o.Context = 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 *sfgate_models.TrackUserRequest) *PostTrackUsersParams {
o.SetTrackuserRequest(trackuserRequest)
return o
}
// SetTrackuserRequest adds the trackuserRequest to the post track users params
func (o *PostTrackUsersParams) SetTrackuserRequest(trackuserRequest *sfgate_models.TrackUserRequest) {
o.TrackuserRequest = trackuserRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTrackUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// 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) (interface{}, 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 404:
result := NewPostTrackUsersNotFound()
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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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.
TrackUser Response Object
*/
type PostTrackUsersOK struct {
Payload *sfgate_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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %+v", 200, o.Payload)
}
func (o *PostTrackUsersOK) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersOK %+v", 200, o.Payload)
}
func (o *PostTrackUsersOK) GetPayload() *sfgate_models.TrackUserResponse {
return o.Payload
}
func (o *PostTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackUserResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackUsersUnauthorized) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnauthorized %+v", 401, o.Payload)
}
func (o *PostTrackUsersUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 {
Payload *sfgate_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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *PostTrackUsersForbidden) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersForbidden %+v", 403, o.Payload)
}
func (o *PostTrackUsersForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTrackUsersNotFound creates a PostTrackUsersNotFound with default headers values
func NewPostTrackUsersNotFound() *PostTrackUsersNotFound {
return &PostTrackUsersNotFound{}
}
/*
PostTrackUsersNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTrackUsersNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post track users not found response has a 2xx status code
func (o *PostTrackUsersNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post track users not found response has a 3xx status code
func (o *PostTrackUsersNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post track users not found response has a 4xx status code
func (o *PostTrackUsersNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post track users not found response has a 5xx status code
func (o *PostTrackUsersNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post track users not found response a status code equal to that given
func (o *PostTrackUsersNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post track users not found response
func (o *PostTrackUsersNotFound) Code() int {
return 404
}
func (o *PostTrackUsersNotFound) Error() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *PostTrackUsersNotFound) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersNotFound %+v", 404, o.Payload)
}
func (o *PostTrackUsersNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackUsersUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTrackUsersUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && 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 *sfgate_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 {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackUsersInternalServerError) String() string {
return fmt.Sprintf("[POST /trackusers][%d] postTrackUsersInternalServerError %+v", 500, o.Payload)
}
func (o *PostTrackUsersInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTrackUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package track_users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new track users API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for track users API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error)
PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTrackUsers gets a list track users
Return a list of TrackUser records from the datastore
*/
func (a *Client) GetTrackUsers(params *GetTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTrackUsersOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTrackUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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 new track users
Create TrackUsers
*/
func (a *Client) PostTrackUsers(params *PostTrackUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTrackUsersOK, error) {
// TODO: Validate the params 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,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTrackUsersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent 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)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,240 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
)
// NewGetTracksParams creates a new GetTracksParams 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 NewGetTracksParams() *GetTracksParams {
return &GetTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetTracksParamsWithTimeout creates a new GetTracksParams object
// with the ability to set a timeout on a request.
func NewGetTracksParamsWithTimeout(timeout time.Duration) *GetTracksParams {
return &GetTracksParams{
timeout: timeout,
}
}
// NewGetTracksParamsWithContext creates a new GetTracksParams object
// with the ability to set a context for a request.
func NewGetTracksParamsWithContext(ctx context.Context) *GetTracksParams {
return &GetTracksParams{
Context: ctx,
}
}
// NewGetTracksParamsWithHTTPClient creates a new GetTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetTracksParamsWithHTTPClient(client *http.Client) *GetTracksParams {
return &GetTracksParams{
HTTPClient: client,
}
}
/*
GetTracksParams contains all the parameters to send to the API endpoint
for the get tracks operation.
Typically these are written to a http.Request.
*/
type GetTracksParams 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
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTracksParams) WithDefaults() *GetTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get tracks params
func (o *GetTracksParams) WithTimeout(timeout time.Duration) *GetTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get tracks params
func (o *GetTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get tracks params
func (o *GetTracksParams) WithContext(ctx context.Context) *GetTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get tracks params
func (o *GetTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get tracks params
func (o *GetTracksParams) WithHTTPClient(client *http.Client) *GetTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get tracks params
func (o *GetTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the get tracks params
func (o *GetTracksParams) WithID(id *string) *GetTracksParams {
o.SetID(id)
return o
}
// SetID adds the id to the get tracks params
func (o *GetTracksParams) SetID(id *string) {
o.ID = id
}
// WithLimit adds the limit to the get tracks params
func (o *GetTracksParams) WithLimit(limit *int64) *GetTracksParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get tracks params
func (o *GetTracksParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get tracks params
func (o *GetTracksParams) WithOffset(offset *int64) *GetTracksParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get tracks params
func (o *GetTracksParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.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 := swag.FormatInt64(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 := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// GetTracksReader is a Reader for the GetTracks structure.
type GetTracksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTracksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTracksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTracksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTracksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTracksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTracksInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetTracksOK creates a GetTracksOK with default headers values
func NewGetTracksOK() *GetTracksOK {
return &GetTracksOK{}
}
/*
GetTracksOK describes a response with status code 200, with default header values.
Track Response Object
*/
type GetTracksOK struct {
Payload *sfgate_models.TrackResponse
}
// IsSuccess returns true when this get tracks o k response has a 2xx status code
func (o *GetTracksOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get tracks o k response has a 3xx status code
func (o *GetTracksOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks o k response has a 4xx status code
func (o *GetTracksOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get tracks o k response has a 5xx status code
func (o *GetTracksOK) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks o k response a status code equal to that given
func (o *GetTracksOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get tracks o k response
func (o *GetTracksOK) Code() int {
return 200
}
func (o *GetTracksOK) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksOK %+v", 200, o.Payload)
}
func (o *GetTracksOK) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksOK %+v", 200, o.Payload)
}
func (o *GetTracksOK) GetPayload() *sfgate_models.TrackResponse {
return o.Payload
}
func (o *GetTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksUnauthorized creates a GetTracksUnauthorized with default headers values
func NewGetTracksUnauthorized() *GetTracksUnauthorized {
return &GetTracksUnauthorized{}
}
/*
GetTracksUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetTracksUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get tracks unauthorized response has a 2xx status code
func (o *GetTracksUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks unauthorized response has a 3xx status code
func (o *GetTracksUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks unauthorized response has a 4xx status code
func (o *GetTracksUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks unauthorized response has a 5xx status code
func (o *GetTracksUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks unauthorized response a status code equal to that given
func (o *GetTracksUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get tracks unauthorized response
func (o *GetTracksUnauthorized) Code() int {
return 401
}
func (o *GetTracksUnauthorized) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %+v", 401, o.Payload)
}
func (o *GetTracksUnauthorized) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %+v", 401, o.Payload)
}
func (o *GetTracksUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTracksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksForbidden creates a GetTracksForbidden with default headers values
func NewGetTracksForbidden() *GetTracksForbidden {
return &GetTracksForbidden{}
}
/*
GetTracksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTracksForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get tracks forbidden response has a 2xx status code
func (o *GetTracksForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks forbidden response has a 3xx status code
func (o *GetTracksForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks forbidden response has a 4xx status code
func (o *GetTracksForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks forbidden response has a 5xx status code
func (o *GetTracksForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks forbidden response a status code equal to that given
func (o *GetTracksForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get tracks forbidden response
func (o *GetTracksForbidden) Code() int {
return 403
}
func (o *GetTracksForbidden) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %+v", 403, o.Payload)
}
func (o *GetTracksForbidden) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %+v", 403, o.Payload)
}
func (o *GetTracksForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTracksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksNotFound creates a GetTracksNotFound with default headers values
func NewGetTracksNotFound() *GetTracksNotFound {
return &GetTracksNotFound{}
}
/*
GetTracksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTracksNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get tracks not found response has a 2xx status code
func (o *GetTracksNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks not found response has a 3xx status code
func (o *GetTracksNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks not found response has a 4xx status code
func (o *GetTracksNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks not found response has a 5xx status code
func (o *GetTracksNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks not found response a status code equal to that given
func (o *GetTracksNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get tracks not found response
func (o *GetTracksNotFound) Code() int {
return 404
}
func (o *GetTracksNotFound) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %+v", 404, o.Payload)
}
func (o *GetTracksNotFound) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %+v", 404, o.Payload)
}
func (o *GetTracksNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTracksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksUnprocessableEntity creates a GetTracksUnprocessableEntity with default headers values
func NewGetTracksUnprocessableEntity() *GetTracksUnprocessableEntity {
return &GetTracksUnprocessableEntity{}
}
/*
GetTracksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTracksUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get tracks unprocessable entity response has a 2xx status code
func (o *GetTracksUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks unprocessable entity response has a 3xx status code
func (o *GetTracksUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks unprocessable entity response has a 4xx status code
func (o *GetTracksUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get tracks unprocessable entity response has a 5xx status code
func (o *GetTracksUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get tracks unprocessable entity response a status code equal to that given
func (o *GetTracksUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get tracks unprocessable entity response
func (o *GetTracksUnprocessableEntity) Code() int {
return 422
}
func (o *GetTracksUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTracksUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTracksUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTracksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTracksInternalServerError creates a GetTracksInternalServerError with default headers values
func NewGetTracksInternalServerError() *GetTracksInternalServerError {
return &GetTracksInternalServerError{}
}
/*
GetTracksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTracksInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get tracks internal server error response has a 2xx status code
func (o *GetTracksInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tracks internal server error response has a 3xx status code
func (o *GetTracksInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tracks internal server error response has a 4xx status code
func (o *GetTracksInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get tracks internal server error response has a 5xx status code
func (o *GetTracksInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get tracks internal server error response a status code equal to that given
func (o *GetTracksInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get tracks internal server error response
func (o *GetTracksInternalServerError) Code() int {
return 500
}
func (o *GetTracksInternalServerError) Error() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %+v", 500, o.Payload)
}
func (o *GetTracksInternalServerError) String() string {
return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %+v", 500, o.Payload)
}
func (o *GetTracksInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTracksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,157 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
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"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// NewPostTracksParams creates a new PostTracksParams 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 NewPostTracksParams() *PostTracksParams {
return &PostTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTracksParamsWithTimeout creates a new PostTracksParams object
// with the ability to set a timeout on a request.
func NewPostTracksParamsWithTimeout(timeout time.Duration) *PostTracksParams {
return &PostTracksParams{
timeout: timeout,
}
}
// NewPostTracksParamsWithContext creates a new PostTracksParams object
// with the ability to set a context for a request.
func NewPostTracksParamsWithContext(ctx context.Context) *PostTracksParams {
return &PostTracksParams{
Context: ctx,
}
}
// NewPostTracksParamsWithHTTPClient creates a new PostTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTracksParamsWithHTTPClient(client *http.Client) *PostTracksParams {
return &PostTracksParams{
HTTPClient: client,
}
}
/*
PostTracksParams contains all the parameters to send to the API endpoint
for the post tracks operation.
Typically these are written to a http.Request.
*/
type PostTracksParams struct {
/* TrackRequest.
An array of new Track records
*/
TrackRequest *sfgate_models.TrackRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) WithDefaults() *PostTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) WithTimeout(timeout time.Duration) *PostTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post tracks params
func (o *PostTracksParams) WithContext(ctx context.Context) *PostTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post tracks params
func (o *PostTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) WithHTTPClient(client *http.Client) *PostTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) WithTrackRequest(trackRequest *sfgate_models.TrackRequest) *PostTracksParams {
o.SetTrackRequest(trackRequest)
return o
}
// SetTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) SetTrackRequest(trackRequest *sfgate_models.TrackRequest) {
o.TrackRequest = trackRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackRequest != nil {
if err := r.SetBodyParam(o.TrackRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,477 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)
// PostTracksReader is a Reader for the PostTracks structure.
type PostTracksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostTracksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTracksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTracksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostTracksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTracksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTracksInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostTracksOK creates a PostTracksOK with default headers values
func NewPostTracksOK() *PostTracksOK {
return &PostTracksOK{}
}
/*
PostTracksOK describes a response with status code 200, with default header values.
Track Response Object
*/
type PostTracksOK struct {
Payload *sfgate_models.TrackResponse
}
// IsSuccess returns true when this post tracks o k response has a 2xx status code
func (o *PostTracksOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post tracks o k response has a 3xx status code
func (o *PostTracksOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks o k response has a 4xx status code
func (o *PostTracksOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post tracks o k response has a 5xx status code
func (o *PostTracksOK) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks o k response a status code equal to that given
func (o *PostTracksOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post tracks o k response
func (o *PostTracksOK) Code() int {
return 200
}
func (o *PostTracksOK) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %+v", 200, o.Payload)
}
func (o *PostTracksOK) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %+v", 200, o.Payload)
}
func (o *PostTracksOK) GetPayload() *sfgate_models.TrackResponse {
return o.Payload
}
func (o *PostTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TrackResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksUnauthorized creates a PostTracksUnauthorized with default headers values
func NewPostTracksUnauthorized() *PostTracksUnauthorized {
return &PostTracksUnauthorized{}
}
/*
PostTracksUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostTracksUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post tracks unauthorized response has a 2xx status code
func (o *PostTracksUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks unauthorized response has a 3xx status code
func (o *PostTracksUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks unauthorized response has a 4xx status code
func (o *PostTracksUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks unauthorized response has a 5xx status code
func (o *PostTracksUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks unauthorized response a status code equal to that given
func (o *PostTracksUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post tracks unauthorized response
func (o *PostTracksUnauthorized) Code() int {
return 401
}
func (o *PostTracksUnauthorized) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PostTracksUnauthorized) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %+v", 401, o.Payload)
}
func (o *PostTracksUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTracksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksForbidden creates a PostTracksForbidden with default headers values
func NewPostTracksForbidden() *PostTracksForbidden {
return &PostTracksForbidden{}
}
/*
PostTracksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostTracksForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post tracks forbidden response has a 2xx status code
func (o *PostTracksForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks forbidden response has a 3xx status code
func (o *PostTracksForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks forbidden response has a 4xx status code
func (o *PostTracksForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks forbidden response has a 5xx status code
func (o *PostTracksForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks forbidden response a status code equal to that given
func (o *PostTracksForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post tracks forbidden response
func (o *PostTracksForbidden) Code() int {
return 403
}
func (o *PostTracksForbidden) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %+v", 403, o.Payload)
}
func (o *PostTracksForbidden) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %+v", 403, o.Payload)
}
func (o *PostTracksForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTracksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksNotFound creates a PostTracksNotFound with default headers values
func NewPostTracksNotFound() *PostTracksNotFound {
return &PostTracksNotFound{}
}
/*
PostTracksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostTracksNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post tracks not found response has a 2xx status code
func (o *PostTracksNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks not found response has a 3xx status code
func (o *PostTracksNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks not found response has a 4xx status code
func (o *PostTracksNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks not found response has a 5xx status code
func (o *PostTracksNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks not found response a status code equal to that given
func (o *PostTracksNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post tracks not found response
func (o *PostTracksNotFound) Code() int {
return 404
}
func (o *PostTracksNotFound) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %+v", 404, o.Payload)
}
func (o *PostTracksNotFound) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %+v", 404, o.Payload)
}
func (o *PostTracksNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTracksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksUnprocessableEntity creates a PostTracksUnprocessableEntity with default headers values
func NewPostTracksUnprocessableEntity() *PostTracksUnprocessableEntity {
return &PostTracksUnprocessableEntity{}
}
/*
PostTracksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostTracksUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post tracks unprocessable entity response has a 2xx status code
func (o *PostTracksUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks unprocessable entity response has a 3xx status code
func (o *PostTracksUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks unprocessable entity response has a 4xx status code
func (o *PostTracksUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post tracks unprocessable entity response has a 5xx status code
func (o *PostTracksUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post tracks unprocessable entity response a status code equal to that given
func (o *PostTracksUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post tracks unprocessable entity response
func (o *PostTracksUnprocessableEntity) Code() int {
return 422
}
func (o *PostTracksUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTracksUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTracksUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTracksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTracksInternalServerError creates a PostTracksInternalServerError with default headers values
func NewPostTracksInternalServerError() *PostTracksInternalServerError {
return &PostTracksInternalServerError{}
}
/*
PostTracksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostTracksInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post tracks internal server error response has a 2xx status code
func (o *PostTracksInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post tracks internal server error response has a 3xx status code
func (o *PostTracksInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post tracks internal server error response has a 4xx status code
func (o *PostTracksInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post tracks internal server error response has a 5xx status code
func (o *PostTracksInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post tracks internal server error response a status code equal to that given
func (o *PostTracksInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post tracks internal server error response
func (o *PostTracksInternalServerError) Code() int {
return 500
}
func (o *PostTracksInternalServerError) Error() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PostTracksInternalServerError) String() string {
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %+v", 500, o.Payload)
}
func (o *PostTracksInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostTracksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new tracks API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for tracks API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
GetTracks(params *GetTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTracksOK, error)
PostTracks(params *PostTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTracksOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
GetTracks gets a list tracks
Return a list of Track records from the datastore
*/
func (a *Client) GetTracks(params *GetTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTracksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetTracksParams()
}
op := &runtime.ClientOperation{
ID: "getTracks",
Method: "GET",
PathPattern: "/tracks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetTracksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*GetTracksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getTracks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostTracks creates new tracks
Create Tracks
*/
func (a *Client) PostTracks(params *PostTracksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostTracksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPostTracksParams()
}
op := &runtime.ClientOperation{
ID: "postTracks",
Method: "POST",
PathPattern: "/tracks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostTracksReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*PostTracksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for postTracks: 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.ClientTransport) {
a.transport = transport
}

View File

@ -0,0 +1,84 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Track track
//
// swagger:model track
type Track struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// description
Description *string `json:"Description,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// image alt text
ImageAltText *string `json:"ImageAltText,omitempty"`
// image URL
ImageURL *string `json:"ImageURL,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// logo
Logo *string `json:"Logo,omitempty"`
// name
Name *string `json:"Name,omitempty"`
// slug
Slug *string `json:"Slug,omitempty"`
}
// Validate validates this track
func (m *Track) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this track based on context it is used
func (m *Track) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Track) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Track) UnmarshalBinary(b []byte) error {
var res Track
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,72 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEvent track event
//
// swagger:model trackEvent
type TrackEvent struct {
// created by ID
CreatedByID *string `json:"CreatedByID,omitempty"`
// created date
CreatedDate *string `json:"CreatedDate,omitempty"`
// event ID
EventID *string `json:"EventID,omitempty"`
// ID
ID string `json:"ID,omitempty"`
// last modified by ID
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
// last modified date
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
// track ID
TrackID *string `json:"TrackID,omitempty"`
}
// Validate validates this track event
func (m *TrackEvent) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this track event based on context it is used
func (m *TrackEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TrackEvent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEvent) UnmarshalBinary(b []byte) error {
var res TrackEvent
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEventRequest An array of TrackEvent objects
//
// swagger:model TrackEventRequest
type TrackEventRequest struct {
// data
Data []*TrackEvent `json:"Data"`
}
// Validate validates this track event request
func (m *TrackEventRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this track event request based on the context it is used
func (m *TrackEventRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackEventRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEventRequest) UnmarshalBinary(b []byte) error {
var res TrackEventRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackEventResponse An array of TrackEvent objects
//
// swagger:model TrackEventResponse
type TrackEventResponse struct {
// data
Data []*TrackEvent `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track event response
func (m *TrackEventResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeta(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackEventResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this track event response based on the context it is used
func (m *TrackEventResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeta(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TrackEventResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackEventResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackEventResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackEventResponse) UnmarshalBinary(b []byte) error {
var res TrackEventResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackRequest An array of Track objects
//
// swagger:model TrackRequest
type TrackRequest struct {
// data
Data []*Track `json:"Data"`
}
// Validate validates this track request
func (m *TrackRequest) 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 *TrackRequest) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this track request based on the context it is used
func (m *TrackRequest) 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 *TrackRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackRequest) UnmarshalBinary(b []byte) error {
var res TrackRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackResponse An array of Track objects
//
// swagger:model TrackResponse
type TrackResponse struct {
// data
Data []*Track `json:"Data"`
// meta
Meta *ResponseMeta `json:"Meta,omitempty"`
}
// Validate validates this track response
func (m *TrackResponse) 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 *TrackResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// ContextValidate validate this track response based on the context it is used
func (m *TrackResponse) 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 *TrackResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
if m.Meta != nil {
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackResponse) UnmarshalBinary(b []byte) error {
var res TrackResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,72 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopic track topic
//
// 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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopic) UnmarshalBinary(b []byte) error {
var res TrackTopic
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopicRequest An array of TrackTopic objects
//
// swagger:model TrackTopicRequest
type TrackTopicRequest struct {
// data
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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicRequest) UnmarshalBinary(b []byte) error {
var res TrackTopicRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackTopicResponse An array of TrackTopic objects
//
// 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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackTopicResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackTopicResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackTopicResponse) UnmarshalBinary(b []byte) error {
var res TrackTopicResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,75 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUser track user
//
// 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
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 {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUser) UnmarshalBinary(b []byte) error {
var res TrackUser
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUserRequest An array of TrackUser objects
//
// swagger:model TrackUserRequest
type TrackUserRequest struct {
// data
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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserRequest) UnmarshalBinary(b []byte) error {
var res TrackUserRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,166 @@
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sfgate_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TrackUserResponse An array of TrackUser objects
//
// 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 swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TrackUserResponse) validateMeta(formats strfmt.Registry) error {
if swag.IsZero(m.Meta) { // not required
return nil
}
if m.Meta != nil {
if err := m.Meta.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
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 err := m.Meta.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Meta")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Meta")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TrackUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TrackUserResponse) UnmarshalBinary(b []byte) error {
var res TrackUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -0,0 +1,23 @@
TrackEvent:
properties:
ID:
type: string
CreatedByID:
type: string
x-nullable: true
CreatedDate:
type: string
x-nullable: true
EventID:
type: string
x-nullable: true
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
TrackID:
type: string
x-nullable: true
type: object

View File

@ -0,0 +1,23 @@
TrackTopic:
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
x-nullable: true
TrackID:
type: string
x-nullable: true
type: object

View File

@ -0,0 +1,26 @@
TrackUser:
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
x-nullable: true
TrackID:
type: string
x-nullable: true
UserID:
type: string
x-nullable: true
type: object

35
swagger/defs/track.yaml Normal file
View File

@ -0,0 +1,35 @@
Track:
properties:
ID:
type: string
CreatedByID:
type: string
x-nullable: true
CreatedDate:
type: string
x-nullable: true
Description:
type: string
x-nullable: true
ImageAltText:
type: string
x-nullable: true
ImageURL:
type: string
x-nullable: true
LastModifiedByID:
type: string
x-nullable: true
LastModifiedDate:
type: string
x-nullable: true
Logo:
type: string
x-nullable: true
Name:
type: string
x-nullable: true
Slug:
type: string
x-nullable: true
type: object

View File

@ -249,6 +249,34 @@ parameters:
required: true
schema:
$ref: "#/definitions/TicketRequest"
TrackRequest:
description: An array of new Track records
in: body
name: trackRequest
required: true
schema:
$ref: "#/definitions/TrackRequest"
TrackEventRequest:
description: An array of new TrackEvent records
in: body
name: trackeventRequest
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: An array of new TrackTopic records
in: body
name: tracktopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: An array of new TrackUser records
in: body
name: trackuserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
TransactionRequest:
description: An array of new Transaction records
in: body
@ -506,6 +534,22 @@ responses:
description: Ticket Response Object
schema:
$ref: "#/definitions/TicketResponse"
TrackResponse:
description: Track Response Object
schema:
$ref: "#/definitions/TrackResponse"
TrackEventResponse:
description: TrackEvent Response Object
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: TrackTopic Response Object
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: TrackUser Response Object
schema:
$ref: "#/definitions/TrackUserResponse"
TransactionResponse:
description: Transaction Response Object
schema:
@ -2726,6 +2770,294 @@ paths:
summary: Update Ticket
tags:
- Tickets
/tracks:
get:
description: Return a list of Track records from the datastore
operationId: getTracks
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list Tracks
tags:
- Tracks
post:
description: Create Tracks
operationId: postTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new Tracks
tags:
- Tracks
put:
description: Update Track
operationId: putTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update Track
tags:
- Tracks
/trackevents:
get:
description: Return a list of TrackEvent records from the datastore
operationId: getTrackEvents
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackEvents
tags:
- TrackEvents
post:
description: Create TrackEvents
operationId: postTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackEvents
tags:
- TrackEvents
put:
description: Update TrackEvent
operationId: putTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackEvent
tags:
- TrackEvents
/tracktopics:
get:
description: Return a list of TrackTopic records from the datastore
operationId: getTrackTopics
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackTopics
tags:
- TrackTopics
post:
description: Create TrackTopics
operationId: postTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackTopics
tags:
- TrackTopics
put:
description: Update TrackTopic
operationId: putTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackTopic
tags:
- TrackTopics
/trackusers:
get:
description: Return a list of TrackUser records from the datastore
operationId: getTrackUsers
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackUsers
tags:
- TrackUsers
post:
description: Create TrackUsers
operationId: postTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackUsers
tags:
- TrackUsers
put:
description: Update TrackUser
operationId: putTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackUser
tags:
- TrackUsers
/transactions:
get:
description: Return a list of Transaction records from the datastore
@ -3569,6 +3901,78 @@ definitions:
$ref: "../../lib/swagger/defs/ticket.yaml#/Ticket"
type: array
type: object
TrackRequest:
description: An array of Track objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackResponse:
description: An array of Track objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackEventRequest:
description: An array of TrackEvent objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackEventResponse:
description: An array of TrackEvent objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackTopicRequest:
description: An array of TrackTopic objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackTopicResponse:
description: An array of TrackTopic objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackUserRequest:
description: An array of TrackUser objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TrackUserResponse:
description: An array of TrackUser objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TransactionRequest:
description: An array of Transaction objects
properties:

View File

@ -412,6 +412,34 @@ parameters:
required: true
schema:
$ref: "#/definitions/TenantRequest"
TrackRequest:
description: An array of new Track records
in: body
name: trackRequest
required: true
schema:
$ref: "#/definitions/TrackRequest"
TrackEventRequest:
description: An array of new TrackEvent records
in: body
name: trackeventRequest
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: An array of new TrackTopic records
in: body
name: tracktopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: An array of new TrackUser records
in: body
name: trackuserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
toipicRequest:
description: A request with an array of Topic Objects
in: body
@ -596,6 +624,22 @@ responses:
description: Response with Tenant objects
schema:
$ref: "#/definitions/TenantResponse"
TrackResponse:
description: Track Response Object
schema:
$ref: "#/definitions/TrackResponse"
TrackEventResponse:
description: TrackEvent Response Object
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: TrackTopic Response Object
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: TrackUser Response Object
schema:
$ref: "#/definitions/TrackUserResponse"
TopicResponse:
description: Response with Topic objects
schema:
@ -2732,6 +2776,202 @@ paths:
summary: Update Tenants
tags:
- Tenants
/tracks:
get:
description: Return a list of Track records from the datastore
operationId: getTracks
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list Tracks
tags:
- Tracks
post:
description: Create Tracks
operationId: postTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new Tracks
tags:
- Tracks
/trackevents:
get:
description: Return a list of TrackEvent records from the datastore
operationId: getTrackEvents
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackEvents
tags:
- TrackEvents
post:
description: Create TrackEvents
operationId: postTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackEvents
tags:
- TrackEvents
/tracktopics:
get:
description: Return a list of TrackTopic records from the datastore
operationId: getTrackTopics
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackTopics
tags:
- TrackTopics
post:
description: Create TrackTopics
operationId: postTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackTopics
tags:
- TrackTopics
/trackusers:
get:
description: Return a list of TrackUser records from the datastore
operationId: getTrackUsers
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackUsers
tags:
- TrackUsers
post:
description: Create TrackUsers
operationId: postTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackUsers
tags:
- TrackUsers
/topics:
get:
description: Retrieve Topic records from the microservice
@ -4807,6 +5047,78 @@ definitions:
description: The User ID
type: string
type: object
TrackRequest:
description: An array of Track objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackResponse:
description: An array of Track objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackEventRequest:
description: An array of TrackEvent objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackEventResponse:
description: An array of TrackEvent objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackTopicRequest:
description: An array of TrackTopic objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackTopicResponse:
description: An array of TrackTopic objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackUserRequest:
description: An array of TrackUser objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TrackUserResponse:
description: An array of TrackUser objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
Topic:
description: A research topic that collects data
properties:

View File

@ -249,6 +249,34 @@ parameters:
required: true
schema:
$ref: "#/definitions/TicketRequest"
TrackRequest:
description: An array of new Track records
in: body
name: trackRequest
required: true
schema:
$ref: "#/definitions/TrackRequest"
TrackEventRequest:
description: An array of new TrackEvent records
in: body
name: trackeventRequest
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: An array of new TrackTopic records
in: body
name: tracktopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: An array of new TrackUser records
in: body
name: trackuserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
TransactionRequest:
description: An array of new Transaction records
in: body
@ -506,6 +534,22 @@ responses:
description: Ticket Response Object
schema:
$ref: "#/definitions/TicketResponse"
TrackResponse:
description: Track Response Object
schema:
$ref: "#/definitions/TrackResponse"
TrackEventResponse:
description: TrackEvent Response Object
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: TrackTopic Response Object
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: TrackUser Response Object
schema:
$ref: "#/definitions/TrackUserResponse"
TransactionResponse:
description: Transaction Response Object
schema:
@ -2726,6 +2770,294 @@ paths:
summary: Update Ticket
tags:
- Tickets
/tracks:
get:
description: Return a list of Track records from the datastore
operationId: getTracks
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list Tracks
tags:
- Tracks
post:
description: Create Tracks
operationId: postTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new Tracks
tags:
- Tracks
put:
description: Update Track
operationId: putTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update Track
tags:
- Tracks
/trackevents:
get:
description: Return a list of TrackEvent records from the datastore
operationId: getTrackEvents
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackEvents
tags:
- TrackEvents
post:
description: Create TrackEvents
operationId: postTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackEvents
tags:
- TrackEvents
put:
description: Update TrackEvent
operationId: putTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackEvent
tags:
- TrackEvents
/tracktopics:
get:
description: Return a list of TrackTopic records from the datastore
operationId: getTrackTopics
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackTopics
tags:
- TrackTopics
post:
description: Create TrackTopics
operationId: postTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackTopics
tags:
- TrackTopics
put:
description: Update TrackTopic
operationId: putTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackTopic
tags:
- TrackTopics
/trackusers:
get:
description: Return a list of TrackUser records from the datastore
operationId: getTrackUsers
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackUsers
tags:
- TrackUsers
post:
description: Create TrackUsers
operationId: postTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackUsers
tags:
- TrackUsers
put:
description: Update TrackUser
operationId: putTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Update TrackUser
tags:
- TrackUsers
/transactions:
get:
description: Return a list of Transaction records from the datastore
@ -3569,6 +3901,78 @@ definitions:
$ref: "../../lib/swagger/defs/ticket.yaml#/Ticket"
type: array
type: object
TrackRequest:
description: An array of Track objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackResponse:
description: An array of Track objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackEventRequest:
description: An array of TrackEvent objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackEventResponse:
description: An array of TrackEvent objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackTopicRequest:
description: An array of TrackTopic objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackTopicResponse:
description: An array of TrackTopic objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackUserRequest:
description: An array of TrackUser objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TrackUserResponse:
description: An array of TrackUser objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TransactionRequest:
description: An array of Transaction objects
properties:

View File

@ -412,6 +412,34 @@ parameters:
required: true
schema:
$ref: "#/definitions/TenantRequest"
TrackRequest:
description: An array of new Track records
in: body
name: trackRequest
required: true
schema:
$ref: "#/definitions/TrackRequest"
TrackEventRequest:
description: An array of new TrackEvent records
in: body
name: trackeventRequest
required: true
schema:
$ref: "#/definitions/TrackEventRequest"
TrackTopicRequest:
description: An array of new TrackTopic records
in: body
name: tracktopicRequest
required: true
schema:
$ref: "#/definitions/TrackTopicRequest"
TrackUserRequest:
description: An array of new TrackUser records
in: body
name: trackuserRequest
required: true
schema:
$ref: "#/definitions/TrackUserRequest"
toipicRequest:
description: A request with an array of Topic Objects
in: body
@ -596,6 +624,22 @@ responses:
description: Response with Tenant objects
schema:
$ref: "#/definitions/TenantResponse"
TrackResponse:
description: Track Response Object
schema:
$ref: "#/definitions/TrackResponse"
TrackEventResponse:
description: TrackEvent Response Object
schema:
$ref: "#/definitions/TrackEventResponse"
TrackTopicResponse:
description: TrackTopic Response Object
schema:
$ref: "#/definitions/TrackTopicResponse"
TrackUserResponse:
description: TrackUser Response Object
schema:
$ref: "#/definitions/TrackUserResponse"
TopicResponse:
description: Response with Topic objects
schema:
@ -2732,6 +2776,202 @@ paths:
summary: Update Tenants
tags:
- Tenants
/tracks:
get:
description: Return a list of Track records from the datastore
operationId: getTracks
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list Tracks
tags:
- Tracks
post:
description: Create Tracks
operationId: postTracks
parameters:
- $ref: "#/parameters/TrackRequest"
responses:
"200":
$ref: "#/responses/TrackResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new Tracks
tags:
- Tracks
/trackevents:
get:
description: Return a list of TrackEvent records from the datastore
operationId: getTrackEvents
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackEvents
tags:
- TrackEvents
post:
description: Create TrackEvents
operationId: postTrackEvents
parameters:
- $ref: "#/parameters/TrackEventRequest"
responses:
"200":
$ref: "#/responses/TrackEventResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackEvents
tags:
- TrackEvents
/tracktopics:
get:
description: Return a list of TrackTopic records from the datastore
operationId: getTrackTopics
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackTopics
tags:
- TrackTopics
post:
description: Create TrackTopics
operationId: postTrackTopics
parameters:
- $ref: "#/parameters/TrackTopicRequest"
responses:
"200":
$ref: "#/responses/TrackTopicResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackTopics
tags:
- TrackTopics
/trackusers:
get:
description: Return a list of TrackUser records from the datastore
operationId: getTrackUsers
parameters:
- $ref: "#/parameters/idQuery"
- $ref: "#/parameters/limitQuery"
- $ref: "#/parameters/offsetQuery"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Get a list TrackUsers
tags:
- TrackUsers
post:
description: Create TrackUsers
operationId: postTrackUsers
parameters:
- $ref: "#/parameters/TrackUserRequest"
responses:
"200":
$ref: "#/responses/TrackUserResponse"
"401":
$ref: "#/responses/Unauthorized"
"403":
$ref: "#/responses/AccessForbidden"
"404":
$ref: "#/responses/NotFound"
"422":
$ref: "#/responses/UnprocessableEntity"
"500":
$ref: "#/responses/ServerError"
security:
- ApiKeyAuth: []
summary: Create new TrackUsers
tags:
- TrackUsers
/topics:
get:
description: Retrieve Topic records from the microservice
@ -4807,6 +5047,78 @@ definitions:
description: The User ID
type: string
type: object
TrackRequest:
description: An array of Track objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackResponse:
description: An array of Track objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track.yaml#/Track"
type: array
type: object
TrackEventRequest:
description: An array of TrackEvent objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackEventResponse:
description: An array of TrackEvent objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-event.yaml#/TrackEvent"
type: array
type: object
TrackTopicRequest:
description: An array of TrackTopic objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackTopicResponse:
description: An array of TrackTopic objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-topic.yaml#/TrackTopic"
type: array
type: object
TrackUserRequest:
description: An array of TrackUser objects
properties:
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
TrackUserResponse:
description: An array of TrackUser objects
properties:
Meta:
$ref: "#/definitions/ResponseMeta"
Data:
items:
$ref: "../../lib/swagger/defs/track-user.yaml#/TrackUser"
type: array
type: object
Topic:
description: A research topic that collects data
properties: