lib/api/sfgate/sfgate_client/prompts/get_prompts_responses.go

476 lines
14 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 prompts
import (
"encoding/json"
stderrors "errors"
"fmt"
"io"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// GetPromptsReader is a Reader for the GetPrompts structure.
type GetPromptsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetPromptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewGetPromptsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetPromptsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetPromptsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetPromptsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetPromptsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetPromptsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /prompts] getPrompts", response, response.Code())
}
}
// NewGetPromptsOK creates a GetPromptsOK with default headers values
func NewGetPromptsOK() *GetPromptsOK {
return &GetPromptsOK{}
}
// GetPromptsOK describes a response with status code 200, with default header values.
//
// Response with Prompt objects
type GetPromptsOK struct {
Payload *sfgate_models.PromptResponse
}
// IsSuccess returns true when this get prompts o k response has a 2xx status code
func (o *GetPromptsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get prompts o k response has a 3xx status code
func (o *GetPromptsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts o k response has a 4xx status code
func (o *GetPromptsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get prompts o k response has a 5xx status code
func (o *GetPromptsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get prompts o k response a status code equal to that given
func (o *GetPromptsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get prompts o k response
func (o *GetPromptsOK) Code() int {
return 200
}
func (o *GetPromptsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsOK %s", 200, payload)
}
func (o *GetPromptsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsOK %s", 200, payload)
}
func (o *GetPromptsOK) GetPayload() *sfgate_models.PromptResponse {
return o.Payload
}
func (o *GetPromptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.PromptResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewGetPromptsUnauthorized creates a GetPromptsUnauthorized with default headers values
func NewGetPromptsUnauthorized() *GetPromptsUnauthorized {
return &GetPromptsUnauthorized{}
}
// GetPromptsUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
type GetPromptsUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get prompts unauthorized response has a 2xx status code
func (o *GetPromptsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get prompts unauthorized response has a 3xx status code
func (o *GetPromptsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts unauthorized response has a 4xx status code
func (o *GetPromptsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get prompts unauthorized response has a 5xx status code
func (o *GetPromptsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get prompts unauthorized response a status code equal to that given
func (o *GetPromptsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get prompts unauthorized response
func (o *GetPromptsUnauthorized) Code() int {
return 401
}
func (o *GetPromptsUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsUnauthorized %s", 401, payload)
}
func (o *GetPromptsUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsUnauthorized %s", 401, payload)
}
func (o *GetPromptsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetPromptsUnauthorized) 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) {
return err
}
return nil
}
// NewGetPromptsForbidden creates a GetPromptsForbidden with default headers values
func NewGetPromptsForbidden() *GetPromptsForbidden {
return &GetPromptsForbidden{}
}
// GetPromptsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type GetPromptsForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get prompts forbidden response has a 2xx status code
func (o *GetPromptsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get prompts forbidden response has a 3xx status code
func (o *GetPromptsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts forbidden response has a 4xx status code
func (o *GetPromptsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get prompts forbidden response has a 5xx status code
func (o *GetPromptsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get prompts forbidden response a status code equal to that given
func (o *GetPromptsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get prompts forbidden response
func (o *GetPromptsForbidden) Code() int {
return 403
}
func (o *GetPromptsForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsForbidden %s", 403, payload)
}
func (o *GetPromptsForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsForbidden %s", 403, payload)
}
func (o *GetPromptsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetPromptsForbidden) 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) {
return err
}
return nil
}
// NewGetPromptsNotFound creates a GetPromptsNotFound with default headers values
func NewGetPromptsNotFound() *GetPromptsNotFound {
return &GetPromptsNotFound{}
}
// GetPromptsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type GetPromptsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get prompts not found response has a 2xx status code
func (o *GetPromptsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get prompts not found response has a 3xx status code
func (o *GetPromptsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts not found response has a 4xx status code
func (o *GetPromptsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get prompts not found response has a 5xx status code
func (o *GetPromptsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get prompts not found response a status code equal to that given
func (o *GetPromptsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get prompts not found response
func (o *GetPromptsNotFound) Code() int {
return 404
}
func (o *GetPromptsNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsNotFound %s", 404, payload)
}
func (o *GetPromptsNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsNotFound %s", 404, payload)
}
func (o *GetPromptsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetPromptsNotFound) 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) {
return err
}
return nil
}
// NewGetPromptsUnprocessableEntity creates a GetPromptsUnprocessableEntity with default headers values
func NewGetPromptsUnprocessableEntity() *GetPromptsUnprocessableEntity {
return &GetPromptsUnprocessableEntity{}
}
// GetPromptsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type GetPromptsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get prompts unprocessable entity response has a 2xx status code
func (o *GetPromptsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get prompts unprocessable entity response has a 3xx status code
func (o *GetPromptsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts unprocessable entity response has a 4xx status code
func (o *GetPromptsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get prompts unprocessable entity response has a 5xx status code
func (o *GetPromptsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get prompts unprocessable entity response a status code equal to that given
func (o *GetPromptsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get prompts unprocessable entity response
func (o *GetPromptsUnprocessableEntity) Code() int {
return 422
}
func (o *GetPromptsUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsUnprocessableEntity %s", 422, payload)
}
func (o *GetPromptsUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsUnprocessableEntity %s", 422, payload)
}
func (o *GetPromptsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetPromptsUnprocessableEntity) 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) {
return err
}
return nil
}
// NewGetPromptsInternalServerError creates a GetPromptsInternalServerError with default headers values
func NewGetPromptsInternalServerError() *GetPromptsInternalServerError {
return &GetPromptsInternalServerError{}
}
// GetPromptsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type GetPromptsInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get prompts internal server error response has a 2xx status code
func (o *GetPromptsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get prompts internal server error response has a 3xx status code
func (o *GetPromptsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get prompts internal server error response has a 4xx status code
func (o *GetPromptsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get prompts internal server error response has a 5xx status code
func (o *GetPromptsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get prompts internal server error response a status code equal to that given
func (o *GetPromptsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get prompts internal server error response
func (o *GetPromptsInternalServerError) Code() int {
return 500
}
func (o *GetPromptsInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsInternalServerError %s", 500, payload)
}
func (o *GetPromptsInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /prompts][%d] getPromptsInternalServerError %s", 500, payload)
}
func (o *GetPromptsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetPromptsInternalServerError) 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) {
return err
}
return nil
}