mirror of https://github.com/vernonkeenan/lib
523 lines
15 KiB
Go
523 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 factors
|
|
|
|
// 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/research/research_models"
|
|
)
|
|
|
|
// PutFactorReader is a Reader for the PutFactor structure.
|
|
type PutFactorReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PutFactorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewPutFactorOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewPutFactorUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewPutFactorForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewPutFactorNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewPutFactorUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewPutFactorInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPutFactorOK creates a PutFactorOK with default headers values
|
|
func NewPutFactorOK() *PutFactorOK {
|
|
return &PutFactorOK{}
|
|
}
|
|
|
|
/*
|
|
PutFactorOK describes a response with status code 200, with default header values.
|
|
|
|
Response with Factor objects
|
|
*/
|
|
type PutFactorOK struct {
|
|
Payload *research_models.FactorResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor o k response has a 2xx status code
|
|
func (o *PutFactorOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor o k response has a 3xx status code
|
|
func (o *PutFactorOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor o k response has a 4xx status code
|
|
func (o *PutFactorOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put factor o k response has a 5xx status code
|
|
func (o *PutFactorOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put factor o k response a status code equal to that given
|
|
func (o *PutFactorOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the put factor o k response
|
|
func (o *PutFactorOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *PutFactorOK) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorOK) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorOK) GetPayload() *research_models.FactorResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(research_models.FactorResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutFactorUnauthorized creates a PutFactorUnauthorized with default headers values
|
|
func NewPutFactorUnauthorized() *PutFactorUnauthorized {
|
|
return &PutFactorUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
PutFactorUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type PutFactorUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor unauthorized response has a 2xx status code
|
|
func (o *PutFactorUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor unauthorized response has a 3xx status code
|
|
func (o *PutFactorUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor unauthorized response has a 4xx status code
|
|
func (o *PutFactorUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put factor unauthorized response has a 5xx status code
|
|
func (o *PutFactorUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put factor unauthorized response a status code equal to that given
|
|
func (o *PutFactorUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the put factor unauthorized response
|
|
func (o *PutFactorUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *PutFactorUnauthorized) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorUnauthorized) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorUnauthorized) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorUnauthorized) 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(research_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutFactorForbidden creates a PutFactorForbidden with default headers values
|
|
func NewPutFactorForbidden() *PutFactorForbidden {
|
|
return &PutFactorForbidden{}
|
|
}
|
|
|
|
/*
|
|
PutFactorForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type PutFactorForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor forbidden response has a 2xx status code
|
|
func (o *PutFactorForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor forbidden response has a 3xx status code
|
|
func (o *PutFactorForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor forbidden response has a 4xx status code
|
|
func (o *PutFactorForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put factor forbidden response has a 5xx status code
|
|
func (o *PutFactorForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put factor forbidden response a status code equal to that given
|
|
func (o *PutFactorForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the put factor forbidden response
|
|
func (o *PutFactorForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *PutFactorForbidden) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorForbidden) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorForbidden) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorForbidden) 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(research_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutFactorNotFound creates a PutFactorNotFound with default headers values
|
|
func NewPutFactorNotFound() *PutFactorNotFound {
|
|
return &PutFactorNotFound{}
|
|
}
|
|
|
|
/*
|
|
PutFactorNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type PutFactorNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor not found response has a 2xx status code
|
|
func (o *PutFactorNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor not found response has a 3xx status code
|
|
func (o *PutFactorNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor not found response has a 4xx status code
|
|
func (o *PutFactorNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put factor not found response has a 5xx status code
|
|
func (o *PutFactorNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put factor not found response a status code equal to that given
|
|
func (o *PutFactorNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the put factor not found response
|
|
func (o *PutFactorNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *PutFactorNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorNotFound) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorNotFound) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorNotFound) 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(research_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutFactorUnprocessableEntity creates a PutFactorUnprocessableEntity with default headers values
|
|
func NewPutFactorUnprocessableEntity() *PutFactorUnprocessableEntity {
|
|
return &PutFactorUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
PutFactorUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type PutFactorUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor unprocessable entity response has a 2xx status code
|
|
func (o *PutFactorUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor unprocessable entity response has a 3xx status code
|
|
func (o *PutFactorUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor unprocessable entity response has a 4xx status code
|
|
func (o *PutFactorUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put factor unprocessable entity response has a 5xx status code
|
|
func (o *PutFactorUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put factor unprocessable entity response a status code equal to that given
|
|
func (o *PutFactorUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the put factor unprocessable entity response
|
|
func (o *PutFactorUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *PutFactorUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorUnprocessableEntity) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorUnprocessableEntity) 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(research_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutFactorInternalServerError creates a PutFactorInternalServerError with default headers values
|
|
func NewPutFactorInternalServerError() *PutFactorInternalServerError {
|
|
return &PutFactorInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
PutFactorInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type PutFactorInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put factor internal server error response has a 2xx status code
|
|
func (o *PutFactorInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put factor internal server error response has a 3xx status code
|
|
func (o *PutFactorInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put factor internal server error response has a 4xx status code
|
|
func (o *PutFactorInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put factor internal server error response has a 5xx status code
|
|
func (o *PutFactorInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this put factor internal server error response a status code equal to that given
|
|
func (o *PutFactorInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the put factor internal server error response
|
|
func (o *PutFactorInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *PutFactorInternalServerError) Error() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorInternalServerError) String() string {
|
|
return fmt.Sprintf("[PUT /factors][%d] putFactorInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutFactorInternalServerError) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutFactorInternalServerError) 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(research_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|