mirror of https://github.com/vernonkeenan/lib
487 lines
15 KiB
Go
487 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 favorites
|
|
|
|
// 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/vernonkeenan/lib/api/members/members_models"
|
|
)
|
|
|
|
// GetFavoritesReader is a Reader for the GetFavorites structure.
|
|
type GetFavoritesReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetFavoritesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetFavoritesOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetFavoritesUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetFavoritesForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetFavoritesNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGetFavoritesUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetFavoritesInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetFavoritesOK creates a GetFavoritesOK with default headers values
|
|
func NewGetFavoritesOK() *GetFavoritesOK {
|
|
return &GetFavoritesOK{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesOK describes a response with status code 200, with default header values.
|
|
|
|
Favorite Response Object
|
|
*/
|
|
type GetFavoritesOK struct {
|
|
Payload *members_models.FavoriteResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites o k response has a 2xx status code
|
|
func (o *GetFavoritesOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites o k response has a 3xx status code
|
|
func (o *GetFavoritesOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites o k response has a 4xx status code
|
|
func (o *GetFavoritesOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites o k response has a 5xx status code
|
|
func (o *GetFavoritesOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get favorites o k response a status code equal to that given
|
|
func (o *GetFavoritesOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the get favorites o k response
|
|
func (o *GetFavoritesOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *GetFavoritesOK) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesOK) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesOK) GetPayload() *members_models.FavoriteResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.FavoriteResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetFavoritesUnauthorized creates a GetFavoritesUnauthorized with default headers values
|
|
func NewGetFavoritesUnauthorized() *GetFavoritesUnauthorized {
|
|
return &GetFavoritesUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access Unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetFavoritesUnauthorized struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites unauthorized response has a 2xx status code
|
|
func (o *GetFavoritesUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites unauthorized response has a 3xx status code
|
|
func (o *GetFavoritesUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites unauthorized response has a 4xx status code
|
|
func (o *GetFavoritesUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites unauthorized response has a 5xx status code
|
|
func (o *GetFavoritesUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get favorites unauthorized response a status code equal to that given
|
|
func (o *GetFavoritesUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the get favorites unauthorized response
|
|
func (o *GetFavoritesUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *GetFavoritesUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesUnauthorized) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesUnauthorized) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesUnauthorized) 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
|
|
}
|
|
|
|
// NewGetFavoritesForbidden creates a GetFavoritesForbidden with default headers values
|
|
func NewGetFavoritesForbidden() *GetFavoritesForbidden {
|
|
return &GetFavoritesForbidden{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetFavoritesForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites forbidden response has a 2xx status code
|
|
func (o *GetFavoritesForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites forbidden response has a 3xx status code
|
|
func (o *GetFavoritesForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites forbidden response has a 4xx status code
|
|
func (o *GetFavoritesForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites forbidden response has a 5xx status code
|
|
func (o *GetFavoritesForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get favorites forbidden response a status code equal to that given
|
|
func (o *GetFavoritesForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the get favorites forbidden response
|
|
func (o *GetFavoritesForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *GetFavoritesForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesForbidden) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesForbidden) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesForbidden) 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
|
|
}
|
|
|
|
// NewGetFavoritesNotFound creates a GetFavoritesNotFound with default headers values
|
|
func NewGetFavoritesNotFound() *GetFavoritesNotFound {
|
|
return &GetFavoritesNotFound{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetFavoritesNotFound struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites not found response has a 2xx status code
|
|
func (o *GetFavoritesNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites not found response has a 3xx status code
|
|
func (o *GetFavoritesNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites not found response has a 4xx status code
|
|
func (o *GetFavoritesNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites not found response has a 5xx status code
|
|
func (o *GetFavoritesNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get favorites not found response a status code equal to that given
|
|
func (o *GetFavoritesNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the get favorites not found response
|
|
func (o *GetFavoritesNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *GetFavoritesNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesNotFound) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesNotFound) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesNotFound) 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
|
|
}
|
|
|
|
// NewGetFavoritesUnprocessableEntity creates a GetFavoritesUnprocessableEntity with default headers values
|
|
func NewGetFavoritesUnprocessableEntity() *GetFavoritesUnprocessableEntity {
|
|
return &GetFavoritesUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetFavoritesUnprocessableEntity struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites unprocessable entity response has a 2xx status code
|
|
func (o *GetFavoritesUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites unprocessable entity response has a 3xx status code
|
|
func (o *GetFavoritesUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites unprocessable entity response has a 4xx status code
|
|
func (o *GetFavoritesUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites unprocessable entity response has a 5xx status code
|
|
func (o *GetFavoritesUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get favorites unprocessable entity response a status code equal to that given
|
|
func (o *GetFavoritesUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the get favorites unprocessable entity response
|
|
func (o *GetFavoritesUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *GetFavoritesUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesUnprocessableEntity) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewGetFavoritesInternalServerError creates a GetFavoritesInternalServerError with default headers values
|
|
func NewGetFavoritesInternalServerError() *GetFavoritesInternalServerError {
|
|
return &GetFavoritesInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
GetFavoritesInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetFavoritesInternalServerError struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get favorites internal server error response has a 2xx status code
|
|
func (o *GetFavoritesInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get favorites internal server error response has a 3xx status code
|
|
func (o *GetFavoritesInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get favorites internal server error response has a 4xx status code
|
|
func (o *GetFavoritesInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get favorites internal server error response has a 5xx status code
|
|
func (o *GetFavoritesInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this get favorites internal server error response a status code equal to that given
|
|
func (o *GetFavoritesInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the get favorites internal server error response
|
|
func (o *GetFavoritesInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *GetFavoritesInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesInternalServerError) String() string {
|
|
return fmt.Sprintf("[GET /favorites][%d] getFavoritesInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetFavoritesInternalServerError) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetFavoritesInternalServerError) 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
|
|
}
|