lib/api/research/research_client/companies/get_companies_responses.go

523 lines
16 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 companies
// 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"
)
// GetCompaniesReader is a Reader for the GetCompanies structure.
type GetCompaniesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCompaniesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCompaniesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCompaniesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCompaniesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCompaniesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCompaniesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCompaniesInternalServerError()
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())
}
}
// NewGetCompaniesOK creates a GetCompaniesOK with default headers values
func NewGetCompaniesOK() *GetCompaniesOK {
return &GetCompaniesOK{}
}
/*
GetCompaniesOK describes a response with status code 200, with default header values.
Response with Company objects
*/
type GetCompaniesOK struct {
Payload *research_models.CompanyResponse
}
// IsSuccess returns true when this get companies o k response has a 2xx status code
func (o *GetCompaniesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get companies o k response has a 3xx status code
func (o *GetCompaniesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies o k response has a 4xx status code
func (o *GetCompaniesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get companies o k response has a 5xx status code
func (o *GetCompaniesOK) IsServerError() bool {
return false
}
// IsCode returns true when this get companies o k response a status code equal to that given
func (o *GetCompaniesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get companies o k response
func (o *GetCompaniesOK) Code() int {
return 200
}
func (o *GetCompaniesOK) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload)
}
func (o *GetCompaniesOK) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload)
}
func (o *GetCompaniesOK) GetPayload() *research_models.CompanyResponse {
return o.Payload
}
func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.CompanyResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetCompaniesUnauthorized creates a GetCompaniesUnauthorized with default headers values
func NewGetCompaniesUnauthorized() *GetCompaniesUnauthorized {
return &GetCompaniesUnauthorized{}
}
/*
GetCompaniesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetCompaniesUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this get companies unauthorized response has a 2xx status code
func (o *GetCompaniesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get companies unauthorized response has a 3xx status code
func (o *GetCompaniesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies unauthorized response has a 4xx status code
func (o *GetCompaniesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get companies unauthorized response has a 5xx status code
func (o *GetCompaniesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get companies unauthorized response a status code equal to that given
func (o *GetCompaniesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get companies unauthorized response
func (o *GetCompaniesUnauthorized) Code() int {
return 401
}
func (o *GetCompaniesUnauthorized) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload)
}
func (o *GetCompaniesUnauthorized) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload)
}
func (o *GetCompaniesUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesUnauthorized) 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
}
// NewGetCompaniesForbidden creates a GetCompaniesForbidden with default headers values
func NewGetCompaniesForbidden() *GetCompaniesForbidden {
return &GetCompaniesForbidden{}
}
/*
GetCompaniesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetCompaniesForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this get companies forbidden response has a 2xx status code
func (o *GetCompaniesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get companies forbidden response has a 3xx status code
func (o *GetCompaniesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies forbidden response has a 4xx status code
func (o *GetCompaniesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get companies forbidden response has a 5xx status code
func (o *GetCompaniesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get companies forbidden response a status code equal to that given
func (o *GetCompaniesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get companies forbidden response
func (o *GetCompaniesForbidden) Code() int {
return 403
}
func (o *GetCompaniesForbidden) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload)
}
func (o *GetCompaniesForbidden) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload)
}
func (o *GetCompaniesForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesForbidden) 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
}
// NewGetCompaniesNotFound creates a GetCompaniesNotFound with default headers values
func NewGetCompaniesNotFound() *GetCompaniesNotFound {
return &GetCompaniesNotFound{}
}
/*
GetCompaniesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetCompaniesNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this get companies not found response has a 2xx status code
func (o *GetCompaniesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get companies not found response has a 3xx status code
func (o *GetCompaniesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies not found response has a 4xx status code
func (o *GetCompaniesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get companies not found response has a 5xx status code
func (o *GetCompaniesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get companies not found response a status code equal to that given
func (o *GetCompaniesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get companies not found response
func (o *GetCompaniesNotFound) Code() int {
return 404
}
func (o *GetCompaniesNotFound) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload)
}
func (o *GetCompaniesNotFound) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload)
}
func (o *GetCompaniesNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesNotFound) 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
}
// NewGetCompaniesUnprocessableEntity creates a GetCompaniesUnprocessableEntity with default headers values
func NewGetCompaniesUnprocessableEntity() *GetCompaniesUnprocessableEntity {
return &GetCompaniesUnprocessableEntity{}
}
/*
GetCompaniesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetCompaniesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this get companies unprocessable entity response has a 2xx status code
func (o *GetCompaniesUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get companies unprocessable entity response has a 3xx status code
func (o *GetCompaniesUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies unprocessable entity response has a 4xx status code
func (o *GetCompaniesUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get companies unprocessable entity response has a 5xx status code
func (o *GetCompaniesUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get companies unprocessable entity response a status code equal to that given
func (o *GetCompaniesUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get companies unprocessable entity response
func (o *GetCompaniesUnprocessableEntity) Code() int {
return 422
}
func (o *GetCompaniesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCompaniesUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCompaniesUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesUnprocessableEntity) 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
}
// NewGetCompaniesInternalServerError creates a GetCompaniesInternalServerError with default headers values
func NewGetCompaniesInternalServerError() *GetCompaniesInternalServerError {
return &GetCompaniesInternalServerError{}
}
/*
GetCompaniesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetCompaniesInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this get companies internal server error response has a 2xx status code
func (o *GetCompaniesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get companies internal server error response has a 3xx status code
func (o *GetCompaniesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get companies internal server error response has a 4xx status code
func (o *GetCompaniesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get companies internal server error response has a 5xx status code
func (o *GetCompaniesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get companies internal server error response a status code equal to that given
func (o *GetCompaniesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get companies internal server error response
func (o *GetCompaniesInternalServerError) Code() int {
return 500
}
func (o *GetCompaniesInternalServerError) Error() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload)
}
func (o *GetCompaniesInternalServerError) String() string {
return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload)
}
func (o *GetCompaniesInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *GetCompaniesInternalServerError) 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
}