lib/api/plex/plex_client/companies/get_companies_responses.go

496 lines
15 KiB
Go
Raw Permalink Normal View History

// 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"
2023-04-06 01:28:58 +00:00
"code.tnxs.net/vernonkeenan/lib/api/plex/plex_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.
2023-04-06 01:28:58 +00:00
The SalesforceDevops.net Company Object
*/
type GetCompaniesOK struct {
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesOK) GetPayload() *plex_models.CompanyResponse {
return o.Payload
}
func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_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 {
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesUnauthorized) GetPayload() *plex_models.Error {
return o.Payload
}
func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_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.
2023-04-06 01:28:58 +00:00
Access forbidden, Company lacks access
*/
type GetCompaniesForbidden struct {
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesForbidden) GetPayload() *plex_models.Error {
return o.Payload
}
func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_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
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesNotFound) GetPayload() *plex_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
}
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_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 {
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesUnprocessableEntity) GetPayload() *plex_models.Error {
return o.Payload
}
func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_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
2023-04-06 01:28:58 +00:00
Payload *plex_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)
}
2023-04-06 01:28:58 +00:00
func (o *GetCompaniesInternalServerError) GetPayload() *plex_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
}
2023-04-06 01:28:58 +00:00
o.Payload = new(plex_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}