lib/api/sfgate/sfgate_client/tracks/post_tracks_responses.go

478 lines
14 KiB
Go
Raw Normal View History

2023-09-30 15:38:27 +00:00
// 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
}