mirror of https://github.com/vernonkeenan/lib
485 lines
15 KiB
Go
485 lines
15 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package tracks
|
|
|
|
import (
|
|
"encoding/json"
|
|
stderrors "errors"
|
|
"fmt"
|
|
"io"
|
|
|
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// 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) (any, 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("[POST /tracks] postTracks", 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.
|
|
//
|
|
// Governed Track response
|
|
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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *PostTracksOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksOK %s", 200, 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 && !stderrors.Is(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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %s", 401, payload)
|
|
}
|
|
|
|
func (o *PostTracksUnauthorized) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksUnauthorized %s", 401, 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 && !stderrors.Is(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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %s", 403, payload)
|
|
}
|
|
|
|
func (o *PostTracksForbidden) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksForbidden %s", 403, 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 && !stderrors.Is(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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %s", 404, payload)
|
|
}
|
|
|
|
func (o *PostTracksNotFound) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksNotFound %s", 404, 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 && !stderrors.Is(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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %s", 422, payload)
|
|
}
|
|
|
|
func (o *PostTracksUnprocessableEntity) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksUnprocessableEntity %s", 422, 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 && !stderrors.Is(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 {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %s", 500, payload)
|
|
}
|
|
|
|
func (o *PostTracksInternalServerError) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /tracks][%d] postTracksInternalServerError %s", 500, 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|