lib/api/sfgate/sfgate_client/templates/get_templates_responses.go

476 lines
15 KiB
Go
Raw Permalink Normal View History

2021-08-05 19:37:53 +00:00
// 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 templates
import (
"encoding/json"
stderrors "errors"
2021-08-05 19:37:53 +00:00
"fmt"
"io"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
2021-08-05 19:37:53 +00:00
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// GetTemplatesReader is a Reader for the GetTemplates structure.
type GetTemplatesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
2021-08-05 19:37:53 +00:00
switch response.Code() {
case 200:
result := NewGetTemplatesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetTemplatesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTemplatesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTemplatesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTemplatesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTemplatesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /templates] getTemplates", response, response.Code())
2021-08-05 19:37:53 +00:00
}
}
// NewGetTemplatesOK creates a GetTemplatesOK with default headers values
func NewGetTemplatesOK() *GetTemplatesOK {
return &GetTemplatesOK{}
}
// GetTemplatesOK describes a response with status code 200, with default header values.
//
// Response with Template objects
2021-08-05 19:37:53 +00:00
type GetTemplatesOK struct {
Payload *sfgate_models.TemplateResponse
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates o k response has a 2xx status code
func (o *GetTemplatesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get templates o k response has a 3xx status code
func (o *GetTemplatesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates o k response has a 4xx status code
func (o *GetTemplatesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get templates o k response has a 5xx status code
func (o *GetTemplatesOK) IsServerError() bool {
return false
}
// IsCode returns true when this get templates o k response a status code equal to that given
func (o *GetTemplatesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get templates o k response
func (o *GetTemplatesOK) Code() int {
return 200
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %s", 200, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %s", 200, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesOK) GetPayload() *sfgate_models.TemplateResponse {
return o.Payload
}
func (o *GetTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.TemplateResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}
// NewGetTemplatesUnauthorized creates a GetTemplatesUnauthorized with default headers values
func NewGetTemplatesUnauthorized() *GetTemplatesUnauthorized {
return &GetTemplatesUnauthorized{}
}
// GetTemplatesUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
2021-08-05 19:37:53 +00:00
type GetTemplatesUnauthorized struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates unauthorized response has a 2xx status code
func (o *GetTemplatesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get templates unauthorized response has a 3xx status code
func (o *GetTemplatesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates unauthorized response has a 4xx status code
func (o *GetTemplatesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get templates unauthorized response has a 5xx status code
func (o *GetTemplatesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get templates unauthorized response a status code equal to that given
func (o *GetTemplatesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get templates unauthorized response
func (o *GetTemplatesUnauthorized) Code() int {
return 401
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %s", 401, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %s", 401, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTemplatesUnauthorized) 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 && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}
// NewGetTemplatesForbidden creates a GetTemplatesForbidden with default headers values
func NewGetTemplatesForbidden() *GetTemplatesForbidden {
return &GetTemplatesForbidden{}
}
// GetTemplatesForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
2021-08-05 19:37:53 +00:00
type GetTemplatesForbidden struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates forbidden response has a 2xx status code
func (o *GetTemplatesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get templates forbidden response has a 3xx status code
func (o *GetTemplatesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates forbidden response has a 4xx status code
func (o *GetTemplatesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get templates forbidden response has a 5xx status code
func (o *GetTemplatesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get templates forbidden response a status code equal to that given
func (o *GetTemplatesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get templates forbidden response
func (o *GetTemplatesForbidden) Code() int {
return 403
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %s", 403, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %s", 403, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTemplatesForbidden) 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 && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}
// NewGetTemplatesNotFound creates a GetTemplatesNotFound with default headers values
func NewGetTemplatesNotFound() *GetTemplatesNotFound {
return &GetTemplatesNotFound{}
}
// GetTemplatesNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
2021-08-05 19:37:53 +00:00
type GetTemplatesNotFound struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates not found response has a 2xx status code
func (o *GetTemplatesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get templates not found response has a 3xx status code
func (o *GetTemplatesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates not found response has a 4xx status code
func (o *GetTemplatesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get templates not found response has a 5xx status code
func (o *GetTemplatesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get templates not found response a status code equal to that given
func (o *GetTemplatesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get templates not found response
func (o *GetTemplatesNotFound) Code() int {
return 404
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %s", 404, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %s", 404, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTemplatesNotFound) 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 && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}
// NewGetTemplatesUnprocessableEntity creates a GetTemplatesUnprocessableEntity with default headers values
func NewGetTemplatesUnprocessableEntity() *GetTemplatesUnprocessableEntity {
return &GetTemplatesUnprocessableEntity{}
}
// GetTemplatesUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
2021-08-05 19:37:53 +00:00
type GetTemplatesUnprocessableEntity struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates unprocessable entity response has a 2xx status code
func (o *GetTemplatesUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get templates unprocessable entity response has a 3xx status code
func (o *GetTemplatesUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates unprocessable entity response has a 4xx status code
func (o *GetTemplatesUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get templates unprocessable entity response has a 5xx status code
func (o *GetTemplatesUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get templates unprocessable entity response a status code equal to that given
func (o *GetTemplatesUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get templates unprocessable entity response
func (o *GetTemplatesUnprocessableEntity) Code() int {
return 422
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %s", 422, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %s", 422, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTemplatesUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}
// NewGetTemplatesInternalServerError creates a GetTemplatesInternalServerError with default headers values
func NewGetTemplatesInternalServerError() *GetTemplatesInternalServerError {
return &GetTemplatesInternalServerError{}
}
// GetTemplatesInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
2021-08-05 19:37:53 +00:00
type GetTemplatesInternalServerError struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get templates internal server error response has a 2xx status code
func (o *GetTemplatesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get templates internal server error response has a 3xx status code
func (o *GetTemplatesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get templates internal server error response has a 4xx status code
func (o *GetTemplatesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get templates internal server error response has a 5xx status code
func (o *GetTemplatesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get templates internal server error response a status code equal to that given
func (o *GetTemplatesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get templates internal server error response
func (o *GetTemplatesInternalServerError) Code() int {
return 500
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %s", 500, payload)
2021-08-05 19:37:53 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTemplatesInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %s", 500, payload)
2023-03-22 20:49:01 +00:00
}
2021-08-05 19:37:53 +00:00
func (o *GetTemplatesInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetTemplatesInternalServerError) 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 && !stderrors.Is(err, io.EOF) {
2021-08-05 19:37:53 +00:00
return err
}
return nil
}